From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>, netdev@vger.kernel.org
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
Ansuel Smith <ansuelsmth@gmail.com>,
Tobias Waldekranz <tobias@waldekranz.com>,
DENG Qingfang <dqfext@gmail.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
UNGLinuxDriver@microchip.com, Jiri Pirko <jiri@resnulli.us>,
Ivan Vecera <ivecera@redhat.com>
Subject: Re: [PATCH v4 net-next 06/11] net: dsa: create a dsa_lag structure
Date: Mon, 21 Feb 2022 19:47:37 -0800 [thread overview]
Message-ID: <51cb7b6d-e19f-4251-be19-773d9e9405b4@gmail.com> (raw)
In-Reply-To: <20220221212337.2034956-7-vladimir.oltean@nxp.com>
On 2/21/2022 1:23 PM, Vladimir Oltean wrote:
> The main purpose of this change is to create a data structure for a LAG
> as seen by DSA. This is similar to what we have for bridging - we pass a
> copy of this structure by value to ->port_lag_join and ->port_lag_leave.
> For now we keep the lag_dev, id and a reference count in it. Future
> patches will add a list of FDB entries for the LAG (these also need to
> be refcounted to work properly).
>
> The LAG structure is created using dsa_port_lag_create() and destroyed
> using dsa_port_lag_destroy(), just like we have for bridging.
>
> Because now, the dsa_lag itself is refcounted, we can simplify
> dsa_lag_map() and dsa_lag_unmap(). These functions need to keep a LAG in
> the dst->lags array only as long as at least one port uses it. The
> refcounting logic inside those functions can be removed now - they are
> called only when we should perform the operation.
>
> dsa_lag_dev() is renamed to dsa_lag_by_id() and now returns the dsa_lag
> structure instead of the lag_dev net_device.
>
> dsa_lag_foreach_port() now takes the dsa_lag structure as argument.
>
> dst->lags holds an array of dsa_lag structures.
>
> dsa_lag_map() now also saves the dsa_lag->id value, so that linear
> walking of dst->lags in drivers using dsa_lag_id() is no longer
> necessary. They can just look at lag.id.
>
> dsa_port_lag_id_get() is a helper, similar to dsa_port_bridge_num_get(),
> which can be used by drivers to get the LAG ID assigned by DSA to a
> given port.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
next prev parent reply other threads:[~2022-02-22 3:47 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-21 21:23 [PATCH v4 net-next 00/11] FDB entries on DSA LAG interfaces Vladimir Oltean
2022-02-21 21:23 ` [PATCH v4 net-next 01/11] net: dsa: rename references to "lag" as "lag_dev" Vladimir Oltean
2022-02-22 3:24 ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 02/11] net: dsa: mv88e6xxx: " Vladimir Oltean
2022-02-22 3:25 ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 03/11] net: dsa: qca8k: " Vladimir Oltean
2022-02-22 3:26 ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 04/11] net: dsa: make LAG IDs one-based Vladimir Oltean
2022-02-22 3:43 ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 05/11] net: dsa: mv88e6xxx: use dsa_switch_for_each_port in mv88e6xxx_lag_sync_masks Vladimir Oltean
2022-02-22 3:27 ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 06/11] net: dsa: create a dsa_lag structure Vladimir Oltean
2022-02-22 3:47 ` Florian Fainelli [this message]
2022-02-21 21:23 ` [PATCH v4 net-next 07/11] net: switchdev: remove lag_mod_cb from switchdev_handle_fdb_event_to_device Vladimir Oltean
2022-02-22 3:50 ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 08/11] net: dsa: remove "ds" and "port" from struct dsa_switchdev_event_work Vladimir Oltean
2022-02-22 3:50 ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 09/11] net: dsa: call SWITCHDEV_FDB_OFFLOADED for the orig_dev Vladimir Oltean
2022-02-22 3:51 ` Florian Fainelli
2022-02-21 21:23 ` [PATCH v4 net-next 10/11] net: dsa: support FDB events on offloaded LAG interfaces Vladimir Oltean
2022-02-21 21:23 ` [PATCH v4 net-next 11/11] net: dsa: felix: support FDB entries " 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=51cb7b6d-e19f-4251-be19-773d9e9405b4@gmail.com \
--to=f.fainelli@gmail.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=ansuelsmth@gmail.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=ivecera@redhat.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=tobias@waldekranz.com \
--cc=vivien.didelot@gmail.com \
--cc=vladimir.oltean@nxp.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).