veth: keep peers MTU values synchronized
Subsystems (2)
RFC PATCH 1/1 veth: keep peers MTU values synchronized
Keep peers MTU values synchronized. That prevent dropping packets while
forwarding as diffirent MTU values prevent skb moving from one peer's device to another (is_skb_forwardable returns false).
--- drivers/net/veth.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-)
drivers/net/veth.c +15 -1
@@ -227,10 +227,24 @@ static int is_valid_veth_mtu(int new_mtu)static int veth_change_mtu (struct net_device *dev,int new_mtu) { +int err, old_mtu; +struct veth_priv *priv =netdev_priv (dev); +struct net_device *peer =rtnl_dereference (priv->peer); + +if (!peer) +return -ENOTCONN ; +if (!is_valid_veth_mtu (new_mtu))return -EINVAL ; + + old_mtu = dev->mtu; dev->mtu = new_mtu; -return 0 ; + + err =dev_set_mtu (peer, new_mtu); +if (err) + dev->mtu = old_mtu; + +return err; }static int veth_dev_init (struct net_device *dev)
Signature · 1 line
1.8.1.2
David Miller
maintainerFrom: "Ilya V. Matveychikov" <[email protected]>
Date: Fri, 04 Apr 2014 01:33:04 +0400
Quoted 6 lines
Keep peers MTU values synchronized. That prevent dropping packets while
forwarding as diffirent MTU values prevent skb moving from one peer's device to another (is_skb_forwardablereturns false).Signed-off-by Ilya V. Matveychikov <[email protected]>
Such side effects on another device when changing the configuration of one are strongly discouraged.
Furthermore, when the veth peer is created, no attempt is made to synchronize the MTUs.
Let it therefore be the admins responsibility to keep them in sync just as it would be on a real network.
Quoted 8 lines · David Miller
From: "Ilya V. Matveychikov" <[email protected]>
Date: Fri, 04 Apr 2014 01:33:04 +0400Quoted 5 lines
Keep peers MTU values synchronized. That prevent dropping packets while
forwarding as diffirent MTU values prevent skb moving from one peer's device to another (is_skb_forwardablereturns false).
Quoted 5 lines
Quoted 1 line
Signed-off-by Ilya V. Matveychikov <[email protected]>Such side effects on another device when changing the configuration of one are strongly discouraged.
Devices are paired. It means that one depends on another. Is there any case where this "side" effect wouldn't be helpful?
Quoted 2 lines
Furthermore, when the veth peer is created, no attempt is made to synchronize the MTUs.
Peers are created at once and ether_setup used for the configuration so MTU values equals.
Quoted 5 lines
Let it therefore be the admins responsibility to keep them in sync just as it would be on a real network.
Different MTU values for the veth pairs are meaningless as if so we can't do the communication between the namespaces at all. So, is it correct to shift all the configuration problems to admins?
David Miller
maintainerFrom: "Ilya V. Matveychikov" <[email protected]>
Date: Fri, 4 Apr 2014 18:42:29 +0400
Quoted 2 lines
Peers are created at once and
ether_setupused for the configuration so MTU values equals.
If an IFLA_MTU value is specified for the peer it will be honored.
Quoted 9 lines · David Miller
From: "Ilya V. Matveychikov" <[email protected]>
Date: Fri, 4 Apr 2014 18:42:29 +0400Quoted 2 lines
Peers are created at once and
ether_setupused for the configuration so MTU values equals.If an
IFLA_MTUvalue is specified for the peer it will be honored.
OK, I see it. Does that mean that the patch needs to be updated or the proposed behavior is incorrect and must not be in kernel?