netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Chan <michael.chan@broadcom.com>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org
Subject: [PATCH net-next 08/14] bnxt_en: Reserve resources for RFS.
Date: Wed, 17 Jan 2018 03:21:10 -0500	[thread overview]
Message-ID: <1516177276-9722-9-git-send-email-michael.chan@broadcom.com> (raw)
In-Reply-To: <1516177276-9722-1-git-send-email-michael.chan@broadcom.com>

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>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
index 6fc324f..8b74e6e 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
@@ -7064,13 +7064,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
-- 
1.8.3.1

  parent reply	other threads:[~2018-01-17  8:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-17  8:21 [PATCH net-next 00/14] bnxt_en: Updates for net-next Michael Chan
2018-01-17  8:21 ` [PATCH net-next 01/14] bnxt_en: Update firmware interface to 1.9.0 Michael Chan
2018-01-17  8:21 ` [PATCH net-next 02/14] bnxt_en: Refactor bnxt_close_nic() Michael Chan
2018-01-17  8:21 ` [PATCH net-next 03/14] bnxt_en: Restore MSIX after disabling SRIOV Michael Chan
2018-01-17  8:21 ` [PATCH net-next 04/14] bnxt_en: Refactor hardware resource data structures Michael Chan
2018-01-17  8:21 ` [PATCH net-next 05/14] bnxt_en: Add the new firmware API to query hardware resources Michael Chan
2018-01-17  8:21 ` [PATCH net-next 06/14] bnxt_en: Set initial default RX and TX ring numbers the same in combined mode Michael Chan
2018-01-17  8:21 ` [PATCH net-next 07/14] bnxt_en: Implement new method to reserve rings Michael Chan
2018-01-17  8:21 ` Michael Chan [this message]
2018-01-17  8:21 ` [PATCH net-next 09/14] bnxt_en: Implement new method for the PF to assign SRIOV resources Michael Chan
2018-01-17  8:21 ` [PATCH net-next 10/14] bnxt_en: Expand bnxt_check_rings() to check all resources Michael Chan
2018-01-17  8:21 ` [PATCH net-next 11/14] bnxt_en: Add BCM5745X NPAR device IDs Michael Chan
2018-01-17  8:21 ` [PATCH net-next 12/14] bnxt_en: Forward VF MAC address to the PF Michael Chan
2018-01-17  8:21 ` [PATCH net-next 13/14] bnxt_en: Add cache line size setting to optimize performance Michael Chan
2018-01-17  8:21 ` [PATCH net-next 14/14] bnxt_en: export a common switchdev PARENT_ID for all reps of an adapter Michael Chan
2018-01-17 19:48 ` [PATCH net-next 00/14] bnxt_en: Updates for net-next David Miller

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=1516177276-9722-9-git-send-email-michael.chan@broadcom.com \
    --to=michael.chan@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).