linux-kernelorg-stable/drivers
Vladimir Oltean ffb68fc58e net: switchdev: remove the transaction structure from port object notifiers
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 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
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>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Jiri Pirko <jiri@nvidia.com>
Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2021-01-11 16:00:56 -08:00
..
accessibility
acpi libnvdimm for 5.11 2020-12-24 12:18:11 -08:00
amba
android
ata
atm atm: idt77252: call pci_disable_device() on error path 2020-12-21 17:34:09 -08:00
auxdisplay
base regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init() 2021-01-05 14:34:41 +00:00
bcma
block block-5.11-2020-12-23 2020-12-24 12:28:35 -08:00
bluetooth
bus bus: fsl-mc: return -EPROBE_DEFER when a device is not yet discovered 2021-01-09 16:21:30 -08:00
cdrom
char UAPI Changes: 2020-12-18 12:38:28 -08:00
clk The core framework got some nice improvements this time around. We gained the 2020-12-21 10:39:37 -08:00
clocksource
connector
counter
cpufreq cpufreq: intel_pstate: Fix fast-switch fallback path 2020-12-30 18:22:17 +01:00
cpuidle
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2020-12-27 09:14:32 -08:00
dax libnvdimm for 5.11 2020-12-24 12:18:11 -08:00
dca
devfreq
dio
dma dmaengine updates for v5.11-rc1 2020-12-17 12:52:23 -08:00
dma-buf drm fixes for 5.11-rc1 2020-12-24 12:14:29 -08:00
edac
eisa
extcon
firewire
firmware EFI updates collected by Ard Biesheuvel: 2020-12-24 12:40:07 -08:00
fpga
fsi
gnss
gpio This is the bulk of the GPIO changes for the v5.11 kernel cycle: 2020-12-17 18:07:20 -08:00
gpu drm/amd/display: avoid uninitialized variable warning 2020-12-25 15:41:13 -08:00
greybus
hid
hsi
hv
hwmon hwmon: (k10temp) Remove support for displaying voltage and current on Zen CPUs 2020-12-22 08:18:36 -08:00
hwspinlock
hwtracing
i2c
i3c i3c/master/mipi-i3c-hci: quiet maybe-unused variable warning 2020-12-17 10:31:30 +01:00
ide SCSI fixes on 20210101 2021-01-01 12:58:07 -08:00
idle intel_idle: add SnowRidge C-state table 2020-12-30 18:25:34 +01:00
iio
infiniband
input
interconnect
iommu
ipack
irqchip ARM: 2020-12-20 10:44:05 -08:00
isdn misdn: dsp: select CONFIG_BITREVERSE 2021-01-05 15:50:36 -08:00
leds
lightnvm
macintosh
mailbox
mcb
md Revert WQ_SYSFS change that broke reencryption (and all other 2020-12-28 13:32:16 -08:00
media
memory
memstick
message
mfd mfd: ab8500-debugfs: Remove extraneous seq_putc 2020-12-26 09:19:49 -08:00
misc powerpc updates for 5.11 2020-12-17 13:34:25 -08:00
mmc
most
mtd This pull request contains changes for JFFS2, UBI and UBIFS: 2020-12-17 17:46:34 -08:00
mux
net net: switchdev: remove the transaction structure from port object notifiers 2021-01-11 16:00:56 -08:00
nfc
ntb Big fix for IDT NTB and Intel NTB LTR management support 2020-12-27 09:22:55 -08:00
nubus
nvdimm
nvme
nvmem
of
opp opp: Call the missing clk_put() on error 2020-12-28 10:56:22 +05:30
oprofile
parisc
parport
pci pci-v5.11-fixes-1 2020-12-25 20:17:40 -08:00
pcmcia Merge branch 'pcmcia-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux 2020-12-19 12:50:10 -08:00
perf
phy
pinctrl A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
platform chrome platform changes for 5.11 2020-12-23 15:06:22 -08:00
pnp
power
powercap
pps
ps3
ptp ptp: ptp_ines: prevent build when HAS_IOMEM is not set 2021-01-06 16:17:23 -08:00
pwm pwm: Changes for v5.11-rc1 2020-12-19 11:51:32 -08:00
rapidio
ras
regulator Merge qcom driver fix into regulator-5.11 2021-01-04 16:23:20 +00:00
remoteproc
reset
rpmsg
rtc RTC for 5.11 2020-12-20 10:12:06 -08:00
s390 s390/qeth: fix L2 header access in qeth_l3_osa_features_check() 2021-01-07 18:54:06 -08:00
sbus
scsi SCSI fixes on 20210101 2021-01-01 12:58:07 -08:00
sfi
sh
siox
slimbus
soc OpenRISC updates for 5.11 2020-12-17 13:41:27 -08:00
soundwire
spi spi: fix the divide by 0 error when calculating xfer waiting time 2021-01-04 14:24:58 +00:00
spmi
ssb
staging net: switchdev: remove the transaction structure from port object notifiers 2021-01-11 16:00:56 -08:00
target
tc
tee
thermal - Add Alder Lake support ACPI ids (Srinivas Pandruvada) 2020-12-18 12:19:37 -08:00
thunderbolt
tty Revert "init/console: Use ttynull as a fallback when there is no console" 2021-01-08 11:02:18 -08:00
uio
usb powerpc updates for 5.11 2020-12-17 13:34:25 -08:00
vdpa virtio,vdpa: features, cleanups, fixes 2020-12-24 12:06:46 -08:00
vfio ARM: 2020-12-20 10:44:05 -08:00
vhost Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-08 13:28:00 -08:00
video UAPI Changes: 2020-12-18 12:38:28 -08:00
virt
virtio virtio,vdpa: features, cleanups, fixes 2020-12-24 12:06:46 -08:00
visorbus
vlynq
vme
w1
watchdog linux-watchdog 5.11-rc1 tag 2020-12-23 15:01:49 -08:00
xen A treewide cleanup of interrupt descriptor (ab)use with all sorts of racy 2020-12-24 13:50:23 -08:00
zorro
Kconfig
Makefile