Commit dba730f
committed
ctrld: usb: Add option to ignore EIDs in the config JSON
We support ignoring EIDs returned by the bridge's routing table by
supplying the `-z` parameter. This parameter is typically included in
the systemd environment file.
The above method does not work well for templated control daemon
services (such as USB) if we have the need to ignore different set of
EIDs for a given instance of the service.
Therefore, this commit adds support to supply an array of decimal EIDs
in the USB config JSON, which when supplied, will override any ignore
EIDs in the -z parameter. Since the JSON has separate sections for every
control daemon instance, this method can be used to supply unique ignore
list per instance.
Fixes JIRA https://jirasw.nvidia.com/browse/DGXOPENBMC-17580
Tested:
Tested this on HGXB300 setup by temporarily overriding the USB config
JSON as follows:
```
"1-1-1-2": {
"eid_type" : "static",
"own_eid" : 8,
"bridge_eid" : 70,
"bridge_pool_start" : 57,
"ignore_eids" : [58, 59, 60],
"vendor_id" : "0x0955",
"product_id" : "0xCF11",
"recovery_vendor_id": "0x0955",
"recovery_product_id": "0xCF1F",
"reset_gpio_name": "MCU2_RST_N-O",
"recovery_gpio_name": "MCU2_RECOV_N-O",
"_comment" : "CX8 MCU openbmc#2: CX8_3/CX8_1"
}
```
Then, upon restarting the specific control daemon instance:
```
May 08 10:54:20 hgxb300 systemd[1]: Started MCTP USB control daemon.
May 08 10:54:20 hgxb300 mctp-usb-ctrl 1-1-1-2[27536]: parse_command_line: No. of EIDs to ignore: 8
May 08 10:54:20 hgxb300 mctp-usb-ctrl 1-1-1-2[27536]: parse_command_line: Verbose level:1
May 08 10:54:20 hgxb300 mctp-usb-ctrl 1-1-1-2[27536]: parse_command_line: EID to ignore: 58
May 08 10:54:20 hgxb300 mctp-usb-ctrl 1-1-1-2[27536]: parse_command_line: EID to ignore: 59
May 08 10:54:20 hgxb300 mctp-usb-ctrl 1-1-1-2[27536]: parse_command_line: EID to ignore: 60
```
The EIDs to ignore get overridden to 58, 59 and 60.
The discovery output now shows:
```
root@hgxb300:~# busctl tree xyz.openbmc_project.MCTP.Control.USB1_1_1_2
`- /xyz
`- /xyz/openbmc_project
`- /xyz/openbmc_project/mctp
|- /xyz/openbmc_project/mctp/0
| |- /xyz/openbmc_project/mctp/0/57
| `- /xyz/openbmc_project/mctp/0/70
`- /xyz/openbmc_project/mctp/USB1_1_1_2
```
Also verified that other service instance are not impacted as they
continue to use the global ignore list.
Signed-off-by: Santosh Puranik <spuranik@nvidia.com>1 parent 3439f0c commit dba730f
2 files changed
Lines changed: 35 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1332 | 1332 | | |
1333 | 1333 | | |
1334 | 1334 | | |
1335 | | - | |
1336 | | - | |
1337 | | - | |
1338 | | - | |
1339 | | - | |
1340 | 1335 | | |
1341 | 1336 | | |
1342 | 1337 | | |
| |||
1562 | 1557 | | |
1563 | 1558 | | |
1564 | 1559 | | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
1565 | 1564 | | |
1566 | 1565 | | |
1567 | 1566 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1142 | 1142 | | |
1143 | 1143 | | |
1144 | 1144 | | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
| 1156 | + | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
1145 | 1176 | | |
1146 | 1177 | | |
1147 | 1178 | | |
| |||
0 commit comments