From patchwork Wed Oct 12 20:11:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "John Daley (johndale)" X-Patchwork-Id: 16519 X-Patchwork-Delegate: bruce.richardson@intel.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [IPv6:::1]) by dpdk.org (Postfix) with ESMTP id 30BE15683; Wed, 12 Oct 2016 22:11:33 +0200 (CEST) Received: from alln-iport-8.cisco.com (alln-iport-8.cisco.com [173.37.142.95]) by dpdk.org (Postfix) with ESMTP id 298B7374F for ; Wed, 12 Oct 2016 22:11:32 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2365; q=dns/txt; s=iport; t=1476303092; x=1477512692; h=from:to:cc:subject:date:message-id; bh=khVDUsXEc0GdW8YuwodN9NKsAXMR4QYsruVLr78f7CU=; b=iqNJ8qD/fPZ1ClY/uZLb+q2EdGTKe0BS8V5Ibg3YPLsLEBoSFBOvAGS3 eQKfvPrbweMoePVlu3FzJZ2GnM2NyfQIMmZRIO3O6zqFmzAISd1h5vryl vOHY7bypW8Bl6r19+DZFfv1N+5Gu9Lw25gEfafzZkRRAlONxx2YYTOdCR E=; X-IronPort-AV: E=Sophos;i="5.31,336,1473120000"; d="scan'208";a="334803792" Received: from rcdn-core-10.cisco.com ([173.37.93.146]) by alln-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2016 20:11:31 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-10.cisco.com (8.14.5/8.14.5) with ESMTP id u9CKBVwf008809; Wed, 12 Oct 2016 20:11:31 GMT Received: by cisco.com (Postfix, from userid 392789) id 32EC33FAAE47; Wed, 12 Oct 2016 13:11:31 -0700 (PDT) From: John Daley To: bruce.richardson@intel.com Cc: dev@dpdk.org, Nelson Escobar Date: Wed, 12 Oct 2016 13:11:28 -0700 Message-Id: <20161012201129.31611-1-johndale@cisco.com> X-Mailer: git-send-email 2.10.0 Subject: [dpdk-dev] [PATCH 1/2] net/enic: fix error in init of RQ when not using Rx scatter 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Nelson Escobar The Rx scatter patch was accidentally setting the index of the secondary receive queue in the primary receive queue's initialization when the secondary receive queue wasn't needed and was disabled. This caused some misleading hardware counters in some situations. Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx") Signed-off-by: Nelson Escobar Reviewed-by: John Daley --- drivers/net/enic/base/vnic_rq.c | 6 ++++-- drivers/net/enic/base/vnic_rq.h | 1 + drivers/net/enic/enic_main.c | 2 ++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/net/enic/base/vnic_rq.c b/drivers/net/enic/base/vnic_rq.c index 0e700a1..10a40c1 100644 --- a/drivers/net/enic/base/vnic_rq.c +++ b/drivers/net/enic/base/vnic_rq.c @@ -87,9 +87,11 @@ void vnic_rq_init_start(struct vnic_rq *rq, unsigned int cq_index, iowrite32(0, &rq->ctrl->error_status); iowrite32(fetch_index, &rq->ctrl->fetch_index); iowrite32(posted_index, &rq->ctrl->posted_index); - if (rq->is_sop) - iowrite32(((rq->is_sop << 10) | rq->data_queue_idx), + if (rq->data_queue_enable) + iowrite32(((1 << 10) | rq->data_queue_idx), &rq->ctrl->data_ring); + else + iowrite32(0, &rq->ctrl->data_ring); } void vnic_rq_init(struct vnic_rq *rq, unsigned int cq_index, diff --git a/drivers/net/enic/base/vnic_rq.h b/drivers/net/enic/base/vnic_rq.h index 7d96b0f..f3fd39f 100644 --- a/drivers/net/enic/base/vnic_rq.h +++ b/drivers/net/enic/base/vnic_rq.h @@ -91,6 +91,7 @@ struct vnic_rq { uint16_t rxst_idx; uint32_t tot_pkts; uint16_t data_queue_idx; + uint8_t data_queue_enable; uint8_t is_sop; uint8_t in_use; struct rte_mbuf *pkt_first_seg; diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 622b317..836dcfe 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -640,10 +640,12 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx, if (mbufs_per_pkt > 1) { dev_info(enic, "Rq %u Scatter rx mode in use\n", queue_idx); + rq_sop->data_queue_enable = 1; rq_data->in_use = 1; } else { dev_info(enic, "Rq %u Scatter rx mode not being used\n", queue_idx); + rq_sop->data_queue_enable = 0; rq_data->in_use = 0; }