Skip to content

Commit 3b1e91d

Browse files
committed
mctpd: Move BusOwner1 interface to MCTP interface objects
In 9b4eabc ("mctpd: use .DRAFT suffix on BusOwner1 interface"), we renamed BusOwner1 to BusOwner1.DRAFT while it was present on the top-level dbus object. Now that we have the interface objects present, we can move the BusOwner interfaces to their proper location on those interfaces, and drop the DRAFT1 suffix. Because we already know the object, we no longer need the interface name string as the first argument to all calls. Signed-off-by: Jeremy Kerr <[email protected]>
1 parent 403a167 commit 3b1e91d

File tree

7 files changed

+171
-127
lines changed

7 files changed

+171
-127
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
3434
and version interface, bus owner and entry-point object names. See
3535
docs/mctpd.md for full details on the new interface.
3636

37+
5. In line with the above, bus-owner related dbus methods (SetupEndpoint and
38+
friends) now exist on the MCTP interface objects, and only when those
39+
interface objects have the bus owner role. Because those methods are
40+
now associated with the interface object, they no longer take the
41+
interface name as their first argument.
42+
3743
### Fixed
3844

3945
1. mctpd: EID assignments now work in the case where a new endpoint has a

README.md

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -73,16 +73,18 @@ coordinate the local setup and the supervision of the mctpd process.
7373
An example configuration is in [`conf/mctpd.conf`](conf/mctpd.conf).
7474

7575
The `mctpd` daemon will expose a dbus interface, claiming the bus name
76-
`au.com.codeconstruct.MCTP1` and object path `/au/com/codeconstruct/mctp1`. This
77-
provides a few functions for configuring remote endpoints:
78-
79-
# busctl introspect au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/
80-
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
81-
au.com.codeconstruct.MCTP interface - - -
82-
.AssignEndpoint method say yisb -
83-
.AssignEndpointStatic method sayy yisb -
84-
.LearnEndpoint method say yisb -
85-
.SetupEndpoint method say yisb -
76+
`au.com.codeconstruct.MCTP1` and object path `/au/com/codeconstruct/mctp1`.
77+
78+
Each detected MCTP interface on the system provides a few functions for
79+
configuring remote endpoints on that bus:
80+
81+
# busctl introspect au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/interfaces/mctpi2c1
82+
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
83+
au.com.codeconstruct.MCTP.Interface1 interface - - -
84+
.AssignEndpoint method ay yisb -
85+
.AssignEndpointStatic method ayy yisb -
86+
.LearnEndpoint method ay yisb -
87+
.SetupEndpoint method ay yisb -
8688

8789
Results of mctpd enumeration are also represented as dbus objects, using the
8890
OpenBMC-specified MCTP endpoint format. Each endpoint appears on the bus at the

docs/endpoint-recovery.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ root@cc-nvme-mi:~# busctl tree au.com.codeconstruct.MCTP1
149149
└─/au/com
150150
└─/au/com/codeconstruct
151151
└─/au/com/codeconstruct/mctp1
152+
├─/au/com/codeconstruct/mctp1/interfaces/mctpi2c0
152153
├─/au/com/codeconstruct/mctp1/networks/1
153154
│ └─/au/com/codeconstruct/mctp1/networks/1/endpoints/12
154155
├─/au/com/codeconstruct/mctp1/networks/1/endpoints/8
@@ -158,10 +159,6 @@ root@cc-nvme-mi:~# busctl tree au.com.codeconstruct.MCTP1
158159
```
159160
root@cc-nvme-mi:~# busctl introspect au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1
160161
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
161-
au.com.codeconstruct.Endpoint1 interface - - -
162-
.AssignEndpoint method say yisb -
163-
.LearnEndpoint method say yisb -
164-
.SetupEndpoint method say yisb -
165162
org.freedesktop.DBus.Introspectable interface - - -
166163
.Introspect method - s -
167164
org.freedesktop.DBus.ObjectManager interface - - -
@@ -178,6 +175,25 @@ org.freedesktop.DBus.Properties interface - - -
178175
.PropertiesChanged signal sa{sv}as - -
179176
```
180177

178+
```
179+
root@cc-nvme-mi:~# busctl introspect au.com.codeconstruct.MCTP1 /au/com/codeconstruct/mctp1/interfaces/mctpi2c0
180+
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
181+
au.com.codeconstruct.Interface1 interface - - -
182+
.AssignEndpoint method ay yisb -
183+
.LearnEndpoint method ay yisb -
184+
.SetupEndpoint method ay yisb -
185+
org.freedesktop.DBus.Introspectable interface - - -
186+
.Introspect method - s -
187+
org.freedesktop.DBus.Peer interface - - -
188+
.GetMachineId method - s -
189+
.Ping method - - -
190+
org.freedesktop.DBus.Properties interface - - -
191+
.Get method ss v -
192+
.GetAll method s a{sv} -
193+
.Set method ssv - -
194+
.PropertiesChanged signal sa{sv}as - -
195+
```
196+
181197
```
182198
root@cc-nvme-mi:~# busctl introspect au.com.codeconstruct.MCTP1 /au/com/codecontrust/mctp1/networks/1
183199
NAME TYPE SIGNATURE RESULT/VALUE FLAGS
@@ -361,8 +377,8 @@ The general strategy for tracking endpoint lifecycles is [as follows]
361377
registered as an MCTP endpoint.
362378

363379
2. The FRU data is decoded and `SetupEndpoint` on the
364-
`au.com.codeconstruct.MCTP.BusOwner1.DRAFT` interface of the
365-
`/au/com/codeconstruct/mctp1`
380+
`au.com.codeconstruct.MCTP.BusOwner1` interface of the
381+
`/au/com/codeconstruct/mctp1/interfaces/<interface>`
366382
object hosted by `mctpd` is invoked.
367383

368384
3. The device was not previously configured and has no programmed static EID.

docs/mctpd.md

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,20 @@ As well as those standard interfaces, `mctpd` provides methods to add and
1313
configure MCTP endpoints. These are provided by the `au.com.codeconstruct.MCTP1`
1414
D-Bus interface.
1515

16-
## Bus-owner methods: `au.com.codeconstruct.MCTP.BusOwner1.DRAFT` interface
16+
## Bus-owner methods: `au.com.codeconstruct.MCTP.BusOwner1` interface
1717

18-
This interface exposes bus-owner level functions.
18+
This interface exposes bus-owner level functions, on each interface object that
19+
represents the bus-owner side of a transport.
1920

20-
### `.SetupEndpoint`: `say``yisb`
21+
### `.SetupEndpoint`: `ay``yisb`
2122

22-
This method is the normal method used to add a MCTP endpoint. The endpoint is
23-
identified by MCTP network interface, and physical address. `mctpd` will query
24-
for the endpoint's current EID, and assign an EID to the endpoint if needed.
25-
`mctpd` will add local MCTP routes and neighbour table entries for endpoints as
26-
they are added.
23+
This method is the normal method used to add a MCTP endpoint on this interface.
24+
The endpoint is identified by physical address. `mctpd` will query for the
25+
endpoint's current EID, and assign an EID to the endpoint if needed. `mctpd`
26+
will add local MCTP routes and neighbour table entries for endpoints as they are
27+
added.
2728

28-
`SetupEndpoint <interface name> <hwaddr>`
29+
`SetupEndpoint <hwaddr>`
2930

3031
Returns
3132
```
@@ -45,24 +46,24 @@ An example:
4546

4647
```shell
4748
busctl call au.com.codeconstruct.MCTP1 \
48-
/au/com/codeconstruct/mctp1 \
49-
au.com.codeconstruct.MCTP1 \
50-
SetupEndpoint say mctpi2c6 1 0x1d
49+
/au/com/codeconstruct/mctp1/interfaces/mctpi2c6 \
50+
au.com.codeconstruct.MCTP.Interface1 \
51+
SetupEndpoint ay 1 0x1d
5152
```
5253
`1` is the length of the hwaddr array.
5354

54-
### `.AssignEndpoint`: `say``yisb`
55+
### `.AssignEndpoint`: `ay``yisb`
5556

5657
Similar to SetupEndpoint, but will always assign an EID rather than querying for
5758
existing ones. Will return `new = false` when an endpoint is already known to
5859
`mctpd`.
5960

60-
### `.AssignEndpointStatic`: `sayy``yisb`
61+
### `.AssignEndpointStatic`: `ayy``yisb`
6162

6263
Similar to AssignEndpoint, but takes an additional EID argument:
6364

6465
```
65-
AssignEndpointStatic <interface name> <hwaddr> <static-EID>
66+
AssignEndpointStatic <hwaddr> <static-EID>
6667
```
6768

6869
to assign `<static-EID>` to the endpoint with hardware address `hwaddr`.
@@ -71,7 +72,7 @@ This call will fail if the endpoint already has an EID, and that EID is
7172
different from `static-EID`, or if `static-EID` is already assigned to another
7273
endpoint.
7374

74-
### `.LearnEndpoint`: `say``yisb`
75+
### `.LearnEndpoint`: `ay``yisb`
7576

7677
Like SetupEndpoint but will not assign EIDs, will only query endpoints for a
7778
current EID. The `new` return value is set to `false` for an already known

0 commit comments

Comments
 (0)