-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Description:
When the BMC is configured as an MCTP Endpoint and receives an Endpoint Discovery request (with a target EID of 0xFF) from the Bus Owner, the mctpd userspace daemon attempts to send a response using physical addressing.
Our analysis of the Linux kernel's MCTP protocol stack (net/mctp/) reveals a conflict that prevents this response from being routed:
-
EID Registration Restriction: The kernel's
mctp_address_unicast()function (used bymctp_rtm_newaddrfor EID registration via Netlink) does not permit0x00(MCTP_ADDR_NULL) or0xFF(MCTP_ADDR_ANY) EIDs to be registered as local addresses to anmctp_dev. This means that if themctp_devcorresponding to the BMC's interface has not yet been assigned a unicast EID (0x01-0xFE), itsaddrslist will be empty, andnum_addrswill be0. -
Blocking Outbound Traffic: The
mctp_local_output()function (inroute.c), which is responsible for processing all outbound MCTP packets, includes a critical check:if (rt->dev->num_addrs == 0) { rc = -EHOSTUNREACH; } else { saddr = rt->dev->addrs[0]; rc = 0; } if (rc) goto out_release;
If
rt->dev->num_addrsis0(as described in point 1),rcis set to-EHOSTUNREACH, and the function immediately exits, preventing the packet from being sent. -
mctpd's Intent: Themctpddaemon (specificallyhandle_control_endpoint_discoveryandendpoint_query_phys) intends to send a response.endpoint_query_physeven contains a comment: "The kernel mctp stack has special handling for eid=0 to make sure we can recv a response on the socket, so it's important to set eid=0 here in the request." This suggests an expectation of kernel support for0x00EID handling, possibly for source EIDs in discovery responses. However, our analysis indicates this handling is not present for outbound traffic when no valid EIDs are registered.
Consequence:
As a result, if a BMC (acting as an Endpoint) has no assigned EID, it cannot send an Endpoint Discovery response with a 0x00 source EID (or any source EID) back to the Bus Owner, because the kernel stack blocks the transmission. This hinders the successful completion of the Endpoint Discovery process from the Endpoint's perspective.
Proposed Question for CodeConstruct:
What is the recommended solution or workflow for a BMC in an Endpoint role to successfully respond to Endpoint Discovery requests when its mctp_dev has no assigned EID, given the current Linux kernel MCTP stack's behavior? Are there specific configurations, a sequence of Netlink commands, or a userspace workaround to enable this scenario?