Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1712384

Re: [PATCH net-next 08/11] net: dsa: restore mdb dump

From Florian Fainelli <f.fainelli@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH net-next 08/11] net: dsa: restore mdb dump
Date 2017-08-15 19:40 +0200
Message-ID <ueNYR-4hU-9@gated-at.bofh.it> (permalink)
References <uew1Y-1pG-9@gated-at.bofh.it> <uew1Z-1pG-33@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 08/14/2017 03:22 PM, Vivien Didelot wrote:
> 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 <vivien.didelot@savoirfairelinux.com>
> ---
>  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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net-next 00/11] net: dsa: add generic debugfs interface Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-15 00:30 +0200
  [PATCH net-next 09/11] net: dsa: debugfs: add port mdb Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-15 00:30 +0200
    Re: [PATCH net-next 09/11] net: dsa: debugfs: add port mdb Andrew Lunn <andrew@lunn.ch> - 2017-08-15 01:00 +0200
    Re: [PATCH net-next 09/11] net: dsa: debugfs: add port mdb Florian Fainelli <f.fainelli@gmail.com> - 2017-08-15 19:40 +0200
  [PATCH net-next 01/11] net: dsa: legacy: assign dst->applied Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-15 00:30 +0200
    Re: [PATCH net-next 01/11] net: dsa: legacy: assign dst->applied Andrew Lunn <andrew@lunn.ch> - 2017-08-15 01:00 +0200
  [PATCH net-next 08/11] net: dsa: restore mdb dump Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-15 00:30 +0200
    Re: [PATCH net-next 08/11] net: dsa: restore mdb dump Andrew Lunn <andrew@lunn.ch> - 2017-08-15 00:50 +0200
    Re: [PATCH net-next 08/11] net: dsa: restore mdb dump Florian Fainelli <f.fainelli@gmail.com> - 2017-08-15 19:40 +0200
  [PATCH net-next 07/11] net: dsa: debugfs: add port fdb Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-15 00:40 +0200
    Re: [PATCH net-next 07/11] net: dsa: debugfs: add port fdb Andrew Lunn <andrew@lunn.ch> - 2017-08-15 00:50 +0200
    Re: [PATCH net-next 07/11] net: dsa: debugfs: add port fdb Florian Fainelli <f.fainelli@gmail.com> - 2017-08-15 19:40 +0200
  [PATCH net-next 06/11] net: dsa: debugfs: add port registers Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-15 00:40 +0200
    Re: [PATCH net-next 06/11] net: dsa: debugfs: add port registers Andrew Lunn <andrew@lunn.ch> - 2017-08-15 00:50 +0200
    RE: [PATCH net-next 06/11] net: dsa: debugfs: add port registers <Woojung.Huh@microchip.com> - 2017-08-15 18:30 +0200
    Re: [PATCH net-next 06/11] net: dsa: debugfs: add port registers Florian Fainelli <f.fainelli@gmail.com> - 2017-08-15 19:40 +0200
  [PATCH net-next 05/11] net: dsa: debugfs: add port stats Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-15 00:40 +0200
    Re: [PATCH net-next 05/11] net: dsa: debugfs: add port stats Andrew Lunn <andrew@lunn.ch> - 2017-08-15 00:50 +0200
    Re: [PATCH net-next 05/11] net: dsa: debugfs: add port stats Florian Fainelli <f.fainelli@gmail.com> - 2017-08-15 19:40 +0200
  [PATCH net-next 02/11] net: dsa: add debugfs interface Vivien Didelot <vivien.didelot@savoirfairelinux.com> - 2017-08-15 00:40 +0200
    Re: [PATCH net-next 02/11] net: dsa: add debugfs interface Florian Fainelli <f.fainelli@gmail.com> - 2017-08-15 19:30 +0200
  Re: [PATCH net-next 00/11] net: dsa: add generic debugfs interface Florian Fainelli <f.fainelli@gmail.com> - 2017-08-19 00:00 +0200

csiph-web