Commit 686395a
committed
Add Allocate Endpoint ID support for MCTP Bridge
* New mctpd method to send Allocate Endpoint ID mctp control message
* Timer for MCTP Bridge to settle ( observed it takes sometime for
Bridges like FPGA to allocate downstream eids to endpoints during
which any request on the downstream endpoint fails)
* update AssignEndpoint and AssignEndpointStatic method to consider
Endpoint nature (MCTP bridge based on pool size received)
* Check for presence of contiguous available EIDs of pool size.
* Pytest framework change
> Introduced new Endpoint of MCTP Bridge type (pool size =2)
> New test method to validate endpoint_allocate_eid()
> update existing pytest method to accomodate for new endpoint
in present network
'''
System contains MCTP Bridge (FPGA) over USB which has
downstream endpoints such as EROTS, IROTS.
MCTP Bridge is one bus usb1-1 populating as mctpusb0 interface.
USBMON :
==================
cat /sys/kernel/debug/usb/usbmon/1u
866e6900 886711482 S Bo:1:002:1 -115 13 = 1ab4000d 010008c8 00800100 0c -> SET EID 0xc
866e6900 886711719 C Bo:1:002:1 0 13 >
82a05f00 886711737 C Bi:1:002:2 0 15 = 1ab4000f 01080cc0 00000100 120c0f -> Bridge size 0xf
82a05f00 886711753 S Bi:1:002:2 -115 512 <
866e6200 886712339 S Bo:1:002:1 -115 11 = 1ab4000b 010c08c8 008105 -> GET MSSG TYPE (eid : 0xc)
866e6200 886712449 C Bo:1:002:1 0 11 >
82a05f00 886712461 C Bi:1:002:2 0 14 = 1ab4000e 01080cc0 00010500 017e
82a05f00 886712474 S Bi:1:002:2 -115 512 <
866e6900 886712862 S Bo:1:002:1 -115 11 = 1ab4000b 010c08c8 008203 -> GET UUID (eid : 0xc)
866e6900 886712961 C Bo:1:002:1 0 11 >
82a05f00 886712975 C Bi:1:002:2 0 28 = 1ab4001c 01080cc0 00020300 xxxx xxxx xxxx xxxx
82a05f00 886712993 S Bi:1:002:2 -115 512 <
866e6200 886714375 S Bo:1:002:1 -115 14 = 1ab4000e 010c08c8 00830800 0f0d -> ALLOCATE EID 0xc, bridge size 0xf, start eid 0xd
866e6200 886714455 C Bo:1:002:1 0 14 >
82a05f00 886714475 C Bi:1:002:2 0 15 = 1ab4000f 01080cc0 00030800 010f0d
82a05f00 886714490 S Bi:1:002:2 -115 512 <
85e6ab80 890712851 S Bo:1:002:1 -115 11 = 1ab4000b 010d08c8 008405 -> GET MSSG TYPE (eid : 0xd)
85e6ab80 890713119 C Bo:1:002:1 0 11 >
82a05f00 890713452 C Bi:1:002:2 0 17 = 1ab40011 01080dc0 00040500 0401057e 7f
82a05f00 890713487 S Bi:1:002:2 -115 512 <
85e6a780 890713984 S Bo:1:002:1 -115 11 = 1ab4000b 010d08c8 008503 -> GET UUID (eid : 0xd)
85e6a780 890714073 C Bo:1:002:1 0 11 >
82a05f00 890714451 C Bi:1:002:2 0 28 = 1ab4001c 01080dc0 00050300 xxxx xxxx xxxx xxxx
82a05f00 890714496 S Bi:1:002:2 -115 512 <
85e6a180 890718152 S Bo:1:002:1 -115 11 = 1ab4000b 010e08c8 008605 -> GET MSSG TYPE (eid : 0xe) (Timedout)
85e6a180 890718331 C Bo:1:002:1 0 11 >
86654980 891215635 S Bo:1:002:1 -115 11 = 1ab4000b 010e08c8 008703 -> GET UUID (eid : 0xe) (Timedout)
86654980 891215839 C Bo:1:002:1 0 11 >
86654e00 891712957 S Bo:1:002:1 -115 11 = 1ab4000b 010f08c8 008805 -> GET MSSG TYPE (eid : 0xf)
86654e00 891713082 C Bo:1:002:1 0 11 >
82a05f00 891713576 C Bi:1:002:2 0 17 = 1ab40011 01080fc0 00080500 0401057e 7f
82a05f00 891713615 S Bi:1:002:2 -115 512 <
85e6a400 891715076 S Bo:1:002:1 -115 11 = 1ab4000b 010f08c8 008903
85e6a400 891715199 C Bo:1:002:1 0 11 >
MCTPD Traces
=======================
busctl call au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/interfaces/mctpusb0 au.com.codeconstruct.MCTP.BusOwner1 AssignEndpoint ay 0
yisb 12 1 "/au/com/codeconstruct/mctp1/networks/1/endpoints/12" true
mctpd: read_message got from sockaddr_mctp_ext eid 12 net 1 type 0x00 if 3 hw len 0 0x len 6
mctpd: physaddr if 3 hw len 0 0x requested allocation of pool size = 15
mctpd: emit_endpoint_added: /au/com/codeconstruct/mctp1/networks/1/endpoints/12
endpoint_allocate_eid Asking for contiguous EIDs for pool with start eid : 13
mctpd: endpoint_send_allocate_endpoint_id Allocation was rejected as it was Allocated by other bus
endpoint_send_allocate_endpoint_id Allocated size of 15, starting from EID 13
Bridge Time expired, set pool eids
mctpd: emit_endpoint_added: /au/com/codeconstruct/mctp1/networks/1/endpoints/13
mctpd: Error getting endpoint types for peer eid 14 net 1 phys physaddr if 3 hw len 0 0x state 1. Ignoring error -110 Connection timed out
mctpd: Error getting UUID for peer eid 14 net 1 phys physaddr if 3 hw len 0 0x state 1. Ignoring error -110 Connection timed out
mctpd: emit_endpoint_added: /au/com/codeconstruct/mctp1/networks/1/endpoints/14
mctpd: emit_endpoint_added: /au/com/codeconstruct/mctp1/networks/1/endpoints/15
===============================================================================
mctp addr show
eid 8 net 1 dev mctpusb0
busctl tree au.com.codeconstruct.MCTP1
`- /au
`- /au/com
`- /au/com/codeconstruct
`- /au/com/codeconstruct/mctp1
|- /au/com/codeconstruct/mctp1/interfaces
| |- /au/com/codeconstruct/mctp1/interfaces/lo
\ | `- /au/com/codeconstruct/mctp1/interfaces/mctpusb0
`- /au/com/codeconstruct/mctp1/networks
`- /au/com/codeconstruct/mctp1/networks/1
`- /au/com/codeconstruct/mctp1/networks/1/endpoints
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/12
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/13
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/14
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/15
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/16
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/17
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/18
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/19
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/20
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/21
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/22
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/23
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/24
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/25
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/26
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/27
|- /au/com/codeconstruct/mctp1/networks/1/endpoints/8
==========================================================================
PYTEST
ninja -C obj test
ninja: Entering directory `obj'
[0/1] Running all tests.
1/1 test-mctpd OK 21.17s 20 subtests passed
Ok: 1
Expected Fail: 0
Fail: 0
Unexpected Pass: 0
Skipped: 0
Timeout: 0
'''
Signed-off-by: Faizan Ali <faizana@nvidia.com>1 parent 3f9ec21 commit 686395a
3 files changed
+234
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
243 | 244 | | |
244 | 245 | | |
245 | 246 | | |
| 247 | + | |
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
| |||
2107 | 2109 | | |
2108 | 2110 | | |
2109 | 2111 | | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
2110 | 2122 | | |
2111 | 2123 | | |
2112 | 2124 | | |
| |||
2185 | 2197 | | |
2186 | 2198 | | |
2187 | 2199 | | |
| 2200 | + | |
| 2201 | + | |
2188 | 2202 | | |
2189 | 2203 | | |
| 2204 | + | |
2190 | 2205 | | |
2191 | 2206 | | |
2192 | 2207 | | |
| |||
4494 | 4509 | | |
4495 | 4510 | | |
4496 | 4511 | | |
| 4512 | + | |
| 4513 | + | |
| 4514 | + | |
| 4515 | + | |
| 4516 | + | |
| 4517 | + | |
| 4518 | + | |
| 4519 | + | |
| 4520 | + | |
| 4521 | + | |
| 4522 | + | |
| 4523 | + | |
| 4524 | + | |
| 4525 | + | |
| 4526 | + | |
| 4527 | + | |
| 4528 | + | |
| 4529 | + | |
| 4530 | + | |
| 4531 | + | |
| 4532 | + | |
| 4533 | + | |
| 4534 | + | |
| 4535 | + | |
| 4536 | + | |
| 4537 | + | |
| 4538 | + | |
| 4539 | + | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
| 4544 | + | |
| 4545 | + | |
| 4546 | + | |
| 4547 | + | |
| 4548 | + | |
| 4549 | + | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
| 4559 | + | |
| 4560 | + | |
| 4561 | + | |
| 4562 | + | |
| 4563 | + | |
| 4564 | + | |
| 4565 | + | |
| 4566 | + | |
| 4567 | + | |
| 4568 | + | |
| 4569 | + | |
| 4570 | + | |
| 4571 | + | |
| 4572 | + | |
| 4573 | + | |
| 4574 | + | |
| 4575 | + | |
| 4576 | + | |
| 4577 | + | |
| 4578 | + | |
| 4579 | + | |
| 4580 | + | |
| 4581 | + | |
| 4582 | + | |
| 4583 | + | |
| 4584 | + | |
| 4585 | + | |
| 4586 | + | |
| 4587 | + | |
| 4588 | + | |
| 4589 | + | |
| 4590 | + | |
| 4591 | + | |
| 4592 | + | |
| 4593 | + | |
| 4594 | + | |
| 4595 | + | |
| 4596 | + | |
| 4597 | + | |
| 4598 | + | |
| 4599 | + | |
| 4600 | + | |
| 4601 | + | |
| 4602 | + | |
| 4603 | + | |
| 4604 | + | |
| 4605 | + | |
| 4606 | + | |
| 4607 | + | |
| 4608 | + | |
| 4609 | + | |
| 4610 | + | |
| 4611 | + | |
| 4612 | + | |
| 4613 | + | |
| 4614 | + | |
| 4615 | + | |
| 4616 | + | |
| 4617 | + | |
| 4618 | + | |
| 4619 | + | |
| 4620 | + | |
| 4621 | + | |
| 4622 | + | |
| 4623 | + | |
| 4624 | + | |
| 4625 | + | |
| 4626 | + | |
| 4627 | + | |
| 4628 | + | |
| 4629 | + | |
| 4630 | + | |
| 4631 | + | |
| 4632 | + | |
| 4633 | + | |
| 4634 | + | |
| 4635 | + | |
| 4636 | + | |
| 4637 | + | |
| 4638 | + | |
| 4639 | + | |
| 4640 | + | |
| 4641 | + | |
| 4642 | + | |
| 4643 | + | |
| 4644 | + | |
| 4645 | + | |
| 4646 | + | |
| 4647 | + | |
| 4648 | + | |
| 4649 | + | |
| 4650 | + | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
| 4656 | + | |
| 4657 | + | |
| 4658 | + | |
| 4659 | + | |
| 4660 | + | |
| 4661 | + | |
| 4662 | + | |
| 4663 | + | |
| 4664 | + | |
| 4665 | + | |
4497 | 4666 | | |
4498 | 4667 | | |
4499 | 4668 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
317 | 323 | | |
318 | 324 | | |
319 | 325 | | |
| |||
348 | 354 | | |
349 | 355 | | |
350 | 356 | | |
351 | | - | |
| 357 | + | |
352 | 358 | | |
353 | | - | |
| 359 | + | |
354 | 360 | | |
355 | 361 | | |
356 | 362 | | |
| |||
570 | 576 | | |
571 | 577 | | |
572 | 578 | | |
573 | | - | |
| 579 | + | |
574 | 580 | | |
575 | 581 | | |
576 | 582 | | |
| |||
1031 | 1037 | | |
1032 | 1038 | | |
1033 | 1039 | | |
1034 | | - | |
1035 | | - | |
| 1040 | + | |
| 1041 | + | |
1036 | 1042 | | |
1037 | 1043 | | |
1038 | 1044 | | |
| |||
1044 | 1050 | | |
1045 | 1051 | | |
1046 | 1052 | | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
1047 | 1059 | | |
1048 | 1060 | | |
1049 | 1061 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
531 | 531 | | |
532 | 532 | | |
533 | 533 | | |
534 | | - | |
| 534 | + | |
535 | 535 | | |
536 | 536 | | |
537 | 537 | | |
| |||
555 | 555 | | |
556 | 556 | | |
557 | 557 | | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
0 commit comments