OpenCloudOS-Kernel/drivers/net
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
..
appletalk docs updates for v5.10-rc1 2020-10-16 15:02:21 -07:00
arcnet
bonding Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-12-11 22:29:38 -08:00
caif
can Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-08 13:28:00 -08:00
dsa net: dsa: mv88e6xxx: deny vid 0 on the CPU port and DSA links too 2021-01-11 16:00:56 -08:00
ethernet net: switchdev: remove the transaction structure from port object notifiers 2021-01-11 16:00:56 -08:00
fddi net: fddi: skfp: ess: Remove defined but unused variable 'ID_sccs' 2020-11-03 16:35:15 -08:00
fjes
hamradio net: driver: hamradio: Fix potential unterminated string 2020-11-02 16:10:24 -08:00
hippi
hyperv Networking fixes for 5.11-rc1. 2020-12-17 13:45:24 -08:00
ieee802154 net: ieee802154: ca8210: Fix incorrectly named function param doc 2020-11-03 16:37:09 -08:00
ipa net: ipa: support COMPILE_TEST 2021-01-09 13:51:37 -08:00
ipvlan net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
mdio
netdevsim net: remove ndo_udp_tunnel_* callbacks 2021-01-07 12:53:29 -08:00
pcs net: pcs-xpcs: depend on MDIO_BUS instead of selecting it 2020-10-16 16:54:11 -07:00
phy net: phy: replace mutex_is_locked with lockdep_assert_held in phylib 2021-01-07 14:53:07 -08:00
plip
ppp ppp: clean up endianness conversions 2021-01-08 19:26:23 -08:00
slip
team net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
usb Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-08 13:28:00 -08:00
vmxnet3
wan Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-08 13:28:00 -08:00
wireguard selinux/stable-5.11 PR 20201214 2020-12-16 11:01:04 -08:00
wireless wil6210: select CONFIG_CRC32 2021-01-05 15:50:36 -08:00
xen-netback net: group skb_shinfo zerocopy related bits together. 2021-01-07 16:08:37 -08:00
Kconfig net: fix spelling mistake "wil" -> "will" in Kconfig 2020-12-05 15:17:19 -08:00
LICENSE.SRC
Makefile net: Add mhi-net driver 2020-11-05 16:54:01 -08:00
Space.c
bareudp.c net: bareudp: add missing error handling for bareudp_link_config() 2021-01-06 15:56:44 -08:00
dummy.c net: bonding, dummy, ifb, team: advertise NETIF_F_GSO_SOFTWARE 2020-11-03 16:53:55 -08:00
eql.c
geneve.c udp_tunnel: remove REGISTER/UNREGISTER handling from tunnel drivers 2021-01-07 12:53:29 -08:00
gtp.c gtp: switch to dev_get_tstats64 2020-11-09 17:50:28 -08:00
ifb.c net: bonding, dummy, ifb, team: advertise NETIF_F_GSO_SOFTWARE 2020-11-03 16:53:55 -08:00
loopback.c
macsec.c net: macsec: Add missing documentation for 'gro_cells' 2020-11-03 16:38:28 -08:00
macvlan.c macvlan: remove redundant null check on data 2021-01-05 16:52:02 -08:00
macvtap.c
mdio.c
mhi_net.c net: mhi: Add raw IP mode support 2021-01-05 15:37:29 -08:00
mii.c net: mii: Report advertised link capabilities when autonegotiation is off 2020-10-29 19:00:46 -07:00
net_failover.c net: net_failover: Correct parameter name 'standby_dev' 2020-11-03 16:40:23 -08:00
netconsole.c net: netconsole: Add description for 'netconsole_target's extended attribute 2020-11-03 16:40:09 -08:00
nlmon.c net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
ntb_netdev.c
rionet.c
sb1000.c
sungem_phy.c
tap.c tap/tun: add skb_zcopy_init() helper for initialization. 2021-01-07 16:08:37 -08:00
thunderbolt.c USB / Thunderbolt patches for 5.11-rc1 2020-12-15 13:54:56 -08:00
tun.c tap/tun: add skb_zcopy_init() helper for initialization. 2021-01-07 16:08:37 -08:00
veth.c Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2020-12-04 07:48:12 -08:00
virtio_net.c Networking fixes for 5.11-rc3, including fixes from netfilter, wireless 2021-01-05 12:38:56 -08:00
vrf.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-12-11 22:29:38 -08:00
vsockmon.c net: don't include ethtool.h from netdevice.h 2020-11-23 17:27:04 -08:00
vxlan.c udp_tunnel: remove REGISTER/UNREGISTER handling from tunnel drivers 2021-01-07 12:53:29 -08:00
xen-netfront.c xsk: Propagate napi_id to XDP socket Rx path 2020-12-01 00:09:25 +01:00