netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Florian Fainelli <f.fainelli@gmail.com>,
	davem@davemloft.net, netdev@vger.kernel.org
Cc: andrew@lunn.ch, vivien.didelot@gmail.com, linus.walleij@linaro.org
Subject: Re: [RFC PATCH net-next 10/13] net: dsa: sja1105: Add support for traffic through standalone ports
Date: Wed, 27 Mar 2019 00:03:59 +0200	[thread overview]
Message-ID: <df79a464-5da3-7e0f-e8d4-33e406676ce5@gmail.com> (raw)
In-Reply-To: <2612a31e-ddde-d19d-40a0-80f1be5ac919@gmail.com>

On 3/26/19 4:31 AM, Florian Fainelli wrote:
> 
> 
> On 3/23/2019 8:23 PM, Vladimir Oltean wrote:
>> In order to support this, we are creating a make-shift switch tag out of
>> a VLAN trunk configured on the CPU port. Termination on switch ports
>> only works when not under a vlan_filtering bridge. We are making use of
>> the generic CONFIG_NET_DSA_TAG_8021Q code and leveraging it from our own
>> CONFIG_NET_DSA_TAG_SJA1105.
>>
>> There are two types of traffic: regular and link-local.
>> The link-local traffic received on the CPU port is trapped from the
>> switch's regular forwarding decisions because it matched one of the two
>> DMAC filters for management traffic.
>> On transmission, the switch requires special massaging for these
>> link-local frames. Due to a weird implementation of the switching IP, by
>> default it drops link-local frames that originate on the CPU port. It
>> needs to be told where to forward them to, through an SPI command
>> ("management route") that is valid for only a single frame.
>> So when we're sending link-local traffic, we need to clone skb's from
>> DSA and send them in our custom xmit worker that also performs SPI access.
>>
>> For that purpose, the DSA xmit handler and the xmit worker communicate
>> through a per-port "skb ring" software structure, with a producer and a
>> consumer index. At the moment this structure is rather fragile
>> (ping-flooding to a link-local DMAC would cause most of the frames to
>> get dropped). I would like to move the management traffic on a separate
>> netdev queue that I can stop when the skb ring got full and hardware is
>> busy processing, so that we are not forced to drop traffic.
>>
>> Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
> 
> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
> 
> I do like the idea of setting up specific management queue later on,
> although it is not clear to me how you would go about integrating it as
> a network device, given the DSA slave and master devices, do you know
> roughly how you would proceed?
> 

Actually I was thinking about leveraging the multiqueue support that you 
added in 55199df6d2af ("net: dsa: Allow switch drivers to indicate 
number of TX queues") and expose the slave netdev .ndo_select_queue 
callback towards DSA ports. There I would return queue #0 if 
sja1105_is_link_local(skb), and queue #1 otherwise.
Are there any complications that I'm missing?

Thanks,
-Vladimir

  reply	other threads:[~2019-03-26 22:04 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-24  3:23 [RFC PATCH net-next 00/13] NXP SJA1105 DSA driver Vladimir Oltean
2019-03-24  3:23 ` [RFC PATCH net-next 01/13] lib: Add support for generic packing operations Vladimir Oltean
2019-03-24 19:02   ` Richard Cochran
2019-03-24 20:32     ` Vladimir Oltean
2019-03-26  4:13       ` Richard Cochran
2019-03-24  3:23 ` [RFC PATCH net-next 02/13] net: dsa: Store vlan_filtering as a property of dsa_port Vladimir Oltean
2019-03-24 20:34   ` Andrew Lunn
2019-03-25 16:46   ` Florian Fainelli
2019-03-24  3:23 ` [RFC PATCH net-next 03/13] net: dsa: Create a more convenient function for installing port VLANs Vladimir Oltean
2019-03-25 17:06   ` Florian Fainelli
2019-03-27  0:31     ` Vladimir Oltean
2019-03-24  3:23 ` [RFC PATCH net-next 04/13] net: dsa: Call driver's setup callback after setting up its switchdev notifier Vladimir Oltean
2019-03-25 16:47   ` Florian Fainelli
2019-03-24  3:23 ` [RFC PATCH net-next 05/13] net: dsa: Optional VLAN-based port separation for switches without tagging Vladimir Oltean
2019-03-26  2:21   ` Florian Fainelli
2019-03-24  3:23 ` [RFC PATCH net-next 06/13] net: dsa: Introduce driver for NXP SJA1105 5-port L2 switch Vladimir Oltean
2019-03-26 13:02   ` Florian Fainelli
2019-03-26 17:52     ` Vladimir Oltean
2019-03-24  3:23 ` [RFC PATCH net-next 07/13] net: dsa: sja1105: Add support for FDB and MDB management Vladimir Oltean
2019-03-26  2:37   ` Florian Fainelli
2019-03-24  3:23 ` [RFC PATCH net-next 08/13] net: dsa: sja1105: Add support for VLAN operations Vladimir Oltean
2019-03-26  2:41   ` Florian Fainelli
2019-03-24  3:23 ` [RFC PATCH net-next 09/13] net: dsa: sja1105: Add support for ethtool port counters Vladimir Oltean
2019-03-26  2:44   ` Florian Fainelli
2019-03-24  3:23 ` [RFC PATCH net-next 10/13] net: dsa: sja1105: Add support for traffic through standalone ports Vladimir Oltean
2019-03-26  2:31   ` Florian Fainelli
2019-03-26 22:03     ` Vladimir Oltean [this message]
2019-03-26 22:13       ` Florian Fainelli
2019-03-26 22:38         ` Vladimir Oltean
2019-03-26 22:45           ` Florian Fainelli
2019-03-24  3:23 ` [RFC PATCH net-next 11/13] net: dsa: sja1105: Add support for Spanning Tree Protocol Vladimir Oltean
2019-03-24  3:23 ` [RFC PATCH net-next 12/13] Documentation: networking: dsa: Add details about NXP SJA1105 driver Vladimir Oltean
2019-03-26  2:34   ` Florian Fainelli
2019-03-24  3:23 ` [RFC PATCH net-next 13/13] dt-bindings: net: dsa: Add documentation for " Vladimir Oltean
2019-03-26  2:24   ` Florian Fainelli
2019-03-26 23:44     ` Vladimir Oltean
2019-03-25 16:31 ` [RFC PATCH net-next 00/13] NXP SJA1105 DSA driver Florian Fainelli
2019-03-26 17:30 ` Vinicius Costa Gomes
2019-03-26 18:07   ` 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=df79a464-5da3-7e0f-e8d4-33e406676ce5@gmail.com \
    --to=olteanv@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=netdev@vger.kernel.org \
    --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).