linux/drivers
Jacob Keller 48d40025b5 ice: refactor devlink_port to be per-VSI
Currently, the devlink_port structure is stored within the ice_pf. This
made sense because we create a single devlink_port for each PF. This
setup does not mesh with the abstractions in the driver very well, and
led to a flow where we accidentally call devlink_port_unregister twice
during error cleanup.

In particular, if devlink_port_register or devlink_port_unregister are
called twice, this leads to a kernel panic. This appears to occur during
some possible flows while cleaning up from a failure during driver
probe.

If register_netdev fails, then we will call devlink_port_unregister in
ice_cfg_netdev as it cleans up. Later, we again call
devlink_port_unregister since we assume that we must cleanup the port
that is associated with the PF structure.

This occurs because we cleanup the devlink_port for the main PF even
though it was not allocated. We allocated the port within a per-VSI
function for managing the main netdev, but did not release the port when
cleaning up that VSI, the allocation and destruction are not aligned.

Instead of attempting to manage the devlink_port as part of the PF
structure, manage it as part of the PF VSI. Doing this has advantages,
as we can match the de-allocation of the devlink_port with the
unregister_netdev associated with the main PF VSI.

Moving the port to the VSI is preferable as it paves the way for
handling devlink ports allocated for other purposes such as SR-IOV VFs.

Since we're changing up how we allocate the devlink_port, also change
the indexing. Originally, we indexed the port using the PF id number.
This came from an old goal of sharing a devlink for each physical
function. Managing devlink instances across multiple function drivers is
not workable. Instead, lets set the port number to the logical port
number returned by firmware and set the index using the VSI index
(sometimes referred to as VSI handle).

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2020-10-09 13:14:19 -07:00
..
accessibility
acpi ACPI: processor: Fix build for ARCH_APICTIMER_STOPS_ON_C3 unset 2020-09-23 13:50:12 +02:00
amba
android
ata
atm atm: atmtcp: Constify atmtcp_v_dev_ops 2020-09-28 16:03:30 -07:00
auxdisplay
base mm: don't rely on system state to detect hot-plug operations 2020-09-26 10:33:57 -07:00
bcma bcma: use semicolons rather than commas to separate statements 2020-10-01 16:23:50 +03:00
block Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
bluetooth Bluetooth: btusb: Add Qualcomm Bluetooth SoC WCN6855 support 2020-09-27 23:44:50 +02:00
bus
cdrom
char
clk clk: socfpga: stratix10: fix the divider for the emac_ptp_free_clk 2020-09-22 12:54:41 -07:00
clocksource clocksource: clint: Export clint_time_val for modules 2020-09-29 23:55:27 -07:00
connector connector: simplify the return expression of cn_add_callback() 2020-09-21 13:48:29 -07:00
counter
cpufreq cpufreq: intel_pstate: Fix missing return statement 2020-09-30 17:37:23 +02:00
cpuidle cpuidle: Drop misleading comments about RCU usage 2020-09-22 19:32:03 +02:00
crypto
dax
dca
devfreq PM / devfreq: tegra30: Disable clock on error in probe 2020-09-23 13:35:58 +09:00
dio
dma dmaengine: dmatest: Prevent to run on misconfigured channel 2020-09-22 20:18:05 +05:30
dma-buf
edac
eisa
extcon
firewire
firmware
fpga
fsi
gnss
gpio Some late GPIO fixes for the v5.9 series: 2020-10-02 09:51:42 -07:00
gpu drm/nouveau/mem: guard against NULL pointer access in mem_del 2020-10-07 15:33:09 +10:00
greybus
hid
hsi
hv
hwmon
hwspinlock
hwtracing
i2c i2c: npcm7xx: Clear LAST bit after a failed transaction. 2020-09-27 20:05:27 +02:00
i3c
ide
idle
iio iio: adc: qcom-spmi-adc5: fix driver name 2020-09-22 13:33:19 +01:00
infiniband Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 11:27:14 -07:00
input Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input 2020-10-03 11:37:23 -07:00
interconnect
iommu iommu/vt-d: Fix lockdep splat in iommu_flush_dev_iotlb() 2020-10-01 14:54:17 +02:00
ipack
irqchip
isdn
leds
lightnvm
macintosh
mailbox
mcb
md dm: fix comment in dm_process_bio() 2020-09-21 19:49:15 -04:00
media media fixes for v5.9-rc7 2020-09-24 09:05:04 -07:00
memory
memstick memstick: Skip allocating card when removing host 2020-09-28 12:16:13 +02:00
message
mfd
misc
mmc mmc: sdhci: Workaround broken command queuing on Intel GLK based IRBIS models 2020-09-28 12:16:47 +02:00
most
mtd
mux
net ice: refactor devlink_port to be per-VSI 2020-10-09 13:14:19 -07:00
nfc
ntb
nubus
nvdimm
nvme Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 11:27:14 -07:00
nvmem
of of: add of_mdio_find_device() api 2020-09-24 19:49:36 -07:00
opp
oprofile
parisc
parport
pci pci-v5.9-fixes-2 2020-10-02 14:48:25 -07:00
pcmcia
perf
phy phy: Second round of fixes for 5.9 2020-09-29 17:21:54 +02:00
pinctrl pinctrl: mediatek: check mtk_is_virt_gpio input parameter 2020-10-01 09:51:36 +02:00
platform platform-drivers-x86 for v5.9-3 2020-10-06 12:00:52 -07:00
pnp
power
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator regulator: Fix for v5.9 2020-09-25 15:16:01 -07:00
remoteproc
reset
rpmsg
rtc
s390 Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
sbus
scsi Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 11:27:14 -07:00
sfi
sh
siox
slimbus
soc
soundwire
spi spi: Fixes for v5.9 2020-09-25 15:21:54 -07:00
spmi
ssb
staging
target Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2020-10-05 18:40:01 -07:00
tc
tee
thermal genetlink: move to smaller ops wherever possible 2020-10-02 19:11:11 -07:00
thunderbolt
tty
uio
usb usbcore/driver: Accommodate usbip 2020-09-25 16:53:02 +02:00
vdpa vdpa/mlx5: Fix dependency on MLX5_CORE 2020-10-08 16:02:00 -04:00
vfio
vhost vhost-vdpa: fix page pinning leakage in error path 2020-10-04 03:47:02 -04:00
video drm-misc-fixes for v5.9: 2020-10-06 12:38:28 +10:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen xen/events: don't use chip_data for legacy IRQs 2020-10-01 14:45:26 +02:00
zorro
Kconfig
Makefile