public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Tobias Waldekranz <tobias@waldekranz•com>
To: Vladimir Oltean <olteanv@gmail•com>
Cc: davem@davemloft•net, kuba@kernel•org, andrew@lunn•ch,
	vivien.didelot@gmail•com, f.fainelli@gmail•com,
	j.vosburgh@gmail•com, vfalico@gmail•com, andy@greyhouse•net,
	netdev@vger•kernel.org
Subject: Re: [PATCH v4 net-next 2/5] net: dsa: Don't offload port attributes on standalone ports
Date: Wed, 16 Dec 2020 20:32:51 +0100	[thread overview]
Message-ID: <87v9d1bl7g.fsf@waldekranz.com> (raw)
In-Reply-To: <20201216162711.3nhq3lktadyzksoh@skbuf>

On Wed, Dec 16, 2020 at 18:27, Vladimir Oltean <olteanv@gmail•com> wrote:
> On Wed, Dec 16, 2020 at 05:00:53PM +0100, Tobias Waldekranz wrote:
>> 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 4a0498bf6c65..faae8dcc0849 100644
>> --- a/net/dsa/slave.c
>> +++ b/net/dsa/slave.c
>> @@ -274,6 +274,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;
>> +
>
> Should this not be:
>
> 	if (!dsa_port_offloads_netdev(dp, attr->orig_dev))
> 		return -EOPNOTSUPP;
>
> ?

That function is born in the following patch. So here I just align the
filtering with how switchdev objects were handled before this
series. Then in the next patch, all instances are converted to the exact
statement you suggest.

>>  	switch (attr->id) {
>>  	case SWITCHDEV_ATTR_ID_PORT_STP_STATE:
>>  		ret = dsa_port_set_state(dp, attr->u.stp_state, trans);
>> -- 
>> 2.17.1
>> 

  reply	other threads:[~2020-12-16 19:34 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16 16:00 [PATCH v4 net-next 0/5] net: dsa: Link aggregation support Tobias Waldekranz
2020-12-16 16:00 ` [PATCH v4 net-next 1/5] net: bonding: Notify ports about their initial state Tobias Waldekranz
2020-12-16 16:28   ` Vladimir Oltean
2020-12-16 16:00 ` [PATCH v4 net-next 2/5] net: dsa: Don't offload port attributes on standalone ports Tobias Waldekranz
2020-12-16 16:27   ` Vladimir Oltean
2020-12-16 19:32     ` Tobias Waldekranz [this message]
2020-12-16 16:00 ` [PATCH v4 net-next 3/5] net: dsa: Link aggregation support Tobias Waldekranz
2020-12-16 16:22   ` Vladimir Oltean
2020-12-16 19:47     ` Tobias Waldekranz
2020-12-16 18:02   ` Vladimir Oltean
2020-12-16 19:49     ` Tobias Waldekranz
2020-12-16 18:44   ` Vladimir Oltean
2020-12-16 20:09     ` Tobias Waldekranz
2020-12-17 18:31       ` Vladimir Oltean
2020-12-16 16:00 ` [PATCH v4 net-next 4/5] net: dsa: mv88e6xxx: " Tobias Waldekranz
2020-12-16 19:04   ` Vladimir Oltean
2020-12-16 20:21     ` Tobias Waldekranz
2020-12-16 16:00 ` [PATCH v4 net-next 5/5] net: dsa: tag_dsa: Support reception of packets from LAG devices Tobias Waldekranz
2020-12-16 19:14   ` Vladimir Oltean

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=87v9d1bl7g.fsf@waldekranz.com \
    --to=tobias@waldekranz$(echo .)com \
    --cc=andrew@lunn$(echo .)ch \
    --cc=andy@greyhouse$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=f.fainelli@gmail$(echo .)com \
    --cc=j.vosburgh@gmail$(echo .)com \
    --cc=kuba@kernel$(echo .)org \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=olteanv@gmail$(echo .)com \
    --cc=vfalico@gmail$(echo .)com \
    --cc=vivien.didelot@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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