From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org
Cc: Andrew Lunn <andrew@lunn.ch>,
Vivien Didelot <vivien.didelot@gmail.com>,
Vladimir Oltean <olteanv@gmail.com>,
Kurt Kanzenbach <kurt@linutronix.de>,
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 1/9] net: switchdev: remove the transaction structure from port object notifiers
Date: Wed, 16 Dec 2020 18:14:05 -0800 [thread overview]
Message-ID: <1644d807-eaea-3fde-0cea-cf0e9210272c@gmail.com> (raw)
In-Reply-To: <20201217015822.826304-2-vladimir.oltean@nxp.com>
On 12/16/2020 5:58 PM, Vladimir Oltean wrote:
> Since the introduction of the switchdev API, port objects 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
> object notifier structures, and converts drivers to not look at this
> member.
>
> Where driver conversion is trivial (like in the case of the Marvell
> Prestera driver, NXP DPAA2 switch, TI CPSW, and Rocker drivers), it is
> done in this patch.
>
> Where driver conversion needs more attention (DSA, Mellanox Spectrum),
> the conversion is left for subsequent patches and here we only fake the
> prepare/commit phases at a lower level, just not in the switchdev
> notifier itself.
>
> Where the code has a natural structure that is best left alone as a
> preparation and a commit phase (as in the case of the Ocelot switch),
> that structure is left in place, just made to not depend upon the
> switchdev transactional model.
>
> Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
--
Florian
next prev parent reply other threads:[~2020-12-17 2:14 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 [this message]
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
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=1644d807-eaea-3fde-0cea-cf0e9210272c@gmail.com \
--to=f.fainelli@gmail.com \
--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=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=kurt@linutronix.de \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.