Thread (33 messages) flat view 33 messages, 7 authors, 2017-01-15

Re: [PATCH v5 05/13] net: ethernet: aquantia: Support for NIC-specific code

From: Rami Rosen <hidden>
Date: 2017-01-14 22:55:04

Hi, Florian,
+}
+
+static int aq_ndev_change_mtu(struct net_device *ndev, int new_mtu)
+{
+     struct aq_nic_s *aq_nic = (struct aq_nic_s *)netdev_priv(ndev);
+     int err = 0;
+
+     if (new_mtu == ndev->mtu) {
+             err = 0;
+             goto err_exit;
+     }
+     if (new_mtu < 68) {
+             err = -EINVAL;
+             goto err_exit;
+     }
What's so special about 68 here?
I think that the check that the passed MTU is at least 68 bytes is
justified and correct.
This convention is followed by a large number of Ethernet drivers; for example,
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/i40e/i40e_main.c#L2246
http://lxr.free-electrons.com/source/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c#L6049

The size of 68 bytes is originated from RFC 791:
https://tools.ietf.org/html/rfc791
...
Every internet module must be able to forward a datagram of 68 octets
without further fragmentation.
This is because an internet header may be up to 60 octets, and the
minimum fragment is 8 octets.
...

Regards,
Rami Rosen
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help