Skip to content

mctpd: accept set endpoint ID as endpoint #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

khangng-ampere
Copy link
Contributor

@khangng-ampere khangng-ampere commented Jul 23, 2025

This change takes a little long for me to push out, mainly because I am not sure how the specification interacts with our MCTP in-kernel infrastructure, where a single EID address can be assigned on multiple interfaces.

I think I mostly know how this maps to the spec now. The spec suggests:

  • TMBO has a fixed static EID.
  • Bridges has three options: (refer to 9.1.3)
    • Single EID for all interfaces
    • Separate EIDs for every interface connected to upstream Bus Owner.
    • Separate EIDs for every interface.
  • Endpoint has separate EIDs for every interface it connected to. (refer to 8.18)
  • UUID can be used to correlate multiple EIDs belonging to a physical entity.

This PR address the endpoint case, where it will accept the EID from every interfaces it is connected to.

Also, this PR also fixes the response for Bus Owner. Instead of rejecting with 0b01 EID assignment rejected, this PR rejects with MCTP_CTRL_CC_ERROR_UNSUPPORTED_CMD. Rejecting EID assignment is reserved for the case where a bridge is rejecting subsequent EID assignments from other bus owners it is connected to.

01b = EID assignment rejected. EID has already been assigned by
another bus owner
and assignment was not forced.

@khangng-ampere khangng-ampere force-pushed the khangng/push-rquoknsoxuun branch 2 times, most recently from 521f10c to e6c85c3 Compare July 28, 2025 06:01
Copy link
Member

@jk-ozlabs jk-ozlabs left a comment

Choose a reason for hiding this comment

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

mostly looks good! just a few comments / queries inline.

Preparing the values and letting the caller OR multiple fields together
should be preferred over assigning to their arguments.

Signed-off-by: Khang D Nguyen <[email protected]>
@khangng-ampere khangng-ampere force-pushed the khangng/push-rquoknsoxuun branch from e6c85c3 to 45707fa Compare August 11, 2025 03:17
Copy link
Member

@jk-ozlabs jk-ozlabs left a comment

Choose a reason for hiding this comment

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

Looks good, thanks!

Currently, mctpd handles Set EID message as a bus owner, which
means it assumes it has at least one local EID and rejects all
Set Endpoint ID requests.

This commit handles the case where mctpd runs on an endpoint
and it has no EID set yet.

Signed-off-by: Khang D Nguyen <[email protected]>
@khangng-ampere khangng-ampere force-pushed the khangng/push-rquoknsoxuun branch from 45707fa to 8b906b4 Compare August 11, 2025 04:25
@khangng-ampere
Copy link
Contributor Author

Sorry for the update, just missing one more sizeof(struct mctp_ctrl_rep) here

@jk-ozlabs jk-ozlabs merged commit 8b906b4 into CodeConstruct:main Aug 11, 2025
3 checks passed
@khangng-ampere khangng-ampere deleted the khangng/push-rquoknsoxuun branch August 11, 2025 05:59
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.

3 participants