diff options
author | Paolo Abeni <pabeni@redhat.com> | 2016-07-14 18:00:10 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-16 20:15:02 -0700 |
commit | 18d3df3eab23796d7f852f9c6bb60962b8372ced (patch) | |
tree | 4871d69274a682be6379696208efafc622d3234d /include/linux/netdevice.h | |
parent | e86663c475d384ab5f46cb5637e9b7ad08c5c505 (diff) | |
download | linux-stable-18d3df3eab23796d7f852f9c6bb60962b8372ced.tar.gz linux-stable-18d3df3eab23796d7f852f9c6bb60962b8372ced.tar.bz2 linux-stable-18d3df3eab23796d7f852f9c6bb60962b8372ced.zip |
vlan: use a valid default mtu value for vlan over macsec
macsec can't cope with mtu frames which need vlan tag insertion, and
vlan device set the default mtu equal to the underlying dev's one.
By default vlan over macsec devices use invalid mtu, dropping
all the large packets.
This patch adds a netif helper to check if an upper vlan device
needs mtu reduction. The helper is used during vlan devices
initialization to set a valid default and during mtu updating to
forbid invalid, too bit, mtu values.
The helper currently only check if the lower dev is a macsec device,
if we get more users, we need to update only the helper (possibly
reserving an additional IFF bit).
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f45929ce8157..da4b33bea982 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4145,6 +4145,13 @@ static inline void netif_keep_dst(struct net_device *dev) dev->priv_flags &= ~(IFF_XMIT_DST_RELEASE | IFF_XMIT_DST_RELEASE_PERM); } +/* return true if dev can't cope with mtu frames that need vlan tag insertion */ +static inline bool netif_reduces_vlan_mtu(struct net_device *dev) +{ + /* TODO: reserve and use an additional IFF bit, if we get more users */ + return dev->priv_flags & IFF_MACSEC; +} + extern struct pernet_operations __net_initdata loopback_net_ops; /* Logging, debugging and troubleshooting/diagnostic helpers. */ |