From patchwork Wed Oct 12 21:22:29 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: 16525 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 41D81376C; Wed, 12 Oct 2016 23:22:38 +0200 (CEST) Received: from rcdn-iport-3.cisco.com (rcdn-iport-3.cisco.com [173.37.86.74]) by dpdk.org (Postfix) with ESMTP id DC1F02952 for ; Wed, 12 Oct 2016 23:22:35 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=3223; q=dns/txt; s=iport; t=1476307356; x=1477516956; h=from:to:cc:subject:date:message-id; bh=5kgkyAEWKYtNwXNV46kkWsoIpbQgPOBE2hEYmnGTabE=; b=DoSfUWB/z3CL6Jb21mRM1eAwvy1Cnd/+jzVDzlcwz4scZNjrURn5WoIi kxYPSywYx7NC8zZprFUP8AH8WVK+SCRBMSdgxI08YMtdRUKxyCDZnH/56 AGWMGDm6dVzn8U79owbfZCjn6C+igZiDB+Y/RH1Qjxypdw22WZeMQY+AM k=; X-IronPort-AV: E=Sophos;i="5.31,485,1473120000"; d="scan'208";a="161321573" Received: from rcdn-core-4.cisco.com ([173.37.93.155]) by rcdn-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Oct 2016 21:22:35 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by rcdn-core-4.cisco.com (8.14.5/8.14.5) with ESMTP id u9CLMYUp023519; Wed, 12 Oct 2016 21:22:34 GMT Received: by cisco.com (Postfix, from userid 392789) id AEEBA3FAAE47; Wed, 12 Oct 2016 14:22:34 -0700 (PDT) From: John Daley To: bruce.richardson@intel.com Cc: dev@dpdk.org, John Daley Date: Wed, 12 Oct 2016 14:22:29 -0700 Message-Id: <20161012212229.6603-1-johndale@cisco.com> X-Mailer: git-send-email 2.10.0 Subject: [dpdk-dev] [PATCH] net/enic: fix poor multi-queue Rx performance 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" The rx_free_thresh was not being initialized and left at 0 on 1/2 of the RQs which could lead to poor multi-queue performanace. Fixes: 856d7ba7ed22 ("net/enic: support scattered Rx") Signed-off-by: John Daley Reviewed-by: Nelson Escobar --- drivers/net/enic/enic.h | 2 +- drivers/net/enic/enic_ethdev.c | 7 ++----- drivers/net/enic/enic_main.c | 8 ++++++-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h index 4ea4e4a..0d7f379 100644 --- a/drivers/net/enic/enic.h +++ b/drivers/net/enic/enic.h @@ -256,7 +256,7 @@ extern int enic_stop_rq(struct enic *enic, uint16_t queue_idx); extern void enic_free_rq(void *rxq); extern int enic_alloc_rq(struct enic *enic, uint16_t queue_idx, unsigned int socket_id, struct rte_mempool *mp, - uint16_t nb_desc); + uint16_t nb_desc, uint16_t free_thresh); extern int enic_set_rss_nic_cfg(struct enic *enic); extern int enic_set_vnic_res(struct enic *enic); extern void enic_set_hdr_split_size(struct enic *enic, u16 split_hdr_size); diff --git a/drivers/net/enic/enic_ethdev.c b/drivers/net/enic/enic_ethdev.c index 4d24bbd..ef20714 100644 --- a/drivers/net/enic/enic_ethdev.c +++ b/drivers/net/enic/enic_ethdev.c @@ -315,16 +315,13 @@ static int enicpmd_dev_rx_queue_setup(struct rte_eth_dev *eth_dev, eth_dev->data->rx_queues[queue_idx] = (void *)&enic->rq[enic_sop_rq(queue_idx)]; - ret = enic_alloc_rq(enic, queue_idx, socket_id, mp, nb_desc); + ret = enic_alloc_rq(enic, queue_idx, socket_id, mp, nb_desc, + rx_conf->rx_free_thresh); if (ret) { dev_err(enic, "error in allocating rq\n"); return ret; } - enic->rq[queue_idx].rx_free_thresh = rx_conf->rx_free_thresh; - dev_debug(enic, "Set queue_id:%u free thresh:%u\n", queue_idx, - enic->rq[queue_idx].rx_free_thresh); - return enicpmd_dev_setup_intr(enic); } diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 622b317..eb6ae08 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -603,7 +603,7 @@ int enic_stop_rq(struct enic *enic, uint16_t queue_idx) int enic_alloc_rq(struct enic *enic, uint16_t queue_idx, unsigned int socket_id, struct rte_mempool *mp, - uint16_t nb_desc) + uint16_t nb_desc, uint16_t free_thresh) { int rc; uint16_t sop_queue_idx = enic_sop_rq(queue_idx); @@ -624,6 +624,10 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx, rq_data->socket_id = socket_id; rq_data->mp = mp; rq_sop->in_use = 1; + rq_sop->rx_free_thresh = free_thresh; + rq_data->rx_free_thresh = free_thresh; + dev_debug(enic, "Set queue_id:%u free thresh:%u\n", queue_idx, + free_thresh); mbuf_size = (uint16_t)(rte_pktmbuf_data_room_size(mp) - RTE_PKTMBUF_HEADROOM); @@ -1236,7 +1240,7 @@ int enic_set_mtu(struct enic *enic, uint16_t new_mtu) enic_free_rq(rq); rc = enic_alloc_rq(enic, rq_idx, rq->socket_id, rq->mp, - rq->tot_nb_desc); + rq->tot_nb_desc, rq->rx_free_thresh); if (rc) { dev_err(enic, "Fatal MTU alloc error- No traffic will pass\n");