Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1694892
| From | Florian Fainelli <f.fainelli@gmail.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0 |
| Date | 2017-07-24 19:00 +0200 |
| Message-ID | <u6OS5-7yA-13@gated-at.bofh.it> (permalink) |
| References | <u6NMl-6Pn-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 07/20/2017 06:57 AM, Egil Hjelmeland wrote:
> Workaround for dsa_switch_mdb_add adding CPU port to group,
> but forgetting to remove it:
>
> Remove port 0 if only port 0 is only port left.
>
> Signed-off-by: Egil Hjelmeland <egil.hjelmeland@zenitel.com>
> ---
> drivers/net/dsa/lan9303-core.c | 11 +++++++++++
> 1 file changed, 11 insertions(+)
>
> diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c
> index 54646eb38185..61c915eed649 100644
> --- a/drivers/net/dsa/lan9303-core.c
> +++ b/drivers/net/dsa/lan9303-core.c
> @@ -1424,6 +1424,17 @@ static int lan9303_port_mdb_del(
> if (mdb->vid)
> return -EOPNOTSUPP;
> lan9303_alr_del_port(chip, mdb->addr, port);
> +
> + {
No need for curly braces here.
> + /* Workaround for dsa_switch_mdb_add adding CPU port to
> + * group, but forgetting to remove it. Remove port 0
> + * if only port left
Should not we move this logic one layer above into DSA then such that
insertions and removals are strictly symmetrical in which and how many
ports are targeted?
> + **/
> + struct lan9303_alr_cache_entry *entr =
> + lan9303_alr_cache_find_mac(chip, mdb->addr);
> + if (entr && (entr->port_map == BIT(0)))
> + lan9303_alr_del_port(chip, mdb->addr, 0);
> + }
> return 0;
> }
>
>
--
Florian
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0 Egil Hjelmeland <egil.hjelmeland@zenitel.com> - 2017-07-24 17:50 +0200
Re: [PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0 Florian Fainelli <f.fainelli@gmail.com> - 2017-07-24 19:00 +0200
Re: [PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0 Egil Hjelmeland <egil.hjelmeland@zenitel.com> - 2017-07-25 10:00 +0200
csiph-web