]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net/liquidio: drop cached VF pci_dev LUT
authorYuho Choi <dbgh9129@gmail.com>
Wed, 1 Jul 2026 04:08:47 +0000 (00:08 -0400)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 7 Jul 2026 09:03:35 +0000 (11:03 +0200)
commit5c0e3ba4f500fd4314ceb42f07f16bc445156431
tree7b1c68c3a31c8980a095f588e588d461be376126
parentd9d6d67f4c0877fde783c9d5beee013bcf1b1e85
net/liquidio: drop cached VF pci_dev LUT

The PF SR-IOV enable path caches VF pci_dev pointers in
dpiring_to_vfpcidev_lut[] by iterating with pci_get_device(). Those
entries do not own a reference, because the iterator drops the previous
device reference on each step. The cached pointer is then dereferenced
later when handling OCTEON_VF_FLR_REQUEST.

Replace the cached VF mapping with runtime lookup on the mailbox DPI
ring: derive the VF index from q_no, resolve the VF via exported PCI
IOV helpers, validate it with the PF pointer and VF ID, then issue
pcie_flr() and drop the reference with pci_dev_put(). Remove the
unused VF lookup table initialization and cleanup.

Fixes: ca6139ffc67ee ("liquidio CN23XX: sysfs VF config support")
Fixes: 8c978d059224 ("liquidio CN23XX: Mailbox support")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Link: https://patch.msgid.link/20260701040847.1897845-1-dbgh9129@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/cavium/liquidio/lio_main.c
drivers/net/ethernet/cavium/liquidio/octeon_device.h
drivers/net/ethernet/cavium/liquidio/octeon_mailbox.c