* [PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0
@ 2017-07-20 13:57 Egil Hjelmeland
2017-07-24 16:57 ` Florian Fainelli
0 siblings, 1 reply; 3+ messages in thread
From: Egil Hjelmeland @ 2017-07-20 13:57 UTC (permalink / raw)
To: corbet, andrew, vivien.didelot, f.fainelli, davem, kernel,
linux-doc, linux-kernel, netdev
Cc: egil.hjelmeland
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);
+
+ {
+ /* Workaround for dsa_switch_mdb_add adding CPU port to
+ * group, but forgetting to remove it. Remove port 0
+ * if only port left
+ **/
+ 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;
}
--
2.11.0
DISCLAIMER:
This e-mail may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply e-mail and delete all copies of this message.
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0
2017-07-20 13:57 [PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0 Egil Hjelmeland
@ 2017-07-24 16:57 ` Florian Fainelli
2017-07-25 7:57 ` Egil Hjelmeland
0 siblings, 1 reply; 3+ messages in thread
From: Florian Fainelli @ 2017-07-24 16:57 UTC (permalink / raw)
To: Egil Hjelmeland, corbet, andrew, vivien.didelot, davem, kernel,
linux-doc, linux-kernel, netdev
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0
2017-07-24 16:57 ` Florian Fainelli
@ 2017-07-25 7:57 ` Egil Hjelmeland
0 siblings, 0 replies; 3+ messages in thread
From: Egil Hjelmeland @ 2017-07-25 7:57 UTC (permalink / raw)
To: Florian Fainelli, corbet, andrew, vivien.didelot, davem, kernel,
linux-doc, linux-kernel, netdev
On 24. juli 2017 18:57, Florian Fainelli wrote:
> 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:
>>
> 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?
>
Agree. I included the patch more as a bug report. I will remove it in
patch v2. I don't really feel competent to fix the issue in DSA. It is
probably better if you DSA people look at it. I do suspect DSA need
to do more bookkeeping?
Egil
DISCLAIMER:
This e-mail may contain confidential and privileged material for the sole use of the intended recipient. Any review, use, distribution or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive for the recipient), please contact the sender by reply e-mail and delete all copies of this message.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-25 7:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-07-20 13:57 [PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0 Egil Hjelmeland
2017-07-24 16:57 ` Florian Fainelli
2017-07-25 7:57 ` Egil Hjelmeland
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).