Skip to content

mctpd: Support MCTP Discovery Notify command - #165

Open
chajasmine-bit wants to merge 1 commit into
CodeConstruct:mainfrom
chajasmine-bit:discovery-notify
Open

mctpd: Support MCTP Discovery Notify command#165
chajasmine-bit wants to merge 1 commit into
CodeConstruct:mainfrom
chajasmine-bit:discovery-notify

Conversation

@chajasmine-bit

Copy link
Copy Markdown

Implement support for the MCTP Discovery Notify control command in mctpd. When an MCTP endpoint issues a Discovery Notify control request to the Bus Owner, mctpd immediately acknowledges the request over the physical socket and defers EID assignment to the main systemd event loop.

This avoids blocking the event thread during control message processing and safely handles EID re-assignments via change_peer_eid(), keeping D-Bus object paths and netlink kernel routing tables synchronized. Also include unit test coverage for Discovery Notify in the test suite.

Assisted-by: Antigravity:Gemini-Next

@chajasmine-bit
chajasmine-bit force-pushed the discovery-notify branch 5 times, most recently from 9274ea2 to f6fbc3b Compare August 4, 2026 03:50
@jk-ozlabs

Copy link
Copy Markdown
Member

I see there's been a few updates; let me know when this is stable and you'd like a review.

@chajasmine-bit

Copy link
Copy Markdown
Author

I see there's been a few updates; let me know when this is stable and you'd like a review.

The code is ready for review, please take a look at this. Thanks.

@jk-ozlabs jk-ozlabs left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution. I have a few comments.

On the commit message: it reads like a marketing pitch rather than an explanation of the design, or rationale for the implementation. While you don't need to describe the individual changes, I would appreciate some background on the approach, and non-obvious parts of the implementation (like, why the new NLM_F flags?)

In MCTP networks, endpoints broadcast or send a Discovery Notify control
request (0x0D) to inform the Bus Owner when they boot up, reset, or are
hot-plugged. Currently, mctpd relies on active bus scanning or static
configurations,

or primarily: hot-plug events, where the transport provides them

leaving newly online endpoints undiscovered until the next poll cycle.

What poll cycle?

Comment thread src/mctp-netlink.c Outdated
Comment thread src/mctpd.c Outdated
Comment thread src/mctpd.c
Comment thread src/mctpd.c
Comment thread src/mctpd.c Outdated
Comment thread src/mctpd.c Outdated
Comment thread src/mctpd.c Outdated
Comment thread src/mctpd.c Outdated
Comment thread src/mctpd.c Outdated
Comment thread tests/test_mctpd.py Outdated
@chajasmine-bit
chajasmine-bit force-pushed the discovery-notify branch 2 times, most recently from 193bacb to b554b2f Compare August 11, 2026 13:47
- Defer EID assignment/discovery to event loop to keep D-Bus
  unblocked (ack immediately).
- Tear down existing peer state to allow clean re-enumeration on
  re-registration.
- Add per-link 32-entry LRU rate limiter (5 req/sec per physical
  address) to prevent memory exhaustion attacks.
- Add unit tests validating Discovery Notify workflows.

Assisted-by: Antigravity:Gemini-Next
Signed-off-by: Jasmine Cha <chajasmine@google.com>
@chajasmine-bit

Copy link
Copy Markdown
Author

Hi Jeremy, thanks for catching the issues from the previous code and I've learned a lot from your feedback. I’ve made the updates, so please take a look when you have a chance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants