linux/include
Long Li 58a63729c9 net: mana: Fix doorbell out of order violation and avoid unnecessary doorbell rings
After napi_complete_done() is called when NAPI is polling in the current
process context, another NAPI may be scheduled and start running in
softirq on another CPU and may ring the doorbell before the current CPU
does. When combined with unnecessary rings when there is no need to arm
the CQ, it triggers error paths in the hardware.

This patch fixes this by calling napi_complete_done() after doorbell
rings. It limits the number of unnecessary rings when there is
no need to arm. MANA hardware specifies that there must be one doorbell
ring every 8 CQ wraparounds. This driver guarantees one doorbell ring as
soon as the number of consumed CQEs exceeds 4 CQ wraparounds. In practical
workloads, the 4 CQ wraparounds proves to be big enough that it rarely
exceeds this limit before all the napi weight is consumed.

To implement this, add a per-CQ counter cq->work_done_since_doorbell,
and make sure the CQ is armed as soon as passing 4 wraparounds of the CQ.

Cc: stable@vger.kernel.org
Fixes: e1b5683ff6 ("net: mana: Move NAPI from EQ to CQ")
Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: Long Li <longli@microsoft.com>
Link: https://patch.msgid.link/1723219138-29887-1-git-send-email-longli@linuxonhyperv.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
2024-08-13 13:09:54 +02:00
..
acpi Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
asm-generic runtime constants: deal with old decrepit linkers 2024-08-03 08:38:45 -07:00
clocksource
crypto
drm Merge tag 'drm-intel-next-2024-06-28' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next 2024-07-10 10:36:47 +02:00
dt-bindings I3C for 6.11 2024-07-27 10:53:06 -07:00
keys
kunit kunit: Introduce KUNIT_ASSERT_MEMEQ and KUNIT_ASSERT_MEMNEQ macros 2024-07-12 10:12:11 -06:00
kvm
linux Including fixes from bluetooth. 2024-08-08 13:51:44 -07:00
math-emu
media
memory
misc
net net: mana: Fix doorbell out of order violation and avoid unnecessary doorbell rings 2024-08-13 13:09:54 +02:00
pcmcia
ras mm/memory-failure: remove obsolete MF_MSG_DIFFERENT_COMPOUND 2024-07-12 15:52:22 -07:00
rdma
rv
scsi Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00
soc sound updates for 6.11-rc1 2024-07-19 12:39:34 -07:00
sound sound fixes for 6.11-rc2 2024-08-02 09:04:57 -07:00
target
trace Including fixes from wireless, bleutooth, BPF and netfilter. 2024-08-01 09:42:09 -07:00
uapi uretprobe: change syscall number, again 2024-08-02 15:18:49 +02:00
ufs scsi: ufs: core: Check LSDBS cap when !mcq 2024-07-15 22:51:06 -04:00
vdso Random number generator updates for Linux 6.11-rc1. 2024-07-24 10:29:50 -07:00
video
xen Driver core changes for 6.11-rc1 2024-07-25 10:42:22 -07:00