summaryrefslogtreecommitdiffstats
path: root/dpdk/dpdk-16.04_patches/0024-net-enic-fix-Rx-scatter-with-multiple-queues.patch
diff options
context:
space:
mode:
authorJohn Lo <loj@cisco.com>2016-07-04 23:23:32 -0400
committerDamjan Marion <dmarion.lists@gmail.com>2016-07-05 16:21:35 +0000
commit55bf5c938585f0cc91b848ec37a5abfaf01f9515 (patch)
treedb08c0efcf55a9d13905616af27a8f819c2dc1c2 /dpdk/dpdk-16.04_patches/0024-net-enic-fix-Rx-scatter-with-multiple-queues.patch
parentf727db9e6fb50b2930aedf18bcdda55fe0b96889 (diff)
ENIC driver patches to address various issues
Also clear x-bit for old patch files 0013-xxx and 0014-xxx. Change-Id: I217fdbfb32cef1ae575c668270d3baf593e688c6 Signed-off-by: John Lo <loj@cisco.com>
Diffstat (limited to 'dpdk/dpdk-16.04_patches/0024-net-enic-fix-Rx-scatter-with-multiple-queues.patch')
-rw-r--r--dpdk/dpdk-16.04_patches/0024-net-enic-fix-Rx-scatter-with-multiple-queues.patch80
1 files changed, 80 insertions, 0 deletions
diff --git a/dpdk/dpdk-16.04_patches/0024-net-enic-fix-Rx-scatter-with-multiple-queues.patch b/dpdk/dpdk-16.04_patches/0024-net-enic-fix-Rx-scatter-with-multiple-queues.patch
new file mode 100644
index 00000000000..d581702d47a
--- /dev/null
+++ b/dpdk/dpdk-16.04_patches/0024-net-enic-fix-Rx-scatter-with-multiple-queues.patch
@@ -0,0 +1,80 @@
+From 658069b0c5994e260cd7d0a7dfc7f03d78dd4f5a Mon Sep 17 00:00:00 2001
+From: Nelson Escobar <neescoba@cisco.com>
+Date: Tue, 28 Jun 2016 11:49:11 -0700
+Subject: [PATCH 24/25] net/enic: fix Rx scatter with multiple queues
+
+The Rx scatter patch failed to make a few changes and resulted in
+problems when using multiple receive queues (RQs) in DPDK (ie RSS)
+since the wrong adapter resources were being used.
+
+- get and use the correct completion queue index associated with a
+ receive queue.
+- set the correct receive queue index when using RSS
+
+Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")
+
+Signed-off-by: Nelson Escobar <neescoba@cisco.com>
+Reviewed-by: John Daley <johndale@cisco.com>
+---
+ drivers/net/enic/enic.h | 6 +++++-
+ drivers/net/enic/enic_main.c | 10 ++++++----
+ 2 files changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
+index 175adb8..8b0fa05 100644
+--- a/drivers/net/enic/enic.h
++++ b/drivers/net/enic/enic.h
+@@ -165,7 +165,11 @@ static inline unsigned int enic_data_rq(__rte_unused struct enic *enic, unsigned
+
+ static inline unsigned int enic_cq_rq(__rte_unused struct enic *enic, unsigned int rq)
+ {
+- return rq;
++ /* Scatter rx uses two receive queues together with one
++ * completion queue, so the completion queue number is no
++ * longer the same as the rq number.
++ */
++ 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 0547f3b..976c9da 100644
+--- a/drivers/net/enic/enic_main.c
++++ b/drivers/net/enic/enic_main.c
+@@ -252,19 +252,20 @@ void enic_init_vnic_resources(struct enic *enic)
+ vnic_dev_stats_clear(enic->vdev);
+
+ for (index = 0; index < enic->rq_count; index++) {
++ cq_idx = enic_cq_rq(enic, enic_sop_rq(enic, index));
++
+ vnic_rq_init(&enic->rq[enic_sop_rq(enic, index)],
+- enic_cq_rq(enic, index),
++ cq_idx,
+ error_interrupt_enable,
+ error_interrupt_offset);
+
+ data_rq = &enic->rq[enic_data_rq(enic, 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 */,
+@@ -896,7 +897,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(enic, i % enic->rq_count);
+
+ err = enic_set_rss_cpu(enic,
+ rss_cpu_buf_pa,
+--
+2.7.0
+