Skip to content

Commit f8f5184

Browse files
committed
examples/mi-conf: account for MCTP header in route MTU
The NVMe specs don't include the MCTP header when referring to the MCTP MTUs; we need to do so when setting the Linux route MTU. This change uses the header-included value when setting the route MTU via mctpd over dbus. Signed-off-by: Jeremy Kerr <[email protected]>
1 parent b483bbd commit f8f5184

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

examples/mi-conf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ int set_local_mtu(sd_bus *bus, unsigned int net, uint8_t eid, uint32_t mtu)
9292
return -1;
9393
}
9494

95+
/* The NVMe-MI interfaces refer to their MTU as *not* including the
96+
* 4-byte MCTP header, whereas the MCTP specs *do* include it. When
97+
* we're setting the route MTU, we're using to the MCTP-style MTU,
98+
* which needs the extra four bytes included
99+
*/
100+
mtu += 4;
101+
95102
rc = sd_bus_call_method(bus, MCTP_DBUS_NAME, ep_path,
96103
MCTP_DBUS_EP_IFACE, "SetMTU", &err, &resp,
97104
"u", mtu);

0 commit comments

Comments
 (0)