Skip to content

net: mctp: add MCTP_OPT_ROUTE_SRCADDR getsockopt - #14

Open
faizana-nvidia wants to merge 1 commit into
CodeConstruct:dev/mctp-nextfrom
faizana-nvidia:faizana/mctp-route-srcaddr-getsockopt
Open

net: mctp: add MCTP_OPT_ROUTE_SRCADDR getsockopt#14
faizana-nvidia wants to merge 1 commit into
CodeConstruct:dev/mctp-nextfrom
faizana-nvidia:faizana/mctp-route-srcaddr-getsockopt

Conversation

@faizana-nvidia

@faizana-nvidia faizana-nvidia commented Aug 31, 2026

Copy link
Copy Markdown

This PR addresses requirements discussed in the issue CodeConstruct/mctp#147 and aims to

Add a new socket option MCTP_OPT_ROUTE_SRCADDR that allows applications to query which local EID the kernel would use as the source address when sending to a given destination EID.

Applications such as PLDM need to advertise a local EID as the event receiver address to remote endpoints.

Add a new socket option MCTP_OPT_ROUTE_SRCADDR that allows applications
to query which local EID the kernel would use as the source address
when sending to a given destination EID.

Applications such as PLDM need to advertise a local EID as the event
receiver address to remote endpoints. Previously this required a manual
multi-step lookup via the mctp tool (route show + addr show).
The kernel routing table is the authoritative
source for this mapping, so expose it directly via a socket option.

The caller fills in net and daddr in struct mctp_route_srcaddr before
calling getsockopt(SOL_MCTP, MCTP_OPT_ROUTE_SRCADDR); the kernel
performs the same route lookup used for actual packet output and
returns the resolved local EID in saddr.

Signed-off-by: Faizan Ali <faizana@nvidia.com>
@faizana-nvidia

Copy link
Copy Markdown
Author

Was not sure which branch this PR needs to be targeted for, please let me know the right one.

@jk-ozlabs

Copy link
Copy Markdown
Member

Patches for the kernel go to the kernel lists, we're not operating an upstream in this repo - it's mainly for our own development topics.

However, I'm not convinced this new sockopt is the right way to go. Remember that any userspace-ABI-visible changes need to be supported permanently, so we need a solid rationale and design for this.

So, my main question: how is this any better than picking an arbitrary locally-assigned EID?

Also, I don't see how this relates to #8.

@faizana-nvidia

Copy link
Copy Markdown
Author

Patches for the kernel go to the kernel lists, we're not operating an upstream in this repo - it's mainly for our own development topics.

However, I'm not convinced this new sockopt is the right way to go. Remember that any userspace-ABI-visible changes need to be supported permanently, so we need a solid rationale and design for this.

So, my main question: how is this any better than picking an arbitrary locally-assigned EID?

Also, I don't see how this relates to #8.

I may have linked a different issue, this is the right one, CodeConstruct/mctp#147

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