linux/drivers/staging
Vladimir Oltean bae33f2b5a net: switchdev: remove the transaction structure from port attributes
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 91cf8eceff ("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 2e554a7a5d
("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>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-01-11 16:00:57 -08:00
..
android UAPI Changes: 2020-12-18 12:38:28 -08:00
axis-fifo
board
clocking-wizard
comedi staging: comedi: mf6x4: Fix AI end-of-conversion detection 2020-12-09 15:49:13 +01:00
emxx_udc
fbtft
fieldbus
fsl-dpaa2 net: switchdev: remove the transaction structure from port attributes 2021-01-11 16:00:57 -08:00
fwserial
gasket
gdm724x
greybus staging: greybus: Add TODO item about modernizing the pwm code 2020-12-09 15:49:04 +01:00
gs_fpgaboot
hikey9xx
iio
kpc2000
ks7010
media ARM: SoC drivers for v5.11 2020-12-16 16:38:41 -08:00
most staging: most: Fix spelling mistake "tranceiver" -> "transceiver" 2020-12-09 19:45:13 +01:00
mt7621-dma
mt7621-dts staging: mt7621-pinctrl: stop using the deprecated 'pinctrl_add_gpio_range' 2020-12-07 15:10:16 +01:00
mt7621-pci
netlogic
nvec
octeon
octeon-usb
olpc_dcon staging: olpc_dcon: Do not call platform_device_unregister() in dcon_probe() 2020-12-09 19:45:13 +01:00
pi433
qlge staging: qlge: remove duplicate word in comment 2020-12-09 15:49:18 +01:00
ralink-gdma
rtl8188eu
rtl8192e
rtl8192u
rtl8712
rtl8723bs staging: rtl8723bs: remove ELEMENT_ID enum 2020-12-08 09:55:52 +01:00
rts5208
sm750fb
unisys
vc04_services staging: bcm2835: fix vchiq_mmal dependencies 2020-12-07 15:07:24 +01:00
vme
vt6655
vt6656
wfx
wimax Staging / IIO driver patches for 5.11-rc1 2020-12-15 14:18:40 -08:00
wlan-ng
Kconfig Staging / IIO driver patches for 5.11-rc1 2020-12-15 14:18:40 -08:00
Makefile Staging / IIO driver patches for 5.11-rc1 2020-12-15 14:18:40 -08:00