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 v2 net-next 4/4] net: dsa: tag_dsa: Support reception of packets from LAG devices
Date: Tue, 01 Dec 2020 23:31:02 +0100	[thread overview]
Message-ID: <87sg8p6tw9.fsf@waldekranz.com> (raw)
In-Reply-To: <20201201212427.sewnqf7muxwisbcm@skbuf>

On Tue, Dec 01, 2020 at 23:24, Vladimir Oltean <olteanv@gmail•com> wrote:
> On Mon, Nov 30, 2020 at 03:06:10PM +0100, Tobias Waldekranz wrote:
>> Packets ingressing on a LAG that egress on the CPU port, which are not
>> classified as management, will have a FORWARD tag that does not
>> contain the normal source device/port tuple. Instead the trunk bit
>> will be set, and the port field holds the LAG id.
>> 
>> Since the exact source port information is not available in the tag,
>> frames are injected directly on the LAG interface and thus do never
>> pass through any DSA port interface on ingress.
>> 
>> Management frames (TO_CPU) are not affected and will pass through the
>> DSA port interface as usual.
>> 
>> Signed-off-by: Tobias Waldekranz <tobias@waldekranz•com>
>> ---
>>  net/dsa/dsa.c     | 12 +++++++++++-
>>  net/dsa/tag_dsa.c | 17 ++++++++++++++++-
>>  2 files changed, 27 insertions(+), 2 deletions(-)
>> 
>> diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
>> index a1b1dc8a4d87..7325bf4608e9 100644
>> --- a/net/dsa/dsa.c
>> +++ b/net/dsa/dsa.c
>> @@ -219,11 +219,21 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
>>  	}
>>  
>>  	skb = nskb;
>> -	p = netdev_priv(skb->dev);
>>  	skb_push(skb, ETH_HLEN);
>>  	skb->pkt_type = PACKET_HOST;
>>  	skb->protocol = eth_type_trans(skb, skb->dev);
>>  
>> +	if (unlikely(!dsa_slave_dev_check(skb->dev))) {
>> +		/* Packet is to be injected directly on an upper
>> +		 * device, e.g. a team/bond, so skip all DSA-port
>> +		 * specific actions.
>> +		 */
>> +		netif_rx(skb);
>> +		return 0;
>
> netif_rx returns an int code, it seems odd to ignore it.

This is exactly the same treatment that the return code from
gro_cells_receive gets just a few lines down. They return the same set
of codes (NET_RX_{SUCCESS,DROP}).

Looking through the source base, there are a few callers that look at
the return value (the overwhelming majority ignore it). Actions vary
from printing warnings (without rate-limit, yikes), setting variables
that are otherwise unused, or bumping a counter (the only reasonable
thing I have seen).

But looking through enqueue_to_backlog, it seems like there already is a
counter for this that is accessible from /proc/net/softnet_data.

>> +	}
>> +
>> +	p = netdev_priv(skb->dev);
>> +
>>  	if (unlikely(cpu_dp->ds->untag_bridge_pvid)) {
>>  		nskb = dsa_untag_bridge_pvid(skb);
>>  		if (!nskb) {

  reply	other threads:[~2020-12-01 22:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-30 14:06 [PATCH v2 net-next 0/4] net: dsa: Link aggregation support Tobias Waldekranz
2020-11-30 14:06 ` [PATCH v2 net-next 1/4] net: bonding: Notify ports about their initial state Tobias Waldekranz
2020-11-30 14:06 ` [PATCH v2 net-next 2/4] net: dsa: Link aggregation support Tobias Waldekranz
2020-12-01  1:37   ` Vladimir Oltean
2020-12-01  8:13     ` Tobias Waldekranz
2020-12-01 13:29       ` Vladimir Oltean
2020-12-01 14:22         ` Tobias Waldekranz
2020-12-01 14:03   ` Vladimir Oltean
2020-12-01 14:29     ` Tobias Waldekranz
2020-12-01 20:04       ` Vladimir Oltean
2020-12-01 21:48         ` Tobias Waldekranz
2020-12-01 22:23           ` Vladimir Oltean
2020-11-30 14:06 ` [PATCH v2 net-next 3/4] net: dsa: mv88e6xxx: " Tobias Waldekranz
2020-11-30 14:06 ` [PATCH v2 net-next 4/4] net: dsa: tag_dsa: Support reception of packets from LAG devices Tobias Waldekranz
2020-12-01 21:24   ` Vladimir Oltean
2020-12-01 22:31     ` Tobias Waldekranz [this message]
2020-12-02  0:33       ` 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=87sg8p6tw9.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