From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74]) by dpdk.org (Postfix) with ESMTP id CDB982906 for ; Tue, 28 Jun 2016 20:49:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2518; q=dns/txt; s=iport; t=1467139781; x=1468349381; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=QtNHsP3C6FvYZOSLWMgN3zRg3chHkl/adTQ/RghLZFo=; b=LMYpO+hEY1nk0+AVtocd6qBYNpQL80alHJO05IVCs2/tVjdjz6yGG6XG SeUaZyWpTPd7L0K0jnGn3iZt8Ponr7gGfBedp/iJN9K4fb6un2wb1R7ke 39jofQ2dyWOxL7nPHRjPwqb7Z8LXuitRD4OIb2+bJG04P7FJDj8crFlHV g=; X-IronPort-AV: E=Sophos;i="5.26,542,1459814400"; d="scan'208";a="123577026" Received: from alln-core-7.cisco.com ([173.36.13.140]) by rcdn-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 28 Jun 2016 18:49:40 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-7.cisco.com (8.14.5/8.14.5) with ESMTP id u5SIneYR030084; Tue, 28 Jun 2016 18:49:40 GMT Received: by cisco.com (Postfix, from userid 412739) id 928723FAAD77; Tue, 28 Jun 2016 11:49:40 -0700 (PDT) From: Nelson Escobar To: dev@dpdk.org Cc: bruce.richardson@intel.com, Nelson Escobar Date: Tue, 28 Jun 2016 11:49:11 -0700 Message-Id: <1467139751-31925-1-git-send-email-neescoba@cisco.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <20160628111256.GD22860@bricha3-MOBL3> References: <20160628111256.GD22860@bricha3-MOBL3> Subject: [dpdk-dev] [PATCH v2] enic: fix issues when using Rx scatter with multiple RQs X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 Jun 2016 18:49:42 -0000 The Rx scatter patch failed to make a few changes and resulted in problems when using multiple receive queues 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: 14a261bf0520 ("enic: add scattered Rx support") Signed-off-by: Nelson Escobar Reviewed-by: John Daley --- 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 ed5f18d..1dd8aee 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h @@ -174,7 +174,11 @@ 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; + /* 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 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