netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tobias Waldekranz <tobias@waldekranz.com>
To: davem@davemloft.net, kuba@kernel.org
Cc: andrew@lunn.ch, vivien.didelot@gmail.com, f.fainelli@gmail.com,
	olteanv@gmail.com, j.vosburgh@gmail.com, vfalico@gmail.com,
	andy@greyhouse.net, netdev@vger.kernel.org
Subject: [PATCH v5 net-next 2/5] net: dsa: Don't offload port attributes on standalone ports
Date: Wed, 13 Jan 2021 09:42:52 +0100	[thread overview]
Message-ID: <20210113084255.22675-3-tobias@waldekranz.com> (raw)
In-Reply-To: <20210113084255.22675-1-tobias@waldekranz.com>

In a situation where a standalone port is indirectly attached to a
bridge (e.g. via a LAG) which is not offloaded, do not offload any
port attributes either. The port should behave as a standard NIC.

Previously, on mv88e6xxx, this meant that in the following setup:

     br0
     /
  team0
   / \
swp0 swp1

If vlan filtering was enabled on br0, swp0's and swp1's QMode was set
to "secure". This caused all untagged packets to be dropped, as their
default VID (0) was not loaded into the VTU.

Signed-off-by: Tobias Waldekranz <tobias@waldekranz.com>
---
 net/dsa/slave.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 5a1769602e65..e53c8ca6eb66 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -273,6 +273,9 @@ static int dsa_slave_port_attr_set(struct net_device *dev,
 	struct dsa_port *dp = dsa_slave_to_port(dev);
 	int ret;
 
+	if (attr->orig_dev != dev)
+		return -EOPNOTSUPP;
+
 	switch (attr->id) {
 	case SWITCHDEV_ATTR_ID_PORT_STP_STATE:
 		ret = dsa_port_set_state(dp, attr->u.stp_state);
-- 
2.17.1


  parent reply	other threads:[~2021-01-13  8:44 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13  8:42 [PATCH v5 net-next 0/5] net: dsa: Link aggregation support Tobias Waldekranz
2021-01-13  8:42 ` [PATCH v5 net-next 1/5] net: bonding: Notify ports about their initial state Tobias Waldekranz
2021-01-13  8:42 ` Tobias Waldekranz [this message]
2021-01-14  0:36   ` [PATCH v5 net-next 2/5] net: dsa: Don't offload port attributes on standalone ports Vladimir Oltean
2021-01-13  8:42 ` [PATCH v5 net-next 3/5] net: dsa: Link aggregation support Tobias Waldekranz
2021-01-13  8:42 ` [PATCH v5 net-next 4/5] net: dsa: mv88e6xxx: " Tobias Waldekranz
2021-01-14  0:50   ` Vladimir Oltean
2021-01-14  8:05     ` Tobias Waldekranz
2021-01-13  8:42 ` [PATCH v5 net-next 5/5] net: dsa: tag_dsa: Support reception of packets from LAG devices Tobias Waldekranz
2021-01-15  1:30 ` [PATCH v5 net-next 0/5] net: dsa: Link aggregation support patchwork-bot+netdevbpf

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=20210113084255.22675-3-tobias@waldekranz.com \
    --to=tobias@waldekranz.com \
    --cc=andrew@lunn.ch \
    --cc=andy@greyhouse.net \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=j.vosburgh@gmail.com \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@gmail.com \
    --cc=vfalico@gmail.com \
    --cc=vivien.didelot@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).