From: Vladimir Oltean <olteanv@gmail.com>
To: Prasanna Vengateshan <prasanna.vengateshan@microchip.com>
Cc: andrew@lunn.ch, netdev@vger.kernel.org, robh+dt@kernel.org,
UNGLinuxDriver@microchip.com, Woojung.Huh@microchip.com,
hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net,
kuba@kernel.org, linux-kernel@vger.kernel.org,
vivien.didelot@gmail.com, f.fainelli@gmail.com,
devicetree@vger.kernel.org
Subject: Re: [PATCH v4 net-next 09/10] net: dsa: microchip: add support for fdb and mdb management
Date: Thu, 7 Oct 2021 23:29:55 +0300 [thread overview]
Message-ID: <20211007202955.vwasddyxouqy5ccw@skbuf> (raw)
In-Reply-To: <20211007151200.748944-10-prasanna.vengateshan@microchip.com>
On Thu, Oct 07, 2021 at 08:41:59PM +0530, Prasanna Vengateshan wrote:
> Support for fdb_add, mdb_add, fdb_del, mdb_del and
> fdb_dump operations. ALU1 and ALU2 are used for fdb operations.
>
> fdb_add: find any existing entries and update the port map.
> if ALU1 write is failed and attempt to write ALU2.
> If ALU2 is also failed then exit. Clear WRITE_FAIL for both ALU1
> & ALU2.
>
> fdb_del: find the matching entry and clear the respective port
> in the port map by writing the ALU tables
>
> fdb_dump: read and dump 2 ALUs upto last entry. ALU_START bit is
> used to find the last entry. If the read is timed out, then pass
> the error message.
>
> mdb_add: Find the empty slot in ALU and update the port map &
> mac address by writing the ALU
>
> mdb_del: find the matching entry and delete the respective port
> in port map by writing the ALU
>
> For MAC address, could not use upper_32_bits() & lower_32_bits()
> as per Vladimir proposal since it gets accessed in terms of 16bits.
> I tried to have common API to get 16bits based on index but shifting
> seems to be straight-forward.
>
> Signed-off-by: Prasanna Vengateshan <prasanna.vengateshan@microchip.com>
> ---
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
> +static int lan937x_port_fdb_dump(struct dsa_switch *ds, int port,
> + dsa_fdb_dump_cb_t *cb, void *data)
> +{
> + if (alu.port_forward & BIT(port)) {
> + ret = cb(alu.mac, alu.fid, alu.is_static, data);
A bit strange that you report the FID and not the VID here.
> + if (ret)
> + goto exit;
> + }
> + } while (lan937x_data & ALU_START);
> +
> +exit:
> + /* stop ALU search & continue to next ALU if available */
> + ret = ksz_write32(dev, REG_SW_ALU_CTRL(i), 0);
> + }
> +
> + mutex_unlock(&dev->alu_mutex);
> +
> + return ret;
> +}
next prev parent reply other threads:[~2021-10-07 20:30 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-07 15:11 [PATCH v4 net-next 00/10] net: dsa: microchip: DSA driver support for LAN937x switch Prasanna Vengateshan
2021-10-07 15:11 ` [PATCH v4 net-next 01/10] dt-bindings: net: dsa: dt bindings for microchip lan937x Prasanna Vengateshan
2021-10-07 21:41 ` Andrew Lunn
2021-10-18 18:00 ` Rob Herring
2021-10-07 15:11 ` [PATCH v4 net-next 02/10] net: dsa: move mib->cnt_ptr reset code to ksz_common.c Prasanna Vengateshan
2021-10-07 15:11 ` [PATCH v4 net-next 03/10] net: phy: Add support for LAN937x T1 phy driver Prasanna Vengateshan
2021-10-07 15:11 ` [PATCH v4 net-next 04/10] net: dsa: tag_ksz: add tag handling for Microchip LAN937x Prasanna Vengateshan
2021-10-07 19:46 ` Vladimir Oltean
2021-10-07 15:11 ` [PATCH v4 net-next 05/10] net: dsa: microchip: add DSA support for microchip lan937x Prasanna Vengateshan
2021-10-07 20:00 ` Vladimir Oltean
2021-10-08 18:17 ` Prasanna Vengateshan
2021-10-07 21:58 ` Andrew Lunn
2021-10-07 15:11 ` [PATCH v4 net-next 06/10] net: dsa: microchip: add support for phylink management Prasanna Vengateshan
2021-10-07 15:11 ` [PATCH v4 net-next 07/10] net: dsa: microchip: add support for ethtool port counters Prasanna Vengateshan
2021-10-07 15:11 ` [PATCH v4 net-next 08/10] net: dsa: microchip: add support for port mirror operations Prasanna Vengateshan
2021-10-07 20:32 ` Vladimir Oltean
2021-10-07 15:11 ` [PATCH v4 net-next 09/10] net: dsa: microchip: add support for fdb and mdb management Prasanna Vengateshan
2021-10-07 20:29 ` Vladimir Oltean [this message]
2021-10-07 15:12 ` [PATCH v4 net-next 10/10] net: dsa: microchip: add support for vlan operations Prasanna Vengateshan
2021-10-07 20:17 ` Vladimir Oltean
2021-10-11 17:43 ` Prasanna Vengateshan
2021-10-14 14:19 ` Vladimir Oltean
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=20211007202955.vwasddyxouqy5ccw@skbuf \
--to=olteanv@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=Woojung.Huh@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=f.fainelli@gmail.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=netdev@vger.kernel.org \
--cc=prasanna.vengateshan@microchip.com \
--cc=robh+dt@kernel.org \
--cc=vivien.didelot@gmail.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).