From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Florian Fainelli <f.fainelli@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
Ansuel Smith <ansuelsmth@gmail.com>,
Tobias Waldekranz <tobias@waldekranz.com>,
DENG Qingfang <dqfext@gmail.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
UNGLinuxDriver@microchip.com, Jiri Pirko <jiri@resnulli.us>,
Ivan Vecera <ivecera@redhat.com>
Subject: [PATCH v3 net-next 09/11] net: dsa: call SWITCHDEV_FDB_OFFLOADED for the orig_dev
Date: Mon, 21 Feb 2022 19:53:54 +0200 [thread overview]
Message-ID: <20220221175356.1688982-10-vladimir.oltean@nxp.com> (raw)
In-Reply-To: <20220221175356.1688982-1-vladimir.oltean@nxp.com>
When switchdev_handle_fdb_event_to_device() replicates a FDB event
emitted for the bridge or for a LAG port and DSA offloads that, we
should notify back to switchdev that the FDB entry on the original
device is what was offloaded, not on the DSA slave devices that the
event is replicated on.
Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
v2->v3: none
net/dsa/dsa_priv.h | 1 +
net/dsa/slave.c | 3 ++-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h
index f35b7a1496e1..f2364c5adc04 100644
--- a/net/dsa/dsa_priv.h
+++ b/net/dsa/dsa_priv.h
@@ -120,6 +120,7 @@ struct dsa_notifier_master_state_info {
struct dsa_switchdev_event_work {
struct net_device *dev;
+ struct net_device *orig_dev;
struct work_struct work;
unsigned long event;
/* Specific for SWITCHDEV_FDB_ADD_TO_DEVICE and
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 7eb972691ce9..4aeb3e092dd6 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -2378,7 +2378,7 @@ dsa_fdb_offload_notify(struct dsa_switchdev_event_work *switchdev_work)
info.vid = switchdev_work->vid;
info.offloaded = true;
call_switchdev_notifiers(SWITCHDEV_FDB_OFFLOADED,
- switchdev_work->dev, &info.info, NULL);
+ switchdev_work->orig_dev, &info.info, NULL);
}
static void dsa_slave_switchdev_event_work(struct work_struct *work)
@@ -2495,6 +2495,7 @@ static int dsa_slave_fdb_event(struct net_device *dev,
INIT_WORK(&switchdev_work->work, dsa_slave_switchdev_event_work);
switchdev_work->event = event;
switchdev_work->dev = dev;
+ switchdev_work->orig_dev = orig_dev;
ether_addr_copy(switchdev_work->addr, fdb_info->addr);
switchdev_work->vid = fdb_info->vid;
--
2.25.1
next prev parent reply other threads:[~2022-02-21 18:05 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-21 17:53 [PATCH v3 net-next 00/11] FDB entries on DSA LAG interfaces Vladimir Oltean
2022-02-21 17:53 ` [PATCH v3 net-next 01/11] net: dsa: rename references to "lag" as "lag_dev" Vladimir Oltean
2022-02-21 17:53 ` [PATCH v3 net-next 02/11] net: dsa: mv88e6xxx: " Vladimir Oltean
2022-02-21 17:53 ` [PATCH v3 net-next 03/11] net: dsa: qca8k: " Vladimir Oltean
2022-02-21 17:53 ` [PATCH v3 net-next 04/11] net: dsa: make LAG IDs one-based Vladimir Oltean
2022-02-21 17:53 ` [PATCH v3 net-next 05/11] net: dsa: mv88e6xxx: use dsa_switch_for_each_port in mv88e6xxx_lag_sync_masks Vladimir Oltean
2022-02-21 17:53 ` [PATCH v3 net-next 06/11] net: dsa: create a dsa_lag structure Vladimir Oltean
2022-02-21 17:53 ` [PATCH v3 net-next 07/11] net: switchdev: remove lag_mod_cb from switchdev_handle_fdb_event_to_device Vladimir Oltean
2022-02-21 17:53 ` [PATCH v3 net-next 08/11] net: dsa: remove "ds" and "port" from struct dsa_switchdev_event_work Vladimir Oltean
2022-02-21 17:53 ` Vladimir Oltean [this message]
2022-02-21 17:53 ` [PATCH v3 net-next 10/11] net: dsa: support FDB events on offloaded LAG interfaces Vladimir Oltean
2022-02-21 17:53 ` [PATCH v3 net-next 11/11] net: dsa: felix: support FDB entries " Vladimir Oltean
2022-02-21 20:28 ` [PATCH v3 net-next 00/11] FDB entries on DSA " 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=20220221175356.1688982-10-vladimir.oltean@nxp.com \
--to=vladimir.oltean@nxp.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=f.fainelli@gmail.com \
--cc=ivecera@redhat.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=tobias@waldekranz.com \
--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