linux/drivers/net/ethernet
Jacob Keller df830543d6 ice: refactor unwind cleanup in eswitch mode
The code for supporting eswitch mode and port representors on VFs uses
an unwind based cleanup flow when handling errors.

These flows are used to cleanup and get everything back to the state
prior to attempting to switch from legacy to representor mode or back.

The unwind iterations make sense, but complicate a plan to refactor the
VF array structure. In the future we won't have a clean method of
reversing an iteration of the VFs.

Instead, we can change the cleanup flow to just iterate over all VF
structures and clean up appropriately.

First notice that ice_repr_add_for_all_vfs and ice_repr_rem_from_all_vfs
have an additional step of re-assigning the VC ops. There is no good
reason to do this outside of ice_repr_add and ice_repr_rem. It can
simply be done as the last step of these functions.

Second, make sure ice_repr_rem is safe to call on a VF which does not
have a representor. Check if vf->repr is NULL first and exit early if
so.

Move ice_repr_rem_from_all_vfs above ice_repr_add_for_all_vfs so that we
can call it from the cleanup function.

In ice_eswitch.c, replace the unwind iteration with a call to
ice_eswitch_release_reprs. This will go through all of the VFs and
revert the VF back to the standard model without the eswitch mode.

To make this safe, ensure this function checks whether or not the
represent or has been moved. Rely on the metadata destination in
vf->repr->dst. This must be NULL if the representor has not been moved
to eswitch mode.

Ensure that we always re-assign this value back to NULL after freeing
it, and move the ice_eswitch_release_reprs so that it can be called from
the setup function.

