[PATCH v3 0/2] net: core: Notify on changes to dev->promiscuity

From: Horatiu Vultur
Date: Thu Aug 29 2019 - 05:24:20 EST


Add the SWITCHDEV_ATTR_ID_PORT_PROMISCUITY switchdev notification type,
used to indicate whenever the dev promiscuity counter is changed.

HW that has bridge capabilities are not required to set their ports in
promisc mode when they are added to the bridge. But it is required to
enable promisc mode if a user space application requires it. Therefore
if the driver listens for events SWITCHDEV_ATTR_ID_PORT_PROMISCUITY and
NETDEV_CHANGEUPPER it is possible to deduce when to add/remove ports in
promisc mode.

v2->v3:
- stop using feature NETIF_F_HW_BR_CAP
- renmae subject from 'Add NETIF_F_BW_BR_CAP feature' because this
feature is not used anymore.

v1->v2:
- rename feature to NETIF_F_HW_BR_CAP
- add better description in the commit message and in the code
- remove the check that all network drivers have same netdev_ops and
just check for the feature NETIF_F_HW_BR_CAP when setting the
network port in promisc mode.

Horatiu Vultur (2):
net: core: Notify on changes to dev->promiscuity.
net: mscc: Implement promisc mode.

drivers/net/ethernet/mscc/ocelot.c | 47 ++++++++++++++++++++++++++++++++++++++
include/net/switchdev.h | 1 +
net/core/dev.c | 9 ++++++++
3 files changed, 57 insertions(+)

--
2.7.4