DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, Rahul Gupta <rahul.gupta@broadcom.com>,
	Somnath Kotur <somnath.kotur@broadcom.com>
Subject: [dpdk-dev] [PATCH v2 3/6] net/bnxt: fix flow creation with non-consecutive group ids
Date: Wed, 13 Nov 2019 07:06:57 -0800	[thread overview]
Message-ID: <20191113150700.2517-4-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20191113150700.2517-1-ajit.khaparde@broadcom.com>

From: Rahul Gupta <rahul.gupta@broadcom.com>

In non-RSS mode, vnics map 1:1 with Rx queues during init. This can
create problems if non-consecutive group IDs are given as part of
subsequent flow create cmds as they can end up pointing to Rx queues
(mapped during init) that are different than the intended destination
queue as specified in the flow create cmd.
To fix this, now that we have the ability to dynamically create
vnics, do not create any additional vnics other than the default vnic
during init. Allocate them only during flow/filter creation time.

When RSS is disabled we need to use the COS queue count queried
from firmware.

Fixes: 36024b2e7fe5 ("net/bnxt: allow dynamic creation of VNIC")

Signed-off-by: Rahul Gupta <rahul.gupta@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt_flow.c | 4 +---
 drivers/net/bnxt/bnxt_rxq.c  | 5 ++++-
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index 8f386cdf1..5af571448 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -1093,9 +1093,7 @@ bnxt_validate_and_parse_flow(struct rte_eth_dev *dev,
 		    vnic->fw_vnic_id != INVALID_HW_RING_ID)
 			goto use_vnic;
 
-		if (!rxq ||
-		    bp->vnic_info[0].fw_grp_ids[act_q->index] !=
-		    INVALID_HW_RING_ID) {
+		if (!rxq) {
 			PMD_DRV_LOG(ERR,
 				    "Queue invalid or used with other VNIC\n");
 			rte_flow_error_set(error,
diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c
index fa11bec4e..7fd079da3 100644
--- a/drivers/net/bnxt/bnxt_rxq.c
+++ b/drivers/net/bnxt/bnxt_rxq.c
@@ -35,7 +35,7 @@ int bnxt_mq_rx_configure(struct bnxt *bp)
 	int start_grp_id, end_grp_id = 1, rc = 0;
 	struct bnxt_vnic_info *vnic;
 	struct bnxt_filter_info *filter;
-	enum rte_eth_nb_pools pools = bp->rx_cp_nr_rings, max_pools = 0;
+	enum rte_eth_nb_pools pools = 1, max_pools = 0;
 	struct bnxt_rx_queue *rxq;
 
 	bp->nr_vnics = 0;
@@ -100,7 +100,10 @@ int bnxt_mq_rx_configure(struct bnxt *bp)
 			rc = -EINVAL;
 			goto err_out;
 		}
+	} else if (!dev_conf->rxmode.mq_mode) {
+		pools = bp->rx_cosq_cnt ? bp->rx_cosq_cnt : pools;
 	}
+
 	nb_q_per_grp = bp->rx_cp_nr_rings / pools;
 	bp->rx_num_qs_per_vnic = nb_q_per_grp;
 	PMD_DRV_LOG(DEBUG, "pools = %u nb_q_per_grp = %u\n",
-- 
2.21.0 (Apple Git-122.2)


  parent reply	other threads:[~2019-11-13 15:07 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-13  8:29 [dpdk-dev] [PATCH 0/6] bnxt patchset with bug fixes Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 1/6] net/bnxt: add missing checks for fw reset Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 2/6] net/bnxt: fix to cap queue count for NS3/Stingray devices Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 3/6] net/bnxt: fix flow creation with non-consecutive group ids Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 4/6] net/bnxt: fix a potential segfault in xstats get Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 5/6] net/bnxt: change print message type from ERR to DEBUG Somnath Kotur
2019-11-13  8:29 ` [dpdk-dev] [PATCH 6/6] net/bnxt: fix potential NULL pointer dereference Somnath Kotur
2019-11-13 15:06 ` [dpdk-dev] [PATCH v2 0/6] bnxt patchset with bug fixes Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 1/6] net/bnxt: add missing checks for firmware reset Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 2/6] net/bnxt: cap queue count for NS3/Stingray devices Ajit Khaparde
2019-11-13 15:06   ` Ajit Khaparde [this message]
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 4/6] net/bnxt: fix a potential segfault in xstats get Ajit Khaparde
2019-11-13 15:06   ` [dpdk-dev] [PATCH v2 5/6] net/bnxt: change print message type from ERR to DEBUG Ajit Khaparde
2019-11-13 15:07   ` [dpdk-dev] [PATCH v2 6/6] net/bnxt: fix potential NULL pointer dereference Ajit Khaparde
2019-11-13 15:14   ` [dpdk-dev] [PATCH v2 0/6] bnxt patchset with bug fixes Ajit Khaparde

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=20191113150700.2517-4-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=rahul.gupta@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    /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).