linux-stable/drivers
Sukadev Bhattiprolu bbd809305b ibmvnic: Reuse tx pools when possible
Rather than releasing the tx pools on every close and reallocating
them on open, reuse the tx pools unless the pool parameters (number
of pools, size of each pool or size of each buffer in a pool) have
changed.

If the pool parameters changed, then release the old pools (if
any) and allocate new ones.

Specifically release tx pools, if:
	- adapter is removed,
	- pool parameters change during reset,
	- we encounter an error when opening the adapter in response
	  to a user request (in ibmvnic_open()).

and don't release them:
	- in __ibmvnic_close() or
	- on errors in __ibmvnic_open()

in the hope that we can reuse them during this or next reset.

With these changes reset_tx_pools() can be dropped because its
optimization is now included in init_tx_pools() itself.

cleanup_tx_pools() releases all the skbs associated with the pool and
is called from ibmvnic_cleanup(), which is called on every reset. Since
we want to reuse skbs across resets, move cleanup_tx_pools() out of
ibmvnic_cleanup() and call it only when user closes the adapter.

Add two new adapter fields, ->prev_mtu, ->prev_tx_pool_size to track the
previous values and use them to decide whether to reuse or realloc the
pools.

Reviewed-by: Rick Lindsley <ricklind@linux.vnet.ibm.com>
Reviewed-by: Dany Madden <drt@linux.ibm.com>
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2021-09-15 11:12:24 +01:00
..
accessibility
acpi Merge branch 'akpm' (patches from Andrew) 2021-09-03 10:08:28 -07:00
amba
android
ata libata: Add ATA_HORKAGE_NO_NCQ_ON_ATI for Samsung 860 and 870 SSD. 2021-09-03 08:06:02 -06:00
atm
auxdisplay
base Merge branch 'stable/for-linus-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2021-09-03 10:34:44 -07:00
bcma
block block-5.15-2021-09-05 2021-09-06 10:06:26 -07:00
bluetooth
bus
cdrom
char parisc architecture updates for kernel 5.15: 2021-09-02 13:16:00 -07:00
clk - Core Frameworks 2021-09-07 12:38:59 -07:00
clocksource - converted Pistachio platform to use MIPS generic kernel 2021-09-03 11:11:54 -07:00
comedi
connector
counter
cpufreq powerpc updates for 5.15 2021-09-03 11:22:50 -07:00
cpuidle - Core Frameworks 2021-09-07 12:38:59 -07:00
crypto
cxl
dax
dca
devfreq
dio
dma
dma-buf
edac
eisa
extcon
firewire
firmware Merge branch 'dmi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging 2021-09-07 13:08:08 -07:00
fpga
fsi
gnss
gpio gpio updates for v5.15 2021-09-07 12:27:27 -07:00
gpu Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
greybus
hid Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid 2021-09-02 14:30:46 -07:00
hsi
hv hyperv-next for 5.15 2021-09-01 18:25:20 -07:00
hwmon
hwspinlock
hwtracing
i2c platform-drivers-x86 for v5.15-1 2021-09-02 13:49:39 -07:00
i3c
idle
iio
infiniband SCSI misc on 20210902 2021-09-02 15:09:46 -07:00
input parisc architecture updates for kernel 5.15: 2021-09-02 13:16:00 -07:00
interconnect
iommu IOMMU Updates for Linux v5.15 2021-09-03 10:44:35 -07:00
ipack
irqchip
isdn Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
leds
macintosh Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
mailbox
mcb
md integrity-v5.15 2021-09-02 12:51:41 -07:00
media
memory
memstick
message
mfd - Core Frameworks 2021-09-07 12:38:59 -07:00
misc platform-drivers-x86 for v5.15-1 2021-09-02 13:49:39 -07:00
mmc Merge branch 'akpm' (patches from Andrew) 2021-09-03 10:08:28 -07:00
most
mtd MTD changes: 2021-09-05 10:50:12 -07:00
mux
net ibmvnic: Reuse tx pools when possible 2021-09-15 11:12:24 +01:00
nfc nfc: mrvl: drop unneeded memory allocation fail messages 2021-09-13 14:38:32 +01:00
ntb Bug fixes and clean-ups for Linux v5.15 2021-09-07 13:05:02 -07:00
nubus
nvdimm
nvme
nvmem
of Merge branch 'stable/for-linus-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2021-09-03 10:34:44 -07:00
opp
parisc parisc architecture updates for kernel 5.15: 2021-09-02 13:16:00 -07:00
parport parisc architecture updates for kernel 5.15: 2021-09-02 13:16:00 -07:00
pci Merge branch 'stable/for-linus-5.15' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb 2021-09-03 10:34:44 -07:00
pcmcia
perf
phy - converted Pistachio platform to use MIPS generic kernel 2021-09-03 11:11:54 -07:00
pinctrl Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
platform platform-drivers-x86 for v5.15-1 2021-09-02 13:49:39 -07:00
pnp
power
powercap
pps
ps3
ptp ptp: ocp: Add timestamp window adjustment 2021-09-15 11:10:01 +01:00
pwm
rapidio
ras
regulator
remoteproc
reset
rpmsg
rtc
s390 s390/ism: switch from 'pci_' to 'dma_' API 2021-09-14 12:46:30 +01:00
sbus
scsi Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
sh
siox
slimbus
soc
soundwire
spi
spmi
ssb
staging Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
target SCSI misc on 20210902 2021-09-02 15:09:46 -07:00
tc
tee
thermal platform-drivers-x86 for v5.15-1 2021-09-02 13:49:39 -07:00
thunderbolt thunderbolt: test: split up test cases in tb_test_credit_alloc_all 2021-09-06 12:27:03 -07:00
tty parisc architecture updates for kernel 5.15: 2021-09-02 13:16:00 -07:00
uio
usb More USB changes for 5.15-rc1 2021-09-05 11:19:15 -07:00
vdpa
vfio VFIO update for v5.15-rc1 2021-09-02 13:41:33 -07:00
vhost
video - Fix-ups 2021-09-07 12:50:01 -07:00
virt
virtio
visorbus
vlynq
vme
w1
watchdog
xen Kbuild updates for v5.15 2021-09-03 15:33:47 -07:00
zorro
Kconfig
Makefile