From: Edwin Peer <edwin.peer@broadcom.com>
To: netdev@vger.kernel.org
Cc: Edwin Peer <edwin.peer@broadcom.com>,
edumazet@google.com, linville@tuxdriver.com,
shemminger@vyatta.com, mirq-linux@rere.qmqm.pl,
jesse.brandeburg@intel.com, jchapman@katalix.com,
david@weave.works, j.vosburgh@gmail.com, vfalico@gmail.com,
andy@greyhouse.net, sridhar.samudrala@intel.com,
jiri@mellanox.com, geoff@infradead.org, mokuno@sm.sony.co.jp,
msink@permonline.ru, mporter@kernel.crashing.org,
inaky.perez-gonzalez@intel.com, jwi@linux.ibm.com,
kgraul@linux.ibm.com, ubraun@linux.ibm.com,
grant.likely@secretlab.ca, hadi@cyberus.ca, dsahern@kernel.org,
shrijeet@gmail.com, jon.mason@intel.com, dave.jiang@intel.com,
saeedm@mellanox.com, hadarh@mellanox.com, ogerlitz@mellanox.com,
allenbh@gmail.com, michael.chan@broadcom.com
Subject: [RFC PATCH net-next 08/11] net: distribute IFF_NO_VLAN_ROOM into aggregate devs
Date: Wed, 27 May 2020 14:25:09 -0700 [thread overview]
Message-ID: <20200527212512.17901-9-edwin.peer@broadcom.com> (raw)
In-Reply-To: <20200527212512.17901-1-edwin.peer@broadcom.com>
VLANs layered above aggregate devices such as bonds and teams should
inherit the MTU limitations of the devices underlying the aggregate.
If any one of the slave devices is constrained by IFF_NO_VLAN_ROOM,
then so must the aggregate as a whole.
Signed-off-by: Edwin Peer <edwin.peer@broadcom.com>
---
drivers/net/bonding/bond_main.c | 3 +++
drivers/net/net_failover.c | 12 ++++++++++++
drivers/net/team/team.c | 5 +++++
3 files changed, 20 insertions(+)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 4c45f1692934..3002ba879d14 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1147,6 +1147,7 @@ static void bond_compute_features(struct bonding *bond)
vlan_features &= NETIF_F_ALL_FOR_ALL;
mpls_features &= NETIF_F_ALL_FOR_ALL;
bond_dev->priv_flags |= IFF_XMIT_DST_RELEASE;
+ bond_dev->priv_flags &= ~IFF_NO_VLAN_ROOM;
bond_for_each_slave(bond, slave, iter) {
vlan_features = netdev_increment_features(vlan_features,
@@ -1162,6 +1163,8 @@ static void bond_compute_features(struct bonding *bond)
bond_dev->priv_flags &= slave->dev->priv_flags |
~IFF_XMIT_DST_RELEASE;
+ bond_dev->priv_flags |= slave->dev->priv_flags &
+ IFF_NO_VLAN_ROOM;
if (slave->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = slave->dev->hard_header_len;
diff --git a/drivers/net/net_failover.c b/drivers/net/net_failover.c
index 436945e0a4c1..a085d292b4cf 100644
--- a/drivers/net/net_failover.c
+++ b/drivers/net/net_failover.c
@@ -211,6 +211,16 @@ static void net_failover_get_stats(struct net_device *dev,
spin_unlock(&nfo_info->stats_lock);
}
+static void net_failover_constrain_vlan(struct net_device *dev,
+ struct net_device *primary,
+ struct net_device *standby)
+{
+ dev->priv_flags &= ~IFF_NO_VLAN_ROOM;
+ dev->priv_flags |= IFF_NO_VLAN_ROOM &
+ ((primary ? primary->priv_flags : 0) |
+ (standby ? standby->priv_flags : 0));
+}
+
static int net_failover_change_mtu(struct net_device *dev, int new_mtu)
{
struct net_failover_info *nfo_info = netdev_priv(dev);
@@ -235,6 +245,7 @@ static int net_failover_change_mtu(struct net_device *dev, int new_mtu)
}
dev->mtu = new_mtu;
+ net_failover_constrain_vlan(dev, primary_dev, standby_dev);
return 0;
}
@@ -427,6 +438,7 @@ static void net_failover_compute_features(struct net_device *dev)
dev->hw_enc_features = enc_features | NETIF_F_GSO_ENCAP_ALL;
dev->hard_header_len = max_hard_header_len;
+ net_failover_constrain_vlan(dev, primary_dev, standby_dev);
netdev_change_features(dev);
}
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 5987fc2db031..3e18d1de036d 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -990,6 +990,7 @@ static void __team_compute_features(struct team *team)
unsigned short max_hard_header_len = ETH_HLEN;
team->dev->priv_flags |= IFF_XMIT_DST_RELEASE;
+ team->dev->priv_flags &= ~IFF_NO_VLAN_ROOM;
list_for_each_entry(port, &team->port_list, list) {
vlan_features = netdev_increment_features(vlan_features,
@@ -1002,6 +1003,8 @@ static void __team_compute_features(struct team *team)
team->dev->priv_flags &= port->dev->priv_flags |
~IFF_XMIT_DST_RELEASE;
+ team->dev->priv_flags |= port->dev->priv_flags &
+ IFF_NO_VLAN_ROOM;
if (port->dev->hard_header_len > max_hard_header_len)
max_hard_header_len = port->dev->hard_header_len;
@@ -1808,6 +1811,7 @@ static int team_change_mtu(struct net_device *dev, int new_mtu)
*/
mutex_lock(&team->lock);
team->port_mtu_change_allowed = true;
+ dev->priv_flags &= ~IFF_NO_VLAN_ROOM;
list_for_each_entry(port, &team->port_list, list) {
err = dev_set_mtu(port->dev, new_mtu);
if (err) {
@@ -1815,6 +1819,7 @@ static int team_change_mtu(struct net_device *dev, int new_mtu)
port->dev->name);
goto unwind;
}
+ dev->priv_flags |= port->dev->priv_flags & IFF_NO_VLAN_ROOM;
}
team->port_mtu_change_allowed = false;
mutex_unlock(&team->lock);
--
2.26.2
next prev parent reply other threads:[~2020-05-27 21:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-27 21:25 [RFC PATCH net-next 00/11] Nested VLANs - decimate flags and add another Edwin Peer
2020-05-27 21:25 ` [RFC PATCH net-next 01/11] net: geneve: enable vlan offloads Edwin Peer
2020-05-27 21:25 ` [RFC PATCH net-next 02/11] net: do away with the IFF_XMIT_DST_RELEASE_PERM flag Edwin Peer
2020-05-27 21:25 ` [RFC PATCH net-next 03/11] net: vlan: add IFF_NO_VLAN_ROOM to constrain MTU Edwin Peer
2020-05-27 21:25 ` [RFC PATCH net-next 04/11] net: geneve: constrain upper VLAN MTU using IFF_NO_VLAN_ROOM Edwin Peer
2020-05-27 21:25 ` [RFC PATCH net-next 05/11] net: vxlan: " Edwin Peer
2020-05-27 21:25 ` [RFC PATCH net-next 06/11] net: l2tp_eth: " Edwin Peer
2020-05-27 21:25 ` [RFC PATCH net-next 07/11] net: gre: " Edwin Peer
2020-05-27 21:25 ` Edwin Peer [this message]
2020-05-27 21:25 ` [RFC PATCH net-next 09/11] net: ntb_netdev: support VLAN " Edwin Peer
2020-05-27 21:25 ` [RFC PATCH net-next 10/11] net: vlan: disallow non-Ethernet devices Edwin Peer
2020-05-27 21:25 ` [RFC PATCH net-next 11/11] net: leverage IFF_NO_VLAN_ROOM to limit NETIF_F_VLAN_CHALLENGED Edwin Peer
2020-05-28 0:15 ` [RFC PATCH net-next 00/11] Nested VLANs - decimate flags and add another Michał Mirosław
2020-05-28 0:39 ` Edwin Peer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200527212512.17901-9-edwin.peer@broadcom.com \
--to=edwin.peer@broadcom.com \
--cc=allenbh@gmail.com \
--cc=andy@greyhouse.net \
--cc=dave.jiang@intel.com \
--cc=david@weave.works \
--cc=dsahern@kernel.org \
--cc=edumazet@google.com \
--cc=geoff@infradead.org \
--cc=grant.likely@secretlab.ca \
--cc=hadarh@mellanox.com \
--cc=hadi@cyberus.ca \
--cc=inaky.perez-gonzalez@intel.com \
--cc=j.vosburgh@gmail.com \
--cc=jchapman@katalix.com \
--cc=jesse.brandeburg@intel.com \
--cc=jiri@mellanox.com \
--cc=jon.mason@intel.com \
--cc=jwi@linux.ibm.com \
--cc=kgraul@linux.ibm.com \
--cc=linville@tuxdriver.com \
--cc=michael.chan@broadcom.com \
--cc=mirq-linux@rere.qmqm.pl \
--cc=mokuno@sm.sony.co.jp \
--cc=mporter@kernel.crashing.org \
--cc=msink@permonline.ru \
--cc=netdev@vger.kernel.org \
--cc=ogerlitz@mellanox.com \
--cc=saeedm@mellanox.com \
--cc=shemminger@vyatta.com \
--cc=shrijeet@gmail.com \
--cc=sridhar.samudrala@intel.com \
--cc=ubraun@linux.ibm.com \
--cc=vfalico@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).