From: <Arun.Ramadoss@microchip.com>
To: <olteanv@gmail.com>, <andrew@lunn.ch>, <f.fainelli@gmail.com>,
<kuba@kernel.org>, <edumazet@google.com>, <pabeni@redhat.com>,
<o.rempel@pengutronix.de>, <Woojung.Huh@microchip.com>,
<davem@davemloft.net>
Cc: <linux-kernel@vger.kernel.org>, <netdev@vger.kernel.org>,
<UNGLinuxDriver@microchip.com>, <kernel@pengutronix.de>
Subject: Re: [PATCH net v1 1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump()
Date: Fri, 24 Mar 2023 04:20:46 +0000 [thread overview]
Message-ID: <9136556f659339dafcaa5a648aabb930bc37887d.camel@microchip.com> (raw)
In-Reply-To: <20230322143130.1432106-2-o.rempel@pengutronix.de>
Hi Oleksij,
On Wed, 2023-03-22 at 15:31 +0100, Oleksij Rempel wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
>
> Before this patch, the ksz8_fdb_dump() function had several issues,
> such
> as uninitialized variables and incorrect usage of source port as a
> bit
> mask. These problems caused inaccurate reporting of vid information
> and
> port assignment in the bridge fdb.
>
> Fixes: e587be759e6e ("net: dsa: microchip: update fdb add/del/dump in
> ksz_common")
> Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
> ---
> drivers/net/dsa/microchip/ksz8795.c | 11 +++++------
> 1 file changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/dsa/microchip/ksz8795.c
> b/drivers/net/dsa/microchip/ksz8795.c
> index 003b0ac2854c..3fffd5da8d3b 100644
> --- a/drivers/net/dsa/microchip/ksz8795.c
> +++ b/drivers/net/dsa/microchip/ksz8795.c
> @@ -958,15 +958,14 @@ int ksz8_fdb_dump(struct ksz_device *dev, int
> port,
> u16 entries = 0;
> u8 timestamp = 0;
> u8 fid;
> - u8 member;
> - struct alu_struct alu;
> + u8 src_port;
> + u8 mac[ETH_ALEN];
>
> do {
> - alu.is_static = false;
> - ret = ksz8_r_dyn_mac_table(dev, i, alu.mac, &fid,
> &member,
> + ret = ksz8_r_dyn_mac_table(dev, i, mac, &fid,
> &src_port,
> ×tamp, &entries);
> - if (!ret && (member & BIT(port))) {
> - ret = cb(alu.mac, alu.fid, alu.is_static,
> data);
> + if (!ret && port == src_port) {
Only in KSZ9477 series, it is BIT(port). For the KSZ87xx and KSZ88xx,
it is like logic table. i.e
00 = port 0
01 = port 1
02 = port 2
Cross Verified with the Datasheet.
Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com>
> + ret = cb(mac, fid, false, data);
> if (ret)
> break;
> }
> --
> 2.30.2
>
next prev parent reply other threads:[~2023-03-24 4:20 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-22 14:31 [PATCH net v1 0/6] net: dsa: microchip: ksz8: fixes for stable Oleksij Rempel
2023-03-22 14:31 ` [PATCH net v1 1/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() Oleksij Rempel
2023-03-24 4:20 ` Arun.Ramadoss [this message]
2023-03-22 14:31 ` [PATCH net v1 2/6] net: dsa: microchip: ksz8: fix ksz8_fdb_dump() to extract all 1024 entries Oleksij Rempel
2023-03-23 22:41 ` Jakub Kicinski
2023-03-24 5:35 ` Oleksij Rempel
2023-03-24 16:38 ` Jakub Kicinski
2023-03-24 3:51 ` Arun.Ramadoss
2023-03-22 14:31 ` [PATCH net v1 3/6] net: dsa: microchip: ksz8: fix offset for the timestamp filed Oleksij Rempel
2023-03-24 3:58 ` Arun.Ramadoss
2023-03-22 14:31 ` [PATCH net v1 4/6] net: dsa: microchip: ksz8: ksz8_fdb_dump: avoid extracting ghost entry from empty dynamic MAC table Oleksij Rempel
2023-03-24 4:04 ` Arun.Ramadoss
2023-03-22 14:31 ` [PATCH net v1 5/6] net: dsa: microchip: ksz8863_smi: fix bulk access Oleksij Rempel
2023-03-22 14:31 ` [PATCH net v1 6/6] net: dsa: microchip: ksz8: fix MDF configuration with non-zero VID Oleksij Rempel
2023-03-23 6:00 ` Oleksij Rempel
2023-03-24 4:08 ` Arun.Ramadoss
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=9136556f659339dafcaa5a648aabb930bc37887d.camel@microchip.com \
--to=arun.ramadoss@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=Woojung.Huh@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=f.fainelli@gmail.com \
--cc=kernel@pengutronix.de \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=o.rempel@pengutronix.de \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.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
all inboxes | Powered by JetHome®