Re: [PATCH net-next] net: mctp: add MCTP_OPT_ROUTE_SRCADDR getsockopt

From: Faizan Ali

Date: Wed Sep 23 2026 - 04:34:06 EST


Hello Jeremy,

Sorry, I missed following up on this earlier - continuing our
conversation from the earlier thread.

> As I had asked earlier, can you elaborate on why this is needed over
> choosing any local address? Is there a routing topology where this
> would not work?
>
> I'm not against the idea, we just need a fairly solidy justification
> for adding user ABI that cannot be changed in future.

In theory, yes - any incoming message destined to an active local EID
should reach an application bound to that message type. That said, I
still find these problems with simply picking any local EID:

1. It requires a snapshot of all available local EIDs first -
information the kernel already has internally via the routing
table, but which applications can today only get via ad-hoc mctp
route/addr correlation.

2. Not every local EID is reachable from every peer, even on the same
network. Example from our hardware:

BMC --USB(EID 8)--> SMA(EID 20) --I3C--> GPU(EID 30)
BMC also has a separate mctpi2c0 (EID 9), unrelated to the SMA.

Reaching the GPU is a gateway route (30 -> via 20 -> via 8), which
mctp_route_lookup() already resolves correctly today for
sendmsg(). If PLDM instead picks "any" EID and gets 9, the GPU's
event notifications go out via I3C to the SMA - which has no
knowledge of EID 9 at all (it's on an unrelated bus). The packet is
undeliverable at the SMA itself, one hop before it would even reach
the BMC.

I acknowledge this is implementation-specific, and additional
route provisioning on the bridge could help - but that still
requires out-of-band configuration to stay in sync with every
local EID. Separately, how device firmware handles Set Event
Receiver packets carrying an EID different from the one it saw
during Set Endpoint ID discovery is also implementation-defined.

3. A picked EID doesn't stay valid - interface teardown (hot unplug)
removes its local EID from the available routes, and Set Event
Receiver is a one-shot registration with no way to detect that
drift later. Further events would then be silently dropped by the
kernel, since it has no route for the removed EID, and would never
reach the application.

The kernel already walks this resolution (including gateway chains)
correctly for every sendmsg() - this just exposes that same lookup,
rather than requiring applications to parse route/addr output and
re-derive it themselves.

Regards,
Faizan