From: Florian Fainelli <f.fainelli@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>,
Horatiu Vultur <horatiu.vultur@microchip.com>
Cc: roopa@cumulusnetworks.com, nikolay@cumulusnetworks.com,
davem@davemloft.net, UNGLinuxDriver@microchip.com,
alexandre.belloni@bootlin.com, allan.nielsen@microchip.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
bridge@lists.linux-foundation.org
Subject: Re: [PATCH v2 0/3] Add NETIF_F_HW_BR_CAP feature
Date: Mon, 26 Aug 2019 10:01:33 -0700 [thread overview]
Message-ID: <98230ad4-cf0a-b496-d4de-d3abf77d9741@gmail.com> (raw)
In-Reply-To: <20190826123811.GA13411@lunn.ch>
On 8/26/19 5:38 AM, Andrew Lunn wrote:
> On Mon, Aug 26, 2019 at 10:11:12AM +0200, Horatiu Vultur wrote:
>> When a network port is added to a bridge then the port is added in
>> promisc mode. Some HW that has bridge capabilities(can learn, forward,
>> flood etc the frames) they are disabling promisc mode in the network
>> driver when the port is added to the SW bridge.
>>
>> This patch adds the feature NETIF_F_HW_BR_CAP so that the network ports
>> that have this feature will not be set in promisc mode when they are
>> added to a SW bridge.
>>
>> In this way the HW that has bridge capabilities don't need to send all the
>> traffic to the CPU and can also implement the promisc mode and toggle it
>> using the command 'ip link set dev swp promisc on'
>
> Hi Horatiu
>
> I'm still not convinced this is needed. The model is, the hardware is
> there to accelerate what Linux can do in software. Any peculiarities
> of the accelerator should be hidden in the driver. If the accelerator
> can do its job without needing promisc mode, do that in the driver.
>
> So you are trying to differentiate between promisc mode because the
> interface is a member of a bridge, and promisc mode because some
> application, like pcap, has asked for promisc mode.
>
> dev->promiscuity is a counter. So what you can do it look at its
> value, and how the interface is being used. If the interface is not a
> member of a bridge, and the count > 0, enable promisc mode in the
> accelerator. If the interface is a member of a bridge, and the count >
> 1, enable promisc mode in the accelerator.
That is an excellent suggestion actually.
Horatiu, the other issue with your approach here is that the features
don't propagate to/from lower/upper/real devices, so if e.g.: you have a
VLAN interface enslaved as a part of the bridge, or a bond, or a tunnel
interface, the logic won't make us check NETIF_F_HW_BR_CAP because those
virtual network devices won't inherit it from their real device. I am
not suggesting you fix this with your patch series, but rather, seek a
driver local solution.
--
Florian
next prev parent reply other threads:[~2019-08-26 17:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-26 8:11 [PATCH v2 0/3] Add NETIF_F_HW_BR_CAP feature Horatiu Vultur
2019-08-26 8:11 ` [PATCH v2 1/3] net: Add NETIF_HW_BR_CAP feature Horatiu Vultur
2019-08-26 8:11 ` [PATCH v2 2/3] net: mscc: Use NETIF_F_HW_BR_CAP Horatiu Vultur
2019-08-26 8:11 ` [PATCH v2 3/3] net: mscc: Implement promisc mode Horatiu Vultur
2019-08-26 12:38 ` [PATCH v2 0/3] Add NETIF_F_HW_BR_CAP feature Andrew Lunn
2019-08-26 17:01 ` Florian Fainelli [this message]
2019-08-26 21:13 ` David Miller
2019-08-27 10:10 ` Horatiu Vultur
2019-08-27 13:18 ` Andrew Lunn
2019-08-27 14:55 ` Vladimir Oltean
2019-08-28 21:53 ` Horatiu Vultur
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=98230ad4-cf0a-b496-d4de-d3abf77d9741@gmail.com \
--to=f.fainelli@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--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).