[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210224114350.2791260-4-olteanv@gmail.com>
Date: Wed, 24 Feb 2021 13:43:36 +0200
From: Vladimir Oltean <olteanv@...il.com>
To: netdev@...r.kernel.org
Cc: Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
Vivien Didelot <vivien.didelot@...il.com>,
Jiri Pirko <jiri@...nulli.us>,
Ido Schimmel <idosch@...sch.org>,
DENG Qingfang <dqfext@...il.com>,
Tobias Waldekranz <tobias@...dekranz.com>,
George McCollister <george.mccollister@...il.com>,
Vlad Yasevich <vyasevich@...il.com>,
Roopa Prabhu <roopa@...dia.com>,
Nikolay Aleksandrov <nikolay@...dia.com>
Subject: [RFC PATCH v2 net-next 03/17] net: dsa: install the host MDB and FDB entries in the master's RX filter
From: Vladimir Oltean <vladimir.oltean@....com>
If the DSA master implements strict address filtering, then the unicast
and multicast addresses kept by the DSA CPU ports should be synchronized
with the address lists of the DSA master.
Note that we want the synchronization of the master's address lists even
if the DSA switch doesn't support unicast/multicast database operations,
on the premises that the packets will be flooded to the CPU in that
case, and we should still instruct the master to receive them.
Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
---
net/dsa/slave.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index 12d51bdb5eea..b6ea7e21b3b6 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -48,6 +48,8 @@ static int dsa_host_mdb_add(struct dsa_port *dp,
struct dsa_host_addr *a;
int err;
+ dev_mc_add(cpu_dp->master, mdb->addr);
+
if (!dp->ds->ops->port_mdb_add || !dp->ds->ops->port_mdb_del)
return -EOPNOTSUPP;
@@ -82,6 +84,8 @@ static int dsa_host_mdb_del(struct dsa_port *dp,
struct dsa_host_addr *a;
int err;
+ dev_mc_del(cpu_dp->master, mdb->addr);
+
if (!dp->ds->ops->port_mdb_add || !dp->ds->ops->port_mdb_del)
return -EOPNOTSUPP;
@@ -109,6 +113,8 @@ static int dsa_host_fdb_add(struct dsa_port *dp, const unsigned char *addr,
struct dsa_host_addr *a;
int err;
+ dev_uc_add(cpu_dp->master, addr);
+
if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del)
return -EOPNOTSUPP;
@@ -143,6 +149,8 @@ static int dsa_host_fdb_del(struct dsa_port *dp, const unsigned char *addr,
struct dsa_host_addr *a;
int err;
+ dev_uc_del(cpu_dp->master, addr);
+
if (!dp->ds->ops->port_fdb_add || !dp->ds->ops->port_fdb_del)
return -EOPNOTSUPP;
--
2.25.1
Powered by blists - more mailing lists