RE: [PATCH net v2] net: mana: Ring doorbell at 4 CQ wraparounds
From: Haiyang Zhang
Date: Thu Feb 26 2026 - 15:40:58 EST
> -----Original Message-----
> From: Long Li <longli@xxxxxxxxxxxxx>
> Sent: Thursday, February 26, 2026 2:29 PM
> To: KY Srinivasan <kys@xxxxxxxxxxxxx>; Haiyang Zhang
> <haiyangz@xxxxxxxxxxxxx>; Wei Liu <wei.liu@xxxxxxxxxx>; Dexuan Cui
> <DECUI@xxxxxxxxxxxxx>; Long Li <longli@xxxxxxxxxxxxx>; Andrew Lunn
> <andrew+netdev@xxxxxxx>; David S . Miller <davem@xxxxxxxxxxxxx>; Eric
> Dumazet <edumazet@xxxxxxxxxx>; Jakub Kicinski <kuba@xxxxxxxxxx>; Paolo
> Abeni <pabeni@xxxxxxxxxx>
> Cc: Shradha Gupta <shradhagupta@xxxxxxxxxxxxxxxxxxx>; Erni Sri Satya
> Vennela <ernis@xxxxxxxxxxxxxxxxxxx>; linux-hyperv@xxxxxxxxxxxxxxx;
> netdev@xxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx;
> stable@xxxxxxxxxxxxxxx
> Subject: [PATCH net v2] net: mana: Ring doorbell at 4 CQ wraparounds
>
> MANA hardware requires at least one doorbell ring every 8 wraparounds
> of the CQ. The driver rings the doorbell as a form of flow control to
> inform hardware that CQEs have been consumed.
>
> The NAPI poll functions mana_poll_tx_cq() and mana_poll_rx_cq() can
> poll up to CQE_POLLING_BUFFER (512) completions per call. If the CQ
> has fewer than 512 entries, a single poll call can process more than
> 4 wraparounds without ringing the doorbell. The doorbell threshold
> check also uses ">" instead of ">=", delaying the ring by one extra
> CQE beyond 4 wraparounds. Combined, these issues can cause the driver
> to exceed the 8-wraparound hardware limit, leading to missed
> completions and stalled queues.
>
> Fix this by capping the number of CQEs polled per call to 4 wraparounds
> of the CQ in both TX and RX paths. Also change the doorbell threshold
> from ">" to ">=" so the doorbell is rung as soon as 4 wraparounds are
> reached.
>
> Cc: stable@xxxxxxxxxxxxxxx
> Fixes: 58a63729c957 ("net: mana: Fix doorbell out of order violation and
> avoid unnecessary doorbell rings")
> Signed-off-by: Long Li <longli@xxxxxxxxxxxxx>
> ---
Reviewed-by: Haiyang Zhang <haiyangz@xxxxxxxxxxxxx>