From: Florian Fainelli <f.fainelli@gmail.com>
To: Egil Hjelmeland <egil.hjelmeland@zenitel.com>,
corbet@lwn.net, andrew@lunn.ch,
vivien.didelot@savoirfairelinux.com, davem@davemloft.net,
kernel@pengutronix.de, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 13/13] net: dsa: lan9303: lan9303_port_mdb_del remove port 0
Date: Mon, 24 Jul 2017 09:57:26 -0700 [thread overview]
Message-ID: <42090826-7498-4d90-f265-a7cf65a9e236@gmail.com> (raw)
In-Reply-To: <3bf6b19359cc40939b2e075635ed55d2@nooslMX1.zenitelcss.com>
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
next prev parent reply other threads:[~2017-07-24 16:57 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2017-07-25 7:57 ` Egil Hjelmeland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=42090826-7498-4d90-f265-a7cf65a9e236@gmail.com \
--to=f.fainelli@gmail.com \
--cc=andrew@lunn.ch \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=egil.hjelmeland@zenitel.com \
--cc=kernel@pengutronix.de \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).