History

net: mctp: add gateway routing support

This change allows for gateway routing, where a route table entry may reference a routable endpoint (by network and EID), instead of routing directly to a netdevice. We add support for a RTM_GATEWAY attribute for netlink route updates, with an attribute format of: struct mctp_fq_addr { unsigned int net; mctp_eid_t eid; } - we need the net here to uniquely identify the target EID, as we no longer have the device reference directly (which would provide the net id in the case of direct routes). This makes route lookups recursive, as a route lookup that returns a gateway route must be resolved into a direct route (ie, to a device) eventually. We provide a limit to the route lookups, to prevent infinite loop routing. The route lookup populates a new 'nexthop' field in the dst structure, which now specifies the key for the neighbour table lookup on device output, rather than using the packet destination address directly.

Jeremy Kerr committed 1 year ago

Commit ad39c121 parent 28ddbb24 files · +173 −57Browse files

Showing the changes to include/uapi (1 of 4 files). Show all

Unified · Split

include/uapi/linux/mctp.h+8−0
@@ -37,6 +37,14 @@ struct sockaddr_mctp_ext { · 36 unmodified lines
3737 __u8 smctp_haddr[MAX_ADDR_LEN];
3838 };
3939
40+/* A "fully qualified" MCTP address, which includes the system-local network ID,
41+ * required to uniquely resolve a routable EID.
42+ */
43+struct mctp_fq_addr {
44+ unsigned int net;
45+ mctp_eid_t eid;
46+};
47+
4048 #define MCTP_NET_ANY 0x0
4149
4250 #define MCTP_ADDR_NULL 0x00