patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Ajit Khaparde <ajit.khaparde@broadcom.com>
To: dev@dpdk.org
Cc: ferruh.yigit@intel.com, stable@dpdk.org,
	Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
	Somnath Kotur <somnath.kotur@broadcom.com>
Subject: [dpdk-stable] [PATCH v1 3/9] net/bnxt: fix to alloc COS queue info dynamically
Date: Fri, 15 May 2020 11:45:36 -0700
Message-ID: <20200515184542.89318-4-ajit.khaparde@broadcom.com> (raw)
In-Reply-To: <20200515184542.89318-1-ajit.khaparde@broadcom.com>

Fixes: 698aa7e95325 ("net/bnxt: add code to determine the Tx COS queue")
Cc: stable@dpdk.org

Signed-off-by: Ajit Khaparde <ajit.khaparde@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
---
 drivers/net/bnxt/bnxt.h        |  4 ++--
 drivers/net/bnxt/bnxt_ethdev.c | 32 ++++++++++++++++++++++++++++++++
 2 files changed, 34 insertions(+), 2 deletions(-)

diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index f4b39b345..570767253 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -637,8 +637,8 @@ struct bnxt {
 	uint32_t			hwrm_cmd_timeout;
 
 	struct bnxt_link_info	link_info;
-	struct bnxt_cos_queue_info	rx_cos_queue[BNXT_COS_QUEUE_COUNT];
-	struct bnxt_cos_queue_info	tx_cos_queue[BNXT_COS_QUEUE_COUNT];
+	struct bnxt_cos_queue_info	*rx_cos_queue;
+	struct bnxt_cos_queue_info	*tx_cos_queue;
 	uint8_t			tx_cosq_id[BNXT_COS_QUEUE_COUNT];
 	uint8_t			rx_cosq_cnt;
 	uint8_t                 max_tc;
diff --git a/drivers/net/bnxt/bnxt_ethdev.c b/drivers/net/bnxt/bnxt_ethdev.c
index 3bd30dfa1..fa1f84d44 100644
--- a/drivers/net/bnxt/bnxt_ethdev.c
+++ b/drivers/net/bnxt/bnxt_ethdev.c
@@ -197,6 +197,12 @@ static void bnxt_free_leds_info(struct bnxt *bp)
 	bp->leds = NULL;
 }
 
+static void bnxt_free_cos_queues(struct bnxt *bp)
+{
+	rte_free(bp->rx_cos_queue);
+	rte_free(bp->tx_cos_queue);
+}
+
 static void bnxt_free_mem(struct bnxt *bp, bool reconfig)
 {
 	bnxt_free_filter_mem(bp);
@@ -230,6 +236,27 @@ static int bnxt_alloc_leds_info(struct bnxt *bp)
 	return 0;
 }
 
+static int bnxt_alloc_cos_queues(struct bnxt *bp)
+{
+	bp->rx_cos_queue =
+		rte_zmalloc("bnxt_rx_cosq",
+			    BNXT_COS_QUEUE_COUNT *
+			    sizeof(struct bnxt_cos_queue_info),
+			    0);
+	if (bp->rx_cos_queue == NULL)
+		return -ENOMEM;
+
+	bp->tx_cos_queue =
+		rte_zmalloc("bnxt_tx_cosq",
+			    BNXT_COS_QUEUE_COUNT *
+			    sizeof(struct bnxt_cos_queue_info),
+			    0);
+	if (bp->tx_cos_queue == NULL)
+		return -ENOMEM;
+
+	return 0;
+}
+
 static int bnxt_alloc_mem(struct bnxt *bp, bool reconfig)
 {
 	int rc;
@@ -1234,6 +1261,7 @@ static void bnxt_dev_close_op(struct rte_eth_dev *eth_dev)
 	bnxt_uninit_resources(bp, false);
 
 	bnxt_free_leds_info(bp);
+	bnxt_free_cos_queues(bp);
 
 	eth_dev->dev_ops = NULL;
 	eth_dev->rx_pkt_burst = NULL;
@@ -5382,6 +5410,10 @@ bnxt_dev_init(struct rte_eth_dev *eth_dev)
 	if (rc)
 		goto error_free;
 
+	rc = bnxt_alloc_cos_queues(bp);
+	if (rc)
+		goto error_free;
+
 	rc = bnxt_init_resources(bp, false);
 	if (rc)
 		goto error_free;
-- 
2.21.1 (Apple Git-122.3)


  parent reply	other threads:[~2020-05-15 18:45 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20200515184542.89318-1-ajit.khaparde@broadcom.com>
2020-05-15 18:45 ` [dpdk-stable] [PATCH v1 1/9] net/bnxt: fix error log for command timeout Ajit Khaparde
2020-05-15 18:45 ` [dpdk-stable] [PATCH v1 2/9] net/bnxt: fix to alloc LED config info Ajit Khaparde
2020-05-15 18:45 ` Ajit Khaparde [this message]
2020-05-15 18:45 ` [dpdk-stable] [PATCH v1 5/9] net/bnxt: fix to alloc link info struct Ajit Khaparde
2020-05-15 18:45 ` [dpdk-stable] [PATCH v1 6/9] net/bnxt: fix to alloc PF info structure Ajit Khaparde
2020-05-15 18:45 ` [dpdk-stable] [PATCH v1 7/9] net/bnxt: fix to use RSS config from eth dev struct Ajit Khaparde
2020-05-15 18:45 ` [dpdk-stable] [PATCH v1 8/9] net/bnxt: fix to remove unneeded structure variable 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=20200515184542.89318-4-ajit.khaparde@broadcom.com \
    --to=ajit.khaparde@broadcom.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=kalesh-anakkur.purayil@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=stable@dpdk.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

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git