Skip to content

Commit 67a7457

Browse files
authored
Merge pull request #504 from CodeConstruct/pr/mi-conf-mtu
examples/mi-conf: account for MCTP header in route MTU
2 parents be55e23 + f8f5184 commit 67a7457

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)