From: Guenter Roeck <linux@roeck-us•net>
To: Scott Feldman <sfeldma@gmail•com>
Cc: roopa <roopa@cumulusnetworks•com>, Jiri Pirko <jiri@resnulli•us>,
John Fastabend <john.fastabend@gmail•com>,
Andrew Lunn <andrew@lunn•ch>, David Miller <davem@davemloft•net>,
"Arad, Ronen" <ronen.arad@intel•com>,
Netdev <netdev@vger•kernel.org>
Subject: Re: [PATCH net-next RFC v2] switchdev: bridge: drop hardware forwarded packets
Date: Tue, 24 Mar 2015 20:10:50 -0700 [thread overview]
Message-ID: <5512273A.2060303@roeck-us.net> (raw)
In-Reply-To: <CAE4R7bAoGeFdNAUqMR-RmQWTtfSy0t+e4f187an_BVVVR2tDnw@mail.gmail.com>
On 03/24/2015 11:14 AM, Scott Feldman wrote:
> On Tue, Mar 24, 2015 at 10:58 AM, Guenter Roeck <linux@roeck-us•net> wrote:
>> On Tue, Mar 24, 2015 at 10:45:03AM -0700, roopa wrote:
>>> On 3/24/15, 9:01 AM, Guenter Roeck wrote:
>>>> On Tue, Mar 24, 2015 at 03:29:21PM +0100, Jiri Pirko wrote:
>>>>>> diff --git a/drivers/net/ethernet/rocker/rocker.c
>>>>>> b/drivers/net/ethernet/rocker/rocker.c
>>>>>> index aab962c..0f7217f7 100644
>>>>>> --- a/drivers/net/ethernet/rocker/rocker.c
>>>>>> +++ b/drivers/net/ethernet/rocker/rocker.c
>>>>>> @@ -3931,15 +3931,28 @@ unmap_frag:
>>>>>> return -EMSGSIZE;
>>>>>> }
>>>>>>
>>>>>> +static bool rocker_port_dev_check(struct net_device *dev);
>>>>>> +
>>>>>> static netdev_tx_t rocker_port_xmit(struct sk_buff *skb, struct
>>>>>> net_device *dev)
>>>>>> {
>>>>>> struct rocker_port *rocker_port = netdev_priv(dev);
>>>>>> struct rocker *rocker = rocker_port->rocker;
>>>>>> struct rocker_desc_info *desc_info;
>>>>>> struct rocker_tlv *frags;
>>>>>> + struct net_device *in_dev;
>>>>>> int i;
>>>>>> int err;
>>>>>>
>>>>>> + if (rocker_port_is_bridged(rocker_port)) {
>>>>>> + rcu_read_lock();
>>>>>> + in_dev = dev_get_by_index_rcu(dev_net(dev), skb->skb_iif);
>>>>> Hmm, you iterate over all ports for every xmit call :/
>>>>> Would be nicer if skb_iif would be netdev poiter. Not sure it is doable.
>>>>>
>>>> It may be easier (and faster) to loop through all rocker ports and try to find
>>>> one with the same ifindex. Then the dev_check call would not be necessary.
>>>>
>>> This is still overhead for every packet on the switches we support. The
>>> number of ports can go close to 128
>>> (40G ports can be broken into 4x10G ports).
>>>
>> Agreed. Given that, and since dev_get_by_index_rcu uses a hash to find the
>> device pointer, it may actually be (much) faster (and the above "iterate
>> over all ports" is a bit misleading).
>>
>> I tested the above approach with DSA and a Marvell switch chip. It works,
>> but I am a bit concerned about the per-packet overhead, especially
>> in larger networks. I would prefer if there would be a means to 'catch'
>> duplicate packets earlier - before they are even created, if that is
>> possible.
>
> I'm not so concerned about the per-packet overhead. For multicast, we
> have IGMP snooping. And big switches are going to have rate controls
> on CPU bound traffic, so the CPU should be able to handle the
> per-packet overhead with ease.
>
Ok, next question: Are there any legitimate reasons why a packet might be
sent out on the same interface ? Examples might be packets received through
a VPN or other tunnel and forwarded to the local network, or packets forwarded
in L3 (for example if there are multiple L3 networks on the same link).
Would skb_iif be set for such packets ?
Guenter
next prev parent reply other threads:[~2015-03-25 3:10 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-20 16:58 [PATCH net-next RFC v2] switchdev: bridge: drop hardware forwarded packets roopa
2015-03-20 17:11 ` John Fastabend
2015-03-20 18:13 ` Scott Feldman
2015-03-20 18:30 ` John Fastabend
2015-03-20 22:06 ` roopa
2015-03-20 22:37 ` Scott Feldman
2015-03-20 23:30 ` roopa
2015-03-21 0:26 ` Scott Feldman
2015-03-21 5:53 ` roopa
2015-03-20 21:03 ` roopa
2015-03-20 21:23 ` John Fastabend
2015-03-20 22:04 ` Andrew Lunn
2015-03-20 23:12 ` roopa
2015-03-20 18:03 ` Scott Feldman
2015-03-20 21:20 ` roopa
2015-03-20 20:36 ` David Miller
2015-03-20 21:36 ` roopa
2015-03-20 22:09 ` Andrew Lunn
2015-03-20 23:43 ` Florian Fainelli
2015-03-23 0:22 ` Guenter Roeck
2015-03-23 1:33 ` John Fastabend
2015-03-23 2:57 ` Guenter Roeck
2015-03-23 3:18 ` John Fastabend
2015-03-23 3:33 ` Guenter Roeck
2015-03-23 17:12 ` roopa
2015-03-24 5:59 ` Scott Feldman
2015-03-24 13:13 ` Guenter Roeck
2015-03-24 18:08 ` Scott Feldman
2015-03-24 14:29 ` Jiri Pirko
2015-03-24 16:01 ` Guenter Roeck
2015-03-24 17:45 ` roopa
2015-03-24 17:58 ` Guenter Roeck
2015-03-24 18:14 ` Scott Feldman
2015-03-25 3:10 ` Guenter Roeck [this message]
2015-03-25 3:46 ` Florian Fainelli
2015-03-25 5:06 ` Scott Feldman
2015-03-25 17:01 ` roopa
2015-03-26 7:44 ` Scott Feldman
2015-03-26 8:20 ` Jiri Pirko
2015-03-26 14:28 ` Scott Feldman
2015-03-26 14:49 ` Jiri Pirko
2015-03-27 1:08 ` Simon Horman
2015-03-27 6:02 ` Jiri Pirko
2015-03-27 6:43 ` Scott Feldman
2015-03-27 7:01 ` Jiri Pirko
2015-03-27 23:19 ` Scott Feldman
2015-03-30 14:06 ` roopa
2015-03-24 18:48 ` David Christensen
2015-03-24 17:58 ` Scott Feldman
2015-03-23 17:10 ` roopa
2015-03-23 14:00 ` roopa
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=5512273A.2060303@roeck-us.net \
--to=linux@roeck-us$(echo .)net \
--cc=andrew@lunn$(echo .)ch \
--cc=davem@davemloft$(echo .)net \
--cc=jiri@resnulli$(echo .)us \
--cc=john.fastabend@gmail$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=ronen.arad@intel$(echo .)com \
--cc=roopa@cumulusnetworks$(echo .)com \
--cc=sfeldma@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