From: Kurt Kanzenbach <kurt@linutronix.de>
To: Vladimir Oltean <vladimir.oltean@nxp.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org
Cc: Florian Fainelli <f.fainelli@gmail.com>,
Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
Hauke Mehrtens <hauke@hauke-m.de>,
Woojung Huh <woojung.huh@microchip.com>,
Microchip Linux Driver Support <UNGLinuxDriver@microchip.com>,
Sean Wang <sean.wang@mediatek.com>,
Landen Chao <Landen.Chao@mediatek.com>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
Alexandre Belloni <alexandre.belloni@bootlin.com>,
Linus Walleij <linus.walleij@linaro.org>,
Vadym Kochan <vkochan@marvell.com>,
Taras Chornyi <tchornyi@marvell.com>,
Jiri Pirko <jiri@nvidia.com>, Ido Schimmel <idosch@nvidia.com>,
Grygorii Strashko <grygorii.strashko@ti.com>,
Ioana Ciornei <ioana.ciornei@nxp.com>,
Ivan Vecera <ivecera@redhat.com>
Subject: Re: [RFC PATCH net-next 3/9] net: switchdev: remove the transaction structure from port attributes
Date: Fri, 18 Dec 2020 09:46:49 +0100 [thread overview]
Message-ID: <87360333ie.fsf@kurt> (raw)
In-Reply-To: <20201217015822.826304-4-vladimir.oltean@nxp.com>
[-- Attachment #1: Type: text/plain, Size: 4214 bytes --]
Hi Vladimir,
On Thu Dec 17 2020, Vladimir Oltean wrote:
> Since the introduction of the switchdev API, port attributes were
> transmitted to drivers for offloading using a two-step transactional
> model, with a prepare phase that was supposed to catch all errors, and a
> commit phase that was supposed to never fail.
>
> Some classes of failures can never be avoided, like hardware access, or
> memory allocation. In the latter case, merely attempting to move the
> memory allocation to the preparation phase makes it impossible to avoid
> memory leaks, since commit 91cf8eceffc1 ("switchdev: Remove unused
> transaction item queue") which has removed the unused mechanism of
> passing on the allocated memory between one phase and another.
>
> It is time we admit that separating the preparation from the commit
> phase is something that is best left for the driver to decide, and not
> something that should be baked into the API, especially since there are
> no switchdev callers that depend on this.
>
> This patch removes the struct switchdev_trans member from switchdev port
> attribute notifier structures, and converts drivers to not look at this
> member.
>
> In part, this patch contains a revert of my previous commit 2e554a7a5d8a
> ("net: dsa: propagate switchdev vlan_filtering prepare phase to
> drivers").
>
> For the most part, the conversion was trivial except for:
> - Rocker's world implementation based on Broadcom OF-DPA had an odd
> implementation of ofdpa_port_attr_bridge_flags_set. The conversion was
> done mechanically, by pasting the implementation twice, then only
> keeping the code that would get executed during prepare phase on top,
> then only keeping the code that gets executed during the commit phase
> on bottom, then simplifying the resulting code until this was obtained.
> - DSA's offloading of STP state, bridge flags, VLAN filtering and
> multicast router could be converted right away. But the ageing time
> could not, so a shim was introduced and this was left for a further
> commit.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
> ---
> drivers/net/dsa/b53/b53_common.c | 6 +-
> drivers/net/dsa/b53/b53_priv.h | 3 +-
> drivers/net/dsa/dsa_loop.c | 3 +-
> drivers/net/dsa/hirschmann/hellcreek.c | 6 +-
> drivers/net/dsa/lantiq_gswip.c | 26 +----
> drivers/net/dsa/microchip/ksz8795.c | 6 +-
> drivers/net/dsa/microchip/ksz9477.c | 6 +-
> drivers/net/dsa/mt7530.c | 6 +-
> drivers/net/dsa/mv88e6xxx/chip.c | 7 +-
> drivers/net/dsa/ocelot/felix.c | 5 +-
> drivers/net/dsa/qca8k.c | 6 +-
> drivers/net/dsa/realtek-smi-core.h | 3 +-
> drivers/net/dsa/rtl8366.c | 11 +--
> drivers/net/dsa/sja1105/sja1105.h | 3 +-
> drivers/net/dsa/sja1105/sja1105_devlink.c | 9 +-
> drivers/net/dsa/sja1105/sja1105_main.c | 17 ++--
> .../marvell/prestera/prestera_switchdev.c | 37 ++-----
> .../mellanox/mlxsw/spectrum_switchdev.c | 63 +++---------
> drivers/net/ethernet/mscc/ocelot.c | 32 ++----
> drivers/net/ethernet/mscc/ocelot_net.c | 13 +--
> drivers/net/ethernet/rocker/rocker.h | 6 +-
> drivers/net/ethernet/rocker/rocker_main.c | 46 +++------
> drivers/net/ethernet/rocker/rocker_ofdpa.c | 23 ++---
> drivers/net/ethernet/ti/cpsw_switchdev.c | 20 +---
> drivers/staging/fsl-dpaa2/ethsw/ethsw.c | 21 +---
> include/net/dsa.h | 3 +-
> include/net/switchdev.h | 7 +-
> include/soc/mscc/ocelot.h | 3 +-
> net/dsa/dsa_priv.h | 18 ++--
> net/dsa/port.c | 97 ++++++++-----------
> net/dsa/slave.c | 17 ++--
> net/dsa/switch.c | 11 +--
> net/switchdev/switchdev.c | 46 +--------
> 33 files changed, 162 insertions(+), 424 deletions(-)
>
Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de>
for the hellcreek part.
Thanks,
Kurt
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
next prev parent reply other threads:[~2020-12-18 8:47 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-17 1:58 [RFC PATCH net-next 0/9] Get rid of the switchdev transactional model Vladimir Oltean
2020-12-17 1:58 ` [RFC PATCH net-next 1/9] net: switchdev: remove the transaction structure from port object notifiers Vladimir Oltean
2020-12-17 2:14 ` Florian Fainelli
2020-12-17 1:58 ` [RFC PATCH net-next 2/9] net: switchdev: delete switchdev_port_obj_add_now Vladimir Oltean
2020-12-17 2:14 ` Florian Fainelli
2020-12-17 1:58 ` [RFC PATCH net-next 3/9] net: switchdev: remove the transaction structure from port attributes Vladimir Oltean
2020-12-18 8:46 ` Kurt Kanzenbach [this message]
2020-12-27 13:26 ` Linus Walleij
2020-12-17 1:58 ` [RFC PATCH net-next 4/9] net: dsa: remove the transactional logic from ageing time notifiers Vladimir Oltean
2020-12-17 2:06 ` Florian Fainelli
2020-12-17 1:58 ` [RFC PATCH net-next 5/9] net: dsa: remove the transactional logic from MDB entries Vladimir Oltean
2020-12-17 2:08 ` Florian Fainelli
2020-12-17 11:03 ` Vladimir Oltean
2020-12-17 1:58 ` [RFC PATCH net-next 6/9] net: dsa: remove the transactional logic from VLAN objects Vladimir Oltean
2020-12-17 2:11 ` Florian Fainelli
2020-12-17 11:04 ` Vladimir Oltean
2020-12-17 11:43 ` Vladimir Oltean
2020-12-18 8:49 ` Kurt Kanzenbach
2020-12-27 13:30 ` Linus Walleij
2020-12-17 1:58 ` [RFC PATCH net-next 7/9] net: dsa: remove obsolete comment about switchdev transactions Vladimir Oltean
2020-12-17 2:11 ` Florian Fainelli
2020-12-17 1:58 ` [RFC PATCH net-next 8/9] mlxsw: spectrum_switchdev: remove transactional logic for VLAN objects Vladimir Oltean
2020-12-17 1:58 ` [RFC PATCH net-next 9/9] net: switchdev: delete the transaction object Vladimir Oltean
2020-12-17 2:11 ` Florian Fainelli
2020-12-27 13:32 ` [RFC PATCH net-next 0/9] Get rid of the switchdev transactional model Linus Walleij
2020-12-28 9:59 ` Jiri Pirko
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=87360333ie.fsf@kurt \
--to=kurt@linutronix.de \
--cc=Landen.Chao@mediatek.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=grygorii.strashko@ti.com \
--cc=hauke@hauke-m.de \
--cc=idosch@nvidia.com \
--cc=ioana.ciornei@nxp.com \
--cc=ivecera@redhat.com \
--cc=jiri@nvidia.com \
--cc=kuba@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=sean.wang@mediatek.com \
--cc=tchornyi@marvell.com \
--cc=vivien.didelot@gmail.com \
--cc=vkochan@marvell.com \
--cc=vladimir.oltean@nxp.com \
--cc=woojung.huh@microchip.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).