Thread (14 messages) 14 messages, 2 authors, 2d ago

Re: [PATCH net-next v4 8/8] bnxt_en: Fix ring accounting and validation when rings are constrained

flat view

From: Michael Chan <michael.chan@broadcom.com>
Date: 2026-10-20 09:44:19

On Tue, Oct 20, 2026 at 12:25 AM [off-list ref] wrote:
quoted
      /* Trim rings based upon num of vectors allocated */
      rc = bnxt_trim_rings(bp, &bp->rx_nr_rings, &bp->tx_nr_rings,
                           total_vecs - ulp_msix, min == 1);
      if (rc)
              goto msix_setup_exit;

-     tx_cp = bnxt_num_tx_to_cp(bp, bp->tx_nr_rings, bp->tx_nr_rings_xdp,
-                               bp->rx_nr_rings);
-     bp->cp_nr_rings = (min == 1) ?
-                       max_t(int, tx_cp, bp->rx_nr_rings) :
-                       tx_cp + bp->rx_nr_rings;
+     min_tx = bp->tx_nr_rings_xdp ? tcs + 1 : tcs;
+     if (bp->tx_nr_rings < min_tx) {
+             netdev_err(bp->dev, "Not enough MSI-X to satisfy min. TX rings\n");
+             rc = -ENOMEM;
+             goto msix_setup_exit_restore;
+     }
[Severity: Medium]
Does this check also reject the driver's own "rings not reserved yet"
state, where bp->tx_nr_rings is 0?
Yes, also valid.  Some VFs may not have any rings reserved at this
point.  The if statement needs to be modified to allow these VFs to
proceed.

pw-bot: cr

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help