]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
bnxt_en: Reserve resources for RFS.
authorMichael Chan <michael.chan@broadcom.com>
Wed, 17 Jan 2018 08:21:10 +0000 (03:21 -0500)
committerJack Vogel <jack.vogel@oracle.com>
Fri, 9 Mar 2018 05:07:16 +0000 (21:07 -0800)
Orabug: 2764835527648339

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 <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 6a1eef5b9079742ecfad647892669bd5fe6b0e3f)
Signed-off-by: Brian Maly <brian.maly@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
drivers/net/ethernet/broadcom/bnxt/bnxt.c

index 66961e3bbe66cbbc1b32f7dd1340a52750120ba3..0313404d70a11b79d7f724594518dace1b3f2b77 100644 (file)
@@ -6959,13 +6959,26 @@ static bool bnxt_rfs_capable(struct bnxt *bp)
        if (bp->flags & BNXT_FLAG_NEW_RSS_CAP)
                max_rss_ctxs = max_vnics;
        if (vnics > max_vnics || vnics > max_rss_ctxs) {
-               netdev_warn(bp->dev,
-                           "Not enough resources to support NTUPLE filters, enough resources for up to %d rx rings\n",
-                           min(max_rss_ctxs - 1, max_vnics - 1));
+               if (bp->rx_nr_rings > 1)
+                       netdev_warn(bp->dev,
+                                   "Not enough resources to support NTUPLE filters, enough resources for up to %d rx rings\n",
+                                   min(max_rss_ctxs - 1, max_vnics - 1));
                return false;
        }
 
-       return true;
+       if (!(bp->flags & BNXT_FLAG_NEW_RM))
+               return true;
+
+       if (vnics == bp->hw_resc.resv_vnics)
+               return true;
+
+       bnxt_hwrm_reserve_rings(bp, 0, 0, 0, 0, vnics);
+       if (vnics <= bp->hw_resc.resv_vnics)
+               return true;
+
+       netdev_warn(bp->dev, "Unable to reserve resources to support NTUPLE filters.\n");
+       bnxt_hwrm_reserve_rings(bp, 0, 0, 0, 0, 1);
+       return false;
 #else
        return false;
 #endif