With these changes, eswitch cleanup no longer uses an unwind flow that
is problematic for the planned VF data structure change.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Sandeep Penigalapati <sandeep.penigalapati@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2022-03-03 08:46:47 -08:00
..
3com net: typhoon: include <net/vxlan.h> 2022-02-07 19:53:38 -08:00
8390 ethernet: 8390/etherh: don't write directly to netdev->dev_addr 2022-01-26 15:40:01 +00:00
actions
adaptec
aeroflex
agere et131x: support arbitrary MAX_SKB_FRAGS 2022-02-08 16:51:23 -08:00
alacritech
allwinner net: ethernet: sun4i-emac: Fix an error handling path in emac_probe() 2022-01-15 22:34:52 +00:00
alteon net: alteon: Simplify DMA setting 2022-01-09 16:52:18 -08:00
altera net: ethernet: altera: cleanup comments 2022-02-16 20:33:04 -08:00
amazon net: ena: Do not waste napi skb cache 2022-01-31 21:36:21 -08:00
amd net: amd-xgbe: disable interrupts during pci removal 2022-02-09 12:52:59 +00:00
apm
apple net: apple: bmac: Fix build since dev_addr constification 2022-01-14 11:22:57 +00:00
aquantia net: atlantic: Use the bitmap API instead of hand-writing it 2022-01-24 12:57:01 +00:00
arc
asix spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
atheros atl1c: fix tx timeout after link flap on Mikrotik 10/25G NIC 2022-02-11 14:41:02 -08:00
broadcom Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-24 17:54:25 -08:00
brocade bna: Simplify DMA setting 2022-01-09 16:52:18 -08:00
cadence Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-10 17:29:56 -08:00
calxeda
cavium Revert "net: ethernet: cavium: use div64_u64() instead of do_div()" 2022-02-11 16:54:47 -08:00
chelsio flow_offload: reject offload for all drivers with invalid police parameters 2022-02-28 11:12:20 +00:00
cirrus
cisco Updates for the interrupt subsystem: 2022-01-13 08:53:45 -08:00
cortina net: ethernet: cortina: permit to set mac address in DT 2022-01-26 18:43:50 -08:00
davicom net: dm9051: Make remove() callback a void function 2022-02-28 10:45:02 -08:00
dec net: tulip: remove redundant assignment to variable new_csr6 2022-01-25 07:40:44 -08:00
dlink net: sundance: Replace one-element array with non-array object 2022-02-05 15:30:32 +00:00
emulex Updates for the interrupt subsystem: 2022-01-13 08:53:45 -08:00
engleder
ezchip
faraday drivers/net/ftgmac100: fix DHCP potential failure with systemd 2022-02-23 12:50:19 +00:00
freescale flow_offload: reject offload for all drivers with invalid police parameters 2022-02-28 11:12:20 +00:00
fujitsu
fungible net/fungible: Kconfig, Makefiles, and MAINTAINERS 2022-02-27 10:51:23 +00:00
google gve: enhance no queue page list detection 2022-02-15 18:01:06 -08:00
hisilicon net: hns3: Remove unused inline function hclge_is_reset_pending() 2022-02-16 18:34:48 -08:00
huawei Updates for the interrupt subsystem: 2022-01-13 08:53:45 -08:00
i825xx ethernet: i825xx: don't write directly to netdev->dev_addr 2022-01-26 15:40:01 +00:00
ibm Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-24 17:54:25 -08:00
intel ice: refactor unwind cleanup in eswitch mode 2022-03-03 08:46:47 -08:00
litex net: ethernet: litex: Add the dependency on HAS_IOMEM 2022-02-08 20:43:40 -08:00
marvell flow_offload: reject offload for all drivers with invalid police parameters 2022-02-28 11:12:20 +00:00
mediatek net: ethernet: mtk_star_emac: fix unused variable 2022-01-27 13:47:34 +00:00
mellanox mlxsw: Add support for IFLA_OFFLOAD_XSTATS_L3_STATS 2022-03-03 10:37:23 +00:00
micrel spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
microchip spi: Make remove() return void 2022-02-28 10:43:07 -08:00
microsoft net: mana: Remove unnecessary check of cqe_type in mana_process_rx_cqe() 2022-02-05 15:26:00 +00:00
moxa net: moxa: use GFP_KERNEL 2022-02-11 14:39:08 -08:00
mscc net: mscc: ocelot: accept configuring bridge port flags on the NPI port 2022-03-03 14:15:31 +00:00
myricom myri10ge: Simplify DMA setting 2022-01-09 16:52:18 -08:00
natsemi
neterion net: vxge: Use dma_set_mask_and_coherent() and simplify code 2022-01-03 10:42:58 +00:00
netronome nfp: flower: Remove usage of the deprecated ida_simple_xxx API 2022-03-02 22:05:17 -08:00
ni net: nixge: Use GFP_KERNEL instead of GFP_ATOMIC when possible 2022-02-17 20:03:39 -08:00
nvidia
nxp
oki-semi
packetengines
pasemi
pensando ionic: no transition while stopping 2022-02-28 11:42:45 +00:00
qlogic qed: validate and restrict untrusted VFs vlan promisc mode 2022-03-03 10:26:20 +00:00
qualcomm spi: Make remove() return void 2022-02-28 10:43:07 -08:00
rdc
realtek r8169: factor out redundant RTL8168d PHY config functionality to rtl8168d_1_common() 2022-02-07 12:27:40 +00:00
renesas ravb: Use GFP_KERNEL instead of GFP_ATOMIC when possible 2022-02-21 12:00:46 +00:00
rocker Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-01-09 17:00:17 -08:00
samsung net: use bool values to pass bool param of phy_init_eee() 2022-01-24 17:09:56 -08:00
seeq ethernet: seeq/ether3: don't write directly to netdev->dev_addr 2022-01-26 15:40:01 +00:00
sfc sfc: set affinity hints in local NUMA node only 2022-03-01 17:12:38 -08:00
sgi
silan
sis
smsc ethernet: smc911x: fix indentation in get/set EEPROM 2022-02-01 19:59:03 -08:00
socionext net: netsec: enable pp skb recycling 2022-02-28 11:39:23 +00:00
stmicro net: stmmac: dwmac-qcom-ethqos: Adjust rgmii loopback_en per platform 2022-03-03 10:14:06 +00:00
sun net: ethernet: sun: use time_is_before_jiffies() instead of open coding it 2022-02-28 13:21:31 +00:00
synopsys
tehuti tehuti: Use dma_set_mask_and_coherent() and simplify code 2022-01-02 12:21:16 +00:00
ti net: ti: cpsw: remove guards against !BRIDGE_VLAN_INFO_BRENTRY 2022-02-17 14:17:10 +00:00
toshiba
tundra ethernet: tundra: don't write directly to netdev->dev_addr 2022-01-26 15:40:01 +00:00
vertexcom spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
via
wiznet spi: make remove callback a void function 2022-02-09 13:00:45 +00:00
xilinx Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2022-02-24 17:54:25 -08:00
xircom
xscale
dnet.c
dnet.h
ec_bhf.c
ethoc.c net: ethoc: Use platform_get_irq() to get the interrupt 2021-12-27 12:22:19 +00:00
fealnx.c
jme.c net: ethernet: use time_is_before_eq_jiffies() instead of open coding it 2022-02-28 13:21:31 +00:00
jme.h
Kconfig net/fungible: Kconfig, Makefiles, and MAINTAINERS 2022-02-27 10:51:23 +00:00
korina.c
lantiq_etop.c net: lantiq_etop: remove unnecessary space in cast 2021-12-30 13:20:23 +00:00
lantiq_xrx200.c net: lantiq_xrx200: convert to build_skb 2022-01-05 17:18:04 -08:00
Makefile net/fungible: Kconfig, Makefiles, and MAINTAINERS 2022-02-27 10:51:23 +00:00