DPDK patches and discussions
 help / color / mirror / Atom feed
From: Rasesh Mody <rasesh.mody@cavium.com>
To: <ferruh.yigit@intel.com>
Cc: Harish Patil <harish.patil@qlogic.com>, <dev@dpdk.org>,
	<stable@dpdk.org>,  <Dept-EngDPDKDev@cavium.com>
Subject: [dpdk-dev] [PATCH v2 3/5] net/qede: fix PF fastpath status block index
Date: Fri, 6 Jan 2017 00:16:47 -0800	[thread overview]
Message-ID: <1483690609-15125-3-git-send-email-rasesh.mody@cavium.com> (raw)
In-Reply-To: <1483172217-30186-1-git-send-email-rasesh.mody@cavium.com>

From: Harish Patil <harish.patil@qlogic.com>

Allocate double the number of fastpath status block index
since the PF RX/TX queues are not sharing the status block.
This is an interim solution till other parts of the code
is modified to handle the same.

Fixes: f1e4b6c0acee ("net/qede: fix status block index for VF queues")

Signed-off-by: Harish Patil <harish.patil@qlogic.com>
---
 drivers/net/qede/qede_rxtx.c |   14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/drivers/net/qede/qede_rxtx.c b/drivers/net/qede/qede_rxtx.c
index aebe8cb..f20881c 100644
--- a/drivers/net/qede/qede_rxtx.c
+++ b/drivers/net/qede/qede_rxtx.c
@@ -431,13 +431,15 @@ int qede_alloc_fp_resc(struct qede_dev *qdev)
 	struct ecore_dev *edev = &qdev->edev;
 	struct qede_fastpath *fp;
 	uint32_t num_sbs;
-	int rc, i;
+	uint16_t i;
+	uint16_t sb_idx;
+	int rc;
 
 	if (IS_VF(edev))
 		ecore_vf_get_num_sbs(ECORE_LEADING_HWFN(edev), &num_sbs);
 	else
-		num_sbs = (ecore_cxt_get_proto_cid_count
-			  (ECORE_LEADING_HWFN(edev), PROTOCOLID_ETH, NULL)) / 2;
+		num_sbs = ecore_cxt_get_proto_cid_count
+			  (ECORE_LEADING_HWFN(edev), PROTOCOLID_ETH, NULL);
 
 	if (num_sbs == 0) {
 		DP_ERR(edev, "No status blocks available\n");
@@ -455,7 +457,11 @@ int qede_alloc_fp_resc(struct qede_dev *qdev)
 
 	for (i = 0; i < QEDE_QUEUE_CNT(qdev); i++) {
 		fp = &qdev->fp_array[i];
-		if (qede_alloc_mem_sb(qdev, fp->sb_info, i % num_sbs)) {
+		if (IS_VF(edev))
+			sb_idx = i % num_sbs;
+		else
+			sb_idx = i;
+		if (qede_alloc_mem_sb(qdev, fp->sb_info, sb_idx)) {
 			qede_free_fp_arrays(qdev);
 			return -ENOMEM;
 		}
-- 
1.7.10.3

  parent reply	other threads:[~2017-01-06  8:20 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-31  8:16 [dpdk-dev] [PATCH 1/5] net/qede: fix scatter-gather issue Rasesh Mody
2016-12-31  8:16 ` [dpdk-dev] [PATCH 2/5] net/qede: fix minimum buffer size and scatter Rx check Rasesh Mody
2016-12-31  8:16 ` [dpdk-dev] [PATCH 3/5] net/qede: fix PF fastpath status block index Rasesh Mody
2016-12-31  8:16 ` [dpdk-dev] [PATCH 4/5] net/qede: fix per queue stats/xstats Rasesh Mody
2017-01-05 13:26 ` [dpdk-dev] [dpdk-stable] [PATCH 1/5] net/qede: fix scatter-gather issue Ferruh Yigit
2017-01-05 21:12   ` Harish Patil
2017-01-05 22:35     ` Mody, Rasesh
2017-01-06  8:16 ` [dpdk-dev] [PATCH v2 " Rasesh Mody
2017-01-06 13:31   ` Ferruh Yigit
2017-01-06  8:16 ` [dpdk-dev] [PATCH v2 2/5] net/qede: fix minimum buffer size and scatter Rx check Rasesh Mody
2017-01-06  8:16 ` Rasesh Mody [this message]
2017-01-06  8:16 ` [dpdk-dev] [PATCH v2 4/5] net/qede: fix per queue stats/xstats Rasesh Mody
2017-01-06  8:16 ` [dpdk-dev] [PATCH v2 5/5] net/qede: convert few DP_NOTICE and DP_INFO to DP_ERR Rasesh Mody

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=1483690609-15125-3-git-send-email-rasesh.mody@cavium.com \
    --to=rasesh.mody@cavium.com \
    --cc=Dept-EngDPDKDev@cavium.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=harish.patil@qlogic.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
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).