linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ido Schimmel <idosch@idosch.org>
To: "Allan W. Nielsen" <allan.nielsen@microchip.com>
Cc: Andrew Lunn <andrew@lunn.ch>,
	Horatiu Vultur <horatiu.vultur@microchip.com>,
	Nikolay Aleksandrov <nikolay@cumulusnetworks.com>,
	roopa@cumulusnetworks.com, davem@davemloft.net,
	bridge@lists.linux-foundation.org, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: bridge: Allow bridge to joing multicast groups
Date: Mon, 29 Jul 2019 09:09:23 +0300	[thread overview]
Message-ID: <20190729060923.GA16938@splinter> (raw)
In-Reply-To: <20190728191558.zuopgfqza2iz5d5b@lx-anielsen.microsemi.net>

On Sun, Jul 28, 2019 at 09:15:59PM +0200, Allan W. Nielsen wrote:
> If we assume that the SwitchDev driver implemented such that all multicast
> traffic goes to the CPU, then we should really have a way to install a HW
> offload path in the silicon, such that these packets does not go to the CPU (as
> they are known not to be use full, and a frame every 3 us is a significant load
> on small DMA connections and CPU resources).
> 
> If we assume that the SwitchDev driver implemented such that only "needed"
> multicast packets goes to the CPU, then we need a way to get these packets in
> case we want to implement the DLR protocol.

I'm not familiar with the HW you're working with, so the below might not
be relevant.

In case you don't want to send all multicast traffic to the CPU (I'll
refer to it later), you can install an ingress tc filter that traps to
the CPU the packets you do want to receive. Something like:

# tc qdisc add dev swp1 clsact
# tc filter add dev swp1 pref 1 ingress flower skip_sw dst_mac \
	01:21:6C:00:00:01 action trap

If your HW supports sharing the same filter among multiple ports, then
you can install your filter in a tc shared block and bind multiple ports
to it.

Another option is to always send a *copy* of multicast packets to the
CPU, but make sure the HW uses a policer that prevents the CPU from
being overwhelmed. To avoid packets being forwarded twice (by HW and
SW), you will need to mark such packets in your driver with
'skb->offload_fwd_mark = 1'.

Now, in case user wants to allow the CPU to receive certain packets at a
higher rate, a tc filter can be used. It will be identical to the filter
I mentioned earlier, but with a 'police' action chained before 'trap'.

I don't think this is currently supported by any driver, but I believe
it's the right way to go: By default the CPU receives all the traffic it
should receive and user can fine-tune it using ACLs.

  parent reply	other threads:[~2019-07-29  6:09 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-25 11:44 [PATCH] net: bridge: Allow bridge to joing multicast groups Horatiu Vultur
2019-07-25 13:06 ` Nikolay Aleksandrov
2019-07-25 13:21   ` Nikolay Aleksandrov
2019-07-25 14:21     ` Horatiu Vultur
2019-07-26  8:41       ` Nikolay Aleksandrov
2019-07-26  9:26         ` Nikolay Aleksandrov
2019-07-26 12:02           ` Horatiu Vultur
2019-07-26 12:31             ` Nikolay Aleksandrov
2019-07-29 12:14               ` Allan W. Nielsen
2019-07-29 12:22                 ` Nikolay Aleksandrov
2019-07-29 12:50                   ` Nikolay Aleksandrov
2019-07-29 13:14                   ` Allan W. Nielsen
2019-07-29 13:42                     ` Nikolay Aleksandrov
2019-07-29 13:52                       ` Allan W. Nielsen
2019-07-29 14:21                         ` Nikolay Aleksandrov
2019-07-29 14:35                           ` Allan W. Nielsen
2019-07-29 17:51                             ` Ido Schimmel
2019-07-30  6:27                               ` Allan W. Nielsen
2019-07-30  7:06                                 ` Ido Schimmel
2019-07-30  8:30                                   ` Allan W. Nielsen
2019-07-30  8:58                                     ` Nikolay Aleksandrov
2019-07-30  9:21                                       ` Allan W. Nielsen
2019-07-30  9:55                                         ` Nikolay Aleksandrov
2019-07-30 11:23                                           ` Allan W. Nielsen
2019-07-30 10:04                                     ` Ido Schimmel
2019-07-30 12:19                                       ` Allan W. Nielsen
2019-07-30 14:34                                 ` Andrew Lunn
2019-07-30 19:00                                   ` Allan W. Nielsen
2019-07-31  3:31                                     ` Andrew Lunn
2019-07-31  8:01                                       ` Allan W. Nielsen
2019-07-31 13:45                                         ` Andrew Lunn
2019-07-31 19:38                                           ` Allan W. Nielsen
2019-08-01 14:22               ` Allan W. Nielsen
2019-07-26 13:46             ` Andrew Lunn
2019-07-26 19:50               ` Allan W. Nielsen
2019-07-27  3:02                 ` Andrew Lunn
2019-07-28 19:15                   ` Allan W. Nielsen
2019-07-28 23:07                     ` Andrew Lunn
2019-07-29  6:09                     ` Ido Schimmel [this message]
2019-07-29 12:43                       ` Allan W. Nielsen
2019-08-01 19:17 ` Vivien Didelot
2019-08-01 19:48   ` Horatiu Vultur
2019-08-01 20:08     ` Vivien Didelot

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=20190729060923.GA16938@splinter \
    --to=idosch@idosch.org \
    --cc=allan.nielsen@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=bridge@lists.linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=horatiu.vultur@microchip.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nikolay@cumulusnetworks.com \
    --cc=roopa@cumulusnetworks.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).