Linux RDMA and InfiniBand development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Siva Reddy Kallam" <siva.kallam@broadcom.com>
Cc: linux-rdma@vger.kernel.org
Subject: Re: [net-next v2 3/3] bnge: reserve TX/completion rings for the RoCE MPC channel
Date: Wed, 07 Oct 2026 16:24:20 +0000	[thread overview]
Message-ID: <sashiko-outbox-163192@kernel.org> (raw)
In-Reply-To: <20261006161256.1493672-4-siva.kallam@broadcom.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] bnge: strict check against tx_demand breaks graceful TX ring fallback
--

commit 03cbac58eff7b84409d8e42c716c6db377e04ad6
Author: Sachin Holla <sachin.holla@broadcom.com>
bnge: reserve TX/completion rings for the RoCE MPC channel

This commit updates the driver to reserve extra TX and completion rings
specifically for the RoCE MPC channel when RoCE is enabled. It modifies
the ring reservation logic to account for this extra demand to prevent
pool overflow.

> diff --git a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> index 4711dd4945ffe..9dfb22b7c7c7a 100644
> --- a/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
> +++ b/drivers/net/ethernet/broadcom/bnge/bnge_resc.c
[ ... ]
> @@ -327,6 +344,13 @@ int bnge_reserve_rings(struct bnge_dev *bd)
>  	if (hwr.stat > bnge_aux_get_stat_ctxs(bd))
>  		hwr.stat -= bnge_aux_get_stat_ctxs(bd);
>  	hwr.nq = min_t(u16, hwr.nq, hwr.stat);
> +	/* Drop MPC TX ring from L2 TX ring count; it is owned by RoCE driver */
> +	if (bnge_is_roce_en(bd)) {
> +		if (hwr.tx >= tx_demand)
> +			hwr.tx -= 1;
> +		else
> +			return -ENOMEM;

[Severity: Medium]
Does this strict check against tx_demand prevent the driver from gracefully
degrading TX rings when firmware resources are constrained?

When firmware grants fewer TX rings than initially requested
(meaning hwr.tx < tx_demand), this condition immediately fails network
driver initialization with -ENOMEM.

When RoCE is disabled, the partially granted hwr.tx count is passed down
to bnge_adjust_rings(), which scales down the L2 queue counts gracefully.
Could this logic be adjusted to verify there are enough rings to satisfy
the absolute minimum requirement, subtract 1 for the RoCE MPC ring, and
then let bnge_adjust_rings() adjust the remaining L2 rings?

> +	}
>  
>  	/* Adjust the rings */
>  	rc = bnge_adjust_rings(bd, &rx_rings, &hwr.tx, hwr.nq, sh);

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261006161256.1493672-1-siva.kallam@broadcom.com?part=3

      reply	other threads:[~2026-10-07 16:24 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-06 16:12 [net-next v2 0/3] bnge changes for RoCE driver Siva Reddy Kallam
2026-10-06 16:12 ` [net-next v2 1/3] bnge: Add infrastructure support for RoCE MPC channels Siva Reddy Kallam
2026-10-07 16:24   ` sashiko-bot
2026-10-06 16:12 ` [net-next v2 2/3] bnge: Update HSI Siva Reddy Kallam
2026-10-07 16:24   ` sashiko-bot
2026-10-06 16:12 ` [net-next v2 3/3] bnge: reserve TX/completion rings for the RoCE MPC channel Siva Reddy Kallam
2026-10-07 16:24   ` sashiko-bot [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=sashiko-outbox-163192@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=siva.kallam@broadcom.com \
    /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