Skip to content

Commit 07f4fde

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Fix inconsistent BNXT_FLAG_AGG_RINGS logic.
If there aren't enough RX rings available, the driver will attempt to use a single RX ring without the aggregation ring. If that also fails, the BNXT_FLAG_AGG_RINGS flag is cleared but the other ring parameters are not set consistently to reflect that. If more RX rings become available at the next open, the RX rings will be in an inconsistent state and may crash when freeing the RX rings. Fix it by restoring the BNXT_FLAG_AGG_RINGS if not enough RX rings are available to run without aggregation rings. Fixes: bdbd1eb ("bnxt_en: Handle no aggregation ring gracefully.") Signed-off-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent e32d4e6 commit 07f4fde

File tree

1 file changed

+4
-1
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+4
-1
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8520,8 +8520,11 @@ static int bnxt_get_dflt_rings(struct bnxt *bp, int *max_rx, int *max_tx,
85208520
/* Not enough rings, try disabling agg rings. */
85218521
bp->flags &= ~BNXT_FLAG_AGG_RINGS;
85228522
rc = bnxt_get_max_rings(bp, max_rx, max_tx, shared);
8523-
if (rc)
8523+
if (rc) {
8524+
/* set BNXT_FLAG_AGG_RINGS back for consistency */
8525+
bp->flags |= BNXT_FLAG_AGG_RINGS;
85248526
return rc;
8527+
}
85258528
bp->flags |= BNXT_FLAG_NO_AGG_RINGS;
85268529
bp->dev->hw_features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW);
85278530
bp->dev->features &= ~(NETIF_F_LRO | NETIF_F_GRO_HW);

0 commit comments

Comments
 (0)