linux/drivers/net/ethernet
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
..
3com networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
8390 ne2k: Fix Typo in RW-Bugfix 2020-10-31 16:17:02 -07:00
adaptec
aeroflex
agere ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
alacritech
allwinner net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function 2020-12-16 11:37:31 -08:00
alteon
altera
amazon net: ena: introduce ndo_xdp_xmit() function for XDP_REDIRECT 2020-12-09 15:26:40 -08:00
amd net: remove ndo_udp_tunnel_* callbacks 2021-01-07 12:53:29 -08:00
apm
apple
aquantia atlantic: remove architecture depends 2020-12-28 15:04:25 -08:00
arc
atheros net: atheros: simplify the return expression of atl2_phy_setup_autoneg_adv() 2020-12-08 16:22:54 -08:00
aurora
broadcom net: broadcom: share header defining UniMAC registers 2021-01-08 19:17:28 -08:00
brocade net: bna: remove trailing semicolon in macro definition 2020-12-04 17:41:49 -08:00
cadence net: macb: Correct usage of MACB_CAPS_CLK_HW_CHG flag 2021-01-04 13:28:09 -08:00
calxeda
cavium net: remove ndo_udp_tunnel_* callbacks 2021-01-07 12:53:29 -08:00
chelsio Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-08 13:28:00 -08:00
cirrus
cisco net: remove ndo_udp_tunnel_* callbacks 2021-01-07 12:53:29 -08:00
cortina
davicom drivers: net: davicom Add COMPILE_TEST support 2020-11-02 15:52:22 -08:00
dec drivers: net: tulip: Fix set but not used with W=1 2020-11-02 15:50:04 -08:00
dlink
emulex net: remove ndo_udp_tunnel_* callbacks 2021-01-07 12:53:29 -08:00
ezchip
faraday Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-12-11 22:29:38 -08:00
freescale dpaa2-mac: remove a comment regarding pause settings 2021-01-09 16:21:30 -08:00
fujitsu
google gve: Add support for raw addressing in the tx path 2020-12-08 16:06:28 -08:00
hisilicon net: hns3: fix incorrect handling of sctp6 rss tuple 2021-01-05 16:46:41 -08:00
huawei net: hinic: simplify the return hinic_configure_max_qnum() 2020-12-09 17:05:37 -08:00
i825xx
ibm ibmvnic: merge do_change_param_reset into do_reset 2021-01-09 12:34:45 -08:00
intel ice: drop dead code in ice_receive_skb() 2021-01-09 14:24:25 -08:00
marvell net: switchdev: remove the transaction structure from port attributes 2021-01-11 16:00:57 -08:00
mediatek net: mtk_eth: simplify the mediatek code return expression 2020-12-14 17:51:26 -08:00
mellanox net: switchdev: remove the transaction structure from port attributes 2021-01-11 16:00:57 -08:00
micrel net: ks8851: Register MDIO bus and the internal PHY 2021-01-05 17:05:11 -08:00
microchip lan743x: fix rx_napi_poll/interrupt ping-pong 2020-12-16 09:00:09 -08:00
moxa
mscc net: switchdev: remove the transaction structure from port attributes 2021-01-11 16:00:57 -08:00
myricom
natsemi net/sonic: Fix some resource leaks in error handling paths 2021-01-05 15:59:20 -08:00
neterion net: vxget: clean up sparse warnings 2020-12-14 19:18:11 -08:00
netronome net: remove ndo_udp_tunnel_* callbacks 2021-01-07 12:53:29 -08:00
ni net: nixge: fix spelling mistake in Kconfig: "Instuments" -> "Instruments" 2020-12-17 10:54:31 -08:00
nvidia forcedeth: fix excluded_middle.cocci warnings 2020-11-03 17:47:04 -08:00
nxp ethernet: select CONFIG_CRC32 as needed 2020-12-04 14:42:21 -08:00
oki-semi net: pch_gbe: Use 'dma_free_coherent()' to undo 'dma_alloc_coherent()' 2020-11-23 17:01:48 -08:00
packetengines
pasemi net: pasemi: fix error return code in pasemi_mac_open() 2020-12-02 18:03:58 -08:00
pensando ionic: account for vlan tag len in rx buffer len 2020-12-21 17:32:14 -08:00
qlogic Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-08 13:28:00 -08:00
qualcomm net: qualcomm: rmnet: Update rmnet device MTU based on real device 2020-12-10 13:30:26 -08:00
rdc
realtek r8169: deprecate support for RTL_GIGA_MAC_VER_27 2021-01-11 15:20:48 -08:00
renesas ravb: update "undocumented" annotations 2021-01-08 18:38:32 -08:00
rocker net: switchdev: remove the transaction structure from port attributes 2021-01-11 16:00:57 -08:00
samsung
seeq
sfc net: remove ndo_udp_tunnel_* callbacks 2021-01-07 12:53:29 -08:00
sgi
silan
sis
smsc drivers: net: smsc: Add COMPILE_TEST support 2020-11-12 14:49:40 -08:00
socionext Merge https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2020-12-04 07:48:12 -08:00
stmicro Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2021-01-08 13:28:00 -08:00
sun networking changes for the 5.10 merge window 2020-10-15 18:42:13 -07:00
synopsys
tehuti
ti net: switchdev: remove the transaction structure from port attributes 2021-01-11 16:00:57 -08:00
toshiba powerpc/ps3: make system bus's remove and shutdown callbacks return void 2020-12-04 01:01:22 +11:00
tundra
via Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
wiznet
xilinx Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-12-11 22:29:38 -08:00
xircom
xscale net: ixp4xx_eth: Use DEFINE_SPINLOCK() for spinlock 2021-01-05 15:43:41 -08:00
dnet.c
dnet.h
ec_bhf.c
ethoc.c net: ethernet: Fix memleak in ethoc_probe 2020-12-23 12:28:53 -08:00
fealnx.c
jme.c
jme.h
Kconfig
korina.c net: korina: fix return value 2020-12-16 15:01:07 -08:00
lantiq_etop.c
lantiq_xrx200.c
Makefile