Skip to content

Commit 6a1eef5

Browse files
Michael Chandavem330
authored andcommitted
bnxt_en: Reserve resources for RFS.
In bnxt_rfs_capable(), add call to reserve vnic resources to support NTUPLE. Return true if we can successfully reserve enough vnics. Otherwise, reserve the minimum 1 VNIC for normal operations not supporting NTUPLE and return false. Also, suppress warning message about not enough resources for NTUPLE when only 1 RX ring is in use. NTUPLE filters by definition require multiple RX rings. Signed-off-by: Michael Chan <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 674f50a commit 6a1eef5

File tree

1 file changed

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

1 file changed

+17
-4
lines changed

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

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7064,13 +7064,26 @@ static bool bnxt_rfs_capable(struct bnxt *bp)
70647064
if (bp->flags & BNXT_FLAG_NEW_RSS_CAP)
70657065
max_rss_ctxs = max_vnics;
70667066
if (vnics > max_vnics || vnics > max_rss_ctxs) {
7067-
netdev_warn(bp->dev,
7068-
"Not enough resources to support NTUPLE filters, enough resources for up to %d rx rings\n",
7069-
min(max_rss_ctxs - 1, max_vnics - 1));
7067+
if (bp->rx_nr_rings > 1)
7068+
netdev_warn(bp->dev,
7069+
"Not enough resources to support NTUPLE filters, enough resources for up to %d rx rings\n",
7070+
min(max_rss_ctxs - 1, max_vnics - 1));
70707071
return false;
70717072
}
70727073

7073-
return true;
7074+
if (!(bp->flags & BNXT_FLAG_NEW_RM))
7075+
return true;
7076+
7077+
if (vnics == bp->hw_resc.resv_vnics)
7078+
return true;
7079+
7080+
bnxt_hwrm_reserve_rings(bp, 0, 0, 0, 0, vnics);
7081+
if (vnics <= bp->hw_resc.resv_vnics)
7082+
return true;
7083+
7084+
netdev_warn(bp->dev, "Unable to reserve resources to support NTUPLE filters.\n");
7085+
bnxt_hwrm_reserve_rings(bp, 0, 0, 0, 0, 1);
7086+
return false;
70747087
#else
70757088
return false;
70767089
#endif

0 commit comments

Comments
 (0)