1 From 658069b0c5994e260cd7d0a7dfc7f03d78dd4f5a Mon Sep 17 00:00:00 2001
2 From: Nelson Escobar <neescoba@cisco.com>
3 Date: Tue, 28 Jun 2016 11:49:11 -0700
4 Subject: [PATCH 24/25] net/enic: fix Rx scatter with multiple queues
6 The Rx scatter patch failed to make a few changes and resulted in
7 problems when using multiple receive queues (RQs) in DPDK (ie RSS)
8 since the wrong adapter resources were being used.
10 - get and use the correct completion queue index associated with a
12 - set the correct receive queue index when using RSS
14 Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx")
16 Signed-off-by: Nelson Escobar <neescoba@cisco.com>
17 Reviewed-by: John Daley <johndale@cisco.com>
19 drivers/net/enic/enic.h | 6 +++++-
20 drivers/net/enic/enic_main.c | 10 ++++++----
21 2 files changed, 11 insertions(+), 5 deletions(-)
23 diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
24 index 175adb8..8b0fa05 100644
25 --- a/drivers/net/enic/enic.h
26 +++ b/drivers/net/enic/enic.h
27 @@ -165,7 +165,11 @@ static inline unsigned int enic_data_rq(__rte_unused struct enic *enic, unsigned
29 static inline unsigned int enic_cq_rq(__rte_unused struct enic *enic, unsigned int rq)
32 + /* Scatter rx uses two receive queues together with one
33 + * completion queue, so the completion queue number is no
34 + * longer the same as the rq number.
39 static inline unsigned int enic_cq_wq(struct enic *enic, unsigned int wq)
40 diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
41 index 0547f3b..976c9da 100644
42 --- a/drivers/net/enic/enic_main.c
43 +++ b/drivers/net/enic/enic_main.c
44 @@ -252,19 +252,20 @@ void enic_init_vnic_resources(struct enic *enic)
45 vnic_dev_stats_clear(enic->vdev);
47 for (index = 0; index < enic->rq_count; index++) {
48 + cq_idx = enic_cq_rq(enic, enic_sop_rq(enic, index));
50 vnic_rq_init(&enic->rq[enic_sop_rq(enic, index)],
51 - enic_cq_rq(enic, index),
53 error_interrupt_enable,
54 error_interrupt_offset);
56 data_rq = &enic->rq[enic_data_rq(enic, index)];
59 - enic_cq_rq(enic, index),
61 error_interrupt_enable,
62 error_interrupt_offset);
64 - cq_idx = enic_cq_rq(enic, index);
65 vnic_cq_init(&enic->cq[cq_idx],
66 0 /* flow_control_enable */,
68 @@ -896,7 +897,8 @@ static int enic_set_rsscpu(struct enic *enic, u8 rss_hash_bits)
71 for (i = 0; i < (1 << rss_hash_bits); i++)
72 - (*rss_cpu_buf_va).cpu[i/4].b[i%4] = i % enic->rq_count;
73 + (*rss_cpu_buf_va).cpu[i / 4].b[i % 4] =
74 + enic_sop_rq(enic, i % enic->rq_count);
76 err = enic_set_rss_cpu(enic,