All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: Vladimir Oltean <olteanv@gmail.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>,
	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>, Petr Machata <petrm@nvidia.com>
Subject: Re: [PATCH v4 net-next 05/11] net: switchdev: remove the transaction structure from port attributes
Date: Fri, 8 Jan 2021 17:53:58 -0800	[thread overview]
Message-ID: <a8943b5a-63d4-e4d4-a08c-f4b2fd955ffc@gmail.com> (raw)
In-Reply-To: <20210109000156.1246735-6-olteanv@gmail.com>



On 1/8/2021 4:01 PM, Vladimir Oltean wrote:
> From: Vladimir Oltean <vladimir.oltean@nxp.com>
> 
> 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>
> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Acked-by: Jiri Pirko <jiri@nvidia.com>
> Reviewed-by: Kurt Kanzenbach <kurt@linutronix.de> # hellcreek
> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> # RTL8366RB
> Reviewed-by: Ido Schimmel <idosch@nvidia.com>

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
-- 
Florian

  reply	other threads:[~2021-01-09  1:54 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-09  0:01 [PATCH v4 net-next 00/11] Get rid of the switchdev transactional model Vladimir Oltean
2021-01-09  0:01 ` [PATCH v4 net-next 01/11] net: switchdev: remove vid_begin -> vid_end range from VLAN objects Vladimir Oltean
2021-01-09  4:10   ` Florian Fainelli
2021-01-09  7:39   ` Kurt Kanzenbach
2021-01-15 19:35   ` Grygorii Strashko
2021-01-09  0:01 ` [PATCH v4 net-next 02/11] net: dsa: mv88e6xxx: deny vid 0 on the CPU port and DSA links too Vladimir Oltean
2021-01-09  4:05   ` Florian Fainelli
2021-01-09  0:01 ` [PATCH v4 net-next 03/11] net: switchdev: remove the transaction structure from port object notifiers Vladimir Oltean
2021-01-09  0:01 ` [PATCH v4 net-next 04/11] net: switchdev: delete switchdev_port_obj_add_now Vladimir Oltean
2021-01-09  0:01 ` [PATCH v4 net-next 05/11] net: switchdev: remove the transaction structure from port attributes Vladimir Oltean
2021-01-09  1:53   ` Florian Fainelli [this message]
2021-01-09  0:01 ` [PATCH v4 net-next 06/11] net: dsa: remove the transactional logic from ageing time notifiers Vladimir Oltean
2021-01-09  0:01 ` [PATCH v4 net-next 07/11] net: dsa: remove the transactional logic from MDB entries Vladimir Oltean
2021-01-09  0:01 ` [PATCH v4 net-next 08/11] net: dsa: remove the transactional logic from VLAN objects Vladimir Oltean
2021-01-09  0:01 ` [PATCH v4 net-next 09/11] net: dsa: remove obsolete comments about switchdev transactions Vladimir Oltean
2021-01-09  0:01 ` [PATCH v4 net-next 10/11] mlxsw: spectrum_switchdev: remove transactional logic for VLAN objects Vladimir Oltean
2021-01-09  1:48   ` Florian Fainelli
2021-01-09  0:01 ` [PATCH v4 net-next 11/11] net: switchdev: delete the transaction object Vladimir Oltean
2021-01-12  0:20 ` [PATCH v4 net-next 00/11] Get rid of the switchdev transactional model patchwork-bot+netdevbpf

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=a8943b5a-63d4-e4d4-a08c-f4b2fd955ffc@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=petrm@nvidia.com \
    --cc=sean.wang@mediatek.com \
    --cc=tchornyi@marvell.com \
    --cc=vivien.didelot@gmail.com \
    --cc=vkochan@marvell.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.