Linux kernel -stable discussions
 help / color / mirror / Atom feed
From: Sahil Chandna <sahilchandna@linux.microsoft.com>
To: Sasha Levin <sashal@kernel.org>, stable@vger.kernel.org
Cc: Haiyang Zhang <haiyangz@microsoft.com>, Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH 6.1.y] net: mana: Reserve extra CQ slot for the fence completion CQE
Date: Thu, 17 Sep 2026 17:36:14 +0530	[thread overview]
Message-ID: <1bfa2747-7f57-4b96-a005-9f4a92fe35b3@linux.microsoft.com> (raw)
In-Reply-To: <20260916234249.3300330-1-sashal@kernel.org>



On 17/09/2026 05:12, Sasha Levin wrote:
> From: Sahil Chandna <sahilchandna@linux.microsoft.com>
> 
> [ Upstream commit 80dd7e754b3aa9637a0758ad93fa209f9650ec48 ]
> 
> The RX completion queue is sized to hold exactly one CQE per posted RX WQE.
> MANA_FENCE_RQ makes hardware post an additional CQE_RX_OBJECT_FENCE after
> the packet CQEs. The current sizing reserves no extra slot for it and in
> rare cases, CQ has no guaranteed slot for the fence CQE when it is full of
> packet CQEs. This can lead to dropping the fence completion while the
> driver waits holding RTNL lock throughout the timeout duration.
> Reserve one extra CQE slot for CQE_RX_OBJECT_FENCE. mana_gd_alloc_memory()
> requires queue_size to be a power-of-two and at least MANA_PAGE_SIZE;
> the reservation pushes cq_size past a power-of-two, so round up the CQ size
> in mana_create_rxq().
> 
> Cc: stable@vger.kernel.org
> Fixes: 6cc74443a773 ("net: mana: Add RX fencing")
> Signed-off-by: Sahil Chandna <sahilchandna@linux.microsoft.com>
> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> Link: https://patch.msgid.link/20260901121837.3503240-1-sahilchandna@linux.microsoft.com
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> [ Replaced MANA_PAGE_ALIGN() with PAGE_ALIGN() to match the older tree. ]
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>   drivers/net/ethernet/microsoft/mana/mana_en.c | 6 +++++-
>   1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/microsoft/mana/mana_en.c b/drivers/net/ethernet/microsoft/mana/mana_en.c
> index 4afcb202e3509..2d1e5b83a0769 100644
> --- a/drivers/net/ethernet/microsoft/mana/mana_en.c
> +++ b/drivers/net/ethernet/microsoft/mana/mana_en.c
> @@ -1662,6 +1662,10 @@ static int mana_alloc_rx_wqe(struct mana_port_context *apc,
>   		*cq_size += COMP_ENTRY_SIZE;
>   	}
>   
> +	/* Reserve an extra slot for Fence completion
> +	 * event (CQE_RX_OBJECT_FENCE) in case RX CQ is full.
> +	 */
> +	*cq_size += COMP_ENTRY_SIZE;
>   	return 0;
>   }
>   
> @@ -1715,7 +1719,7 @@ static struct mana_rxq *mana_create_rxq(struct mana_port_context *apc,
>   		goto out;
>   
>   	rq_size = PAGE_ALIGN(rq_size);
> -	cq_size = PAGE_ALIGN(cq_size);
> +	cq_size = PAGE_ALIGN(roundup_pow_of_two(cq_size));
>   
Hi Sasha,
Thanks for fixing this for 6.1 kernel
Regards,
Sahil
>   	/* Create RQ */
>   	memset(&spec, 0, sizeof(spec));


      reply	other threads:[~2026-09-17 12:06 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-16 15:31 FAILED: patch "[PATCH] net: mana: Reserve extra CQ slot for the fence completion CQE" failed to apply to 6.1-stable tree gregkh
2026-09-16 23:42 ` [PATCH 6.1.y] net: mana: Reserve extra CQ slot for the fence completion CQE Sasha Levin
2026-09-17 12:06   ` Sahil Chandna [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1bfa2747-7f57-4b96-a005-9f4a92fe35b3@linux.microsoft.com \
    --to=sahilchandna@linux.microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kuba@kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox