Re: [PATCH net-next 08/11] net: dsa: restore mdb dump
flat view
From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2017-08-15 17:38:26
Also in:
lkml
On 08/14/2017 03:22 PM, Vivien Didelot wrote:
quoted hunk ↗ jump to hunk
The same dsa_fdb_dump_cb_t callback is used since there is no distinction to do between FDB and MDB entries at this layer. Implement mv88e6xxx_port_mdb_dump so that multicast addresses associated to a switch port can be dumped. Signed-off-by: Vivien Didelot <redacted> --- drivers/net/dsa/mv88e6xxx/chip.c | 33 +++++++++++++++++++++++++-------- include/net/dsa.h | 3 +++ 2 files changed, 28 insertions(+), 8 deletions(-)diff --git a/drivers/net/dsa/mv88e6xxx/chip.c b/drivers/net/dsa/mv88e6xxx/chip.c index 918d8f0fe091..2ad32734b6f6 100644 --- a/drivers/net/dsa/mv88e6xxx/chip.c +++ b/drivers/net/dsa/mv88e6xxx/chip.c@@ -1380,7 +1380,7 @@ static int mv88e6xxx_port_fdb_del(struct dsa_switch *ds, int port, } static int mv88e6xxx_port_db_dump_fid(struct mv88e6xxx_chip *chip, - u16 fid, u16 vid, int port, + u16 fid, u16 vid, int port, bool mc, dsa_fdb_dump_cb_t *cb, void *data) { struct mv88e6xxx_atu_entry addr;@@ -1401,11 +1401,14 @@ static int mv88e6xxx_port_db_dump_fid(struct mv88e6xxx_chip *chip, if (addr.trunk || (addr.portvec & BIT(port)) == 0) continue; - if (!is_unicast_ether_addr(addr.mac)) + if ((is_unicast_ether_addr(addr.mac) && mc) ||
Should not this remain: if (!is_unicast_ether_addr(addr.mac) && mc) || (is_multicast_ether_addr(addr.mac) && !mc) here, being: - if this is an *not* an unicast address and MC dump is requested or - if this is a multicast address and MC dump is not requested -- Florian