DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nelson Escobar <neescoba@cisco.com>
To: dev@dpdk.org
Cc: bruce.richardson@intel.com, Nelson Escobar <neescoba@cisco.com>
Subject: [dpdk-dev] [PATCH] enic: fix issues when using Rx scatter with multiple RQs
Date: Fri, 24 Jun 2016 15:39:57 -0700	[thread overview]
Message-ID: <1466807997-21403-1-git-send-email-neescoba@cisco.com> (raw)

The Rx scatter patch failed to make a few changes and resulted
in problems when using multiple RQs since the wrong RQ or CQ
was being used.

Fixes: 14a261bf0520 ("enic: add scattered Rx support")

Signed-off-by: Nelson Escobar <neescoba@cisco.com>
Reviewed-by: John Daley <johndale@cisco.com>
---
 drivers/net/enic/enic.h      |  2 +-
 drivers/net/enic/enic_main.c | 10 ++++++----
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index ed5f18d..15b1d45 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -174,7 +174,7 @@ static inline unsigned int enic_vnic_rq_count(struct enic *enic)
 
 static inline unsigned int enic_cq_rq(__rte_unused struct enic *enic, unsigned int rq)
 {
-	return rq;
+	return rq / 2;
 }
 
 static inline unsigned int enic_cq_wq(struct enic *enic, unsigned int wq)
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index 15389e5..68dbe40 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -238,19 +238,20 @@ void enic_init_vnic_resources(struct enic *enic)
 	struct vnic_rq *data_rq;
 
 	for (index = 0; index < enic->rq_count; index++) {
+		cq_idx = enic_cq_rq(enic, enic_sop_rq(index));
+
 		vnic_rq_init(&enic->rq[enic_sop_rq(index)],
-			enic_cq_rq(enic, index),
+			cq_idx,
 			error_interrupt_enable,
 			error_interrupt_offset);
 
 		data_rq = &enic->rq[enic_data_rq(index)];
 		if (data_rq->in_use)
 			vnic_rq_init(data_rq,
-				     enic_cq_rq(enic, index),
+				     cq_idx,
 				     error_interrupt_enable,
 				     error_interrupt_offset);
 
-		cq_idx = enic_cq_rq(enic, index);
 		vnic_cq_init(&enic->cq[cq_idx],
 			0 /* flow_control_enable */,
 			1 /* color_enable */,
@@ -899,7 +900,8 @@ static int enic_set_rsscpu(struct enic *enic, u8 rss_hash_bits)
 		return -ENOMEM;
 
 	for (i = 0; i < (1 << rss_hash_bits); i++)
-		(*rss_cpu_buf_va).cpu[i/4].b[i%4] = i % enic->rq_count;
+		(*rss_cpu_buf_va).cpu[i / 4].b[i % 4] =
+			enic_sop_rq(i % enic->rq_count);
 
 	err = enic_set_rss_cpu(enic,
 		rss_cpu_buf_pa,
-- 
2.7.0

             reply	other threads:[~2016-06-24 22:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 22:39 Nelson Escobar [this message]
2016-06-28 11:12 ` Bruce Richardson
2016-06-28 18:49   ` [dpdk-dev] [PATCH v2] " Nelson Escobar
2016-06-29 10:48     ` Bruce Richardson

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=1466807997-21403-1-git-send-email-neescoba@cisco.com \
    --to=neescoba@cisco.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@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).