mctpd: keep UUID on static-EID re-enrollment - #167
Conversation
|
Hi Ryan, Thanks for the PR!
That sounds like the underlying issue though, perhaps we should address that instead, More out of completeness, could you let me know what behaviour you're seeing with the Set Endpoint ID response, and the response data from the prior Get Endpoint ID, and the behaviour you're expecting from mctpd? (The UUID property should definitely be addressed, but I am more checking that we have the EID handling correct for this case) |
|
Hi Jeremy, thanks for the review! Raw behaviour captured on hardware -- the endpoint is an Intel E810
So despite advertising a dynamic EID, the device rejects reassignment On the design point: agreed, dropping the publish from
I've reworked the branch that way and amended the commit accordingly. |
7bcc011 to
632f491
Compare
|
|
||
|
|
||
| async def test_assign_endpoint_vary_set_eid_uuid(dbus, mctpd): | ||
| """An endpoint that reports its own (static) EID in the Set Endpoint ID |
There was a problem hiding this comment.
By 'static' do you mean in the spec-sense, or the linux-stack sense?
In the case of the former, I'm wondering whether this is reasonable behaviour. DSP0236 v1.3.3 § 8.18.3 has the statement on 1097-1098:
Endpoints that support the option of being configured for one or more static EIDs shall also
support being configured to be dynamically assigned EIDs.
If we're sending a dynamic configuration, should it not accept that for conformance?
There was a problem hiding this comment.
Neither spec-static nor linux-stack static. The device (Intel E810 SMBus sideband) advertises dynamic-EID support in Get Endpoint ID, yet answers Set Endpoint ID with status "rejected" and keeps its current EID -- so agreed, per DSP0236 v1.3.3 § 8.18.3 that looks non-conformant on the device's part.
The PR doesn't try to bless that behaviour: mctpd already tolerates a device reporting a different EID than assigned (per the existing test_setup_endpoint_vary_set_eid_response), and the fix is only about keeping the D-Bus object intact on that tolerated path. I've reworded the test docstring to say "holds its current EID" instead of "static" to avoid implying the spec term.
An endpoint that answers Set Endpoint ID with a different EID (the one it already holds) takes the assign-mismatch path, where change_peer_eid() published the D-Bus object before query_peer_properties() had run. publish_peer() registers the Common.UUID vtable only when peer->uuid is already known and is a no-op once published, so such endpoints never exposed their UUID even though the Get Endpoint UUID query succeeded. Make publishing the caller's responsibility: change_peer_eid() now only unpublishes (the object path moves with the EID). The assign paths and get_endpoint_peer() are already followed by setup_added_peer(), which publishes after the property queries; the endpoint recovery path gains an explicit publish, its properties having been queried at first setup. Add a regression test enrolling an endpoint that holds its current EID via AssignEndpoint and asserting the UUID interface is present. Signed-off-by: Ryan CJ Huang <ryan_huang@jabil.com>
632f491 to
0a9d6db
Compare
An endpoint that answers Set Endpoint ID with a different (its own
static) EID takes the assign-mismatch path, where change_peer_eid()
publishes the D-Bus object before query_peer_properties() has run.
publish_peer() registers the Common.UUID vtable only when peer->uuid
is already known, and is a no-op once the peer is published, so such
endpoints never expose their UUID on D-Bus even though the Get
Endpoint UUID query succeeds.
Observed on real hardware: an SMBus endpoint holding a static EID
enrolled via AssignEndpoint had no xyz.openbmc_project.Common.UUID
interface, while the same device enrolled via AssignEndpointStatic
(no EID mismatch) exposed it. The missing UUID prevents consumers
from correlating a dual-medium device across its endpoints.
Fix: publish from change_peer_eid() only when the peer was already
published (an EID change moves the object path); leave the first
publish to setup_added_peer(), which runs after the property queries.
Tests: added a regression test enrolling a static-EID endpoint via
AssignEndpoint and asserting the UUID interface is present. It fails
without the src change and passes with it; full test_mctpd.py suite
passes (79 tests).