From patchwork Fri Mar 18 18:33:34 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: 11594 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 B35175588; Fri, 18 Mar 2016 19:33:39 +0100 (CET) Received: from alln-iport-3.cisco.com (alln-iport-3.cisco.com [173.37.142.90]) by dpdk.org (Postfix) with ESMTP id 059893979 for ; Fri, 18 Mar 2016 19:33:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2254; q=dns/txt; s=iport; t=1458326018; x=1459535618; h=from:to:cc:subject:date:message-id:in-reply-to: references; bh=o3Imb5fkCl8pjvyde2Tw2cAteDtL1a2owq6CsIpJVPw=; b=QW6lAKnc/3yUwz9vSn9SW5+1HEasNSAsYu7ly1K81atgIXQEka3U6wtz fG8rxUQk2h/DVgJGxQApWWQUs5i8SMt+Mqty4kS79BgLZo83tKXG94p90 HS14LjMIGKVliZ/88zVlghON6GKjLM/W5Ujqw7K6vkX5epeNj/HRbLEK9 o=; X-IronPort-AV: E=Sophos;i="5.24,356,1454976000"; d="scan'208";a="250329395" Received: from alln-core-3.cisco.com ([173.36.13.136]) by alln-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 18 Mar 2016 18:33:37 +0000 Received: from cisco.com (savbu-usnic-a.cisco.com [10.193.184.48]) by alln-core-3.cisco.com (8.14.5/8.14.5) with ESMTP id u2IIXaTn031950; Fri, 18 Mar 2016 18:33:37 GMT Received: by cisco.com (Postfix, from userid 392789) id D70D53FAAD96; Fri, 18 Mar 2016 11:33:36 -0700 (PDT) From: John Daley To: dev@dpdk.org Cc: bruce.richardson@intel.com, Nelson Escobar Date: Fri, 18 Mar 2016 11:33:34 -0700 Message-Id: <1458326014-30910-1-git-send-email-johndale@cisco.com> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1458254810-32283-1-git-send-email-johndale@cisco.com> References: <1458254810-32283-1-git-send-email-johndale@cisco.com> Subject: [dpdk-dev] [PATCH v2] enic: fix incorrect setting of rx descriptor limit 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 On initialization, the rq descriptor count was set to the limit of the vic. When the requested number of rx descriptors was less than this count, enic_alloc_rq() was incorrectly setting the count to the lower value. This results in later calls to enic_alloc_rq() incorrectly using the lower value as the adapter limit. Signed-off-by: Nelson Escobar Fixes: fefed3d1e62c ("enic: new driver") Reviewed-by: John Daley --- fix checkin comment drivers/net/enic/enic_main.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c index 9fff020..cd7857f 100644 --- a/drivers/net/enic/enic_main.c +++ b/drivers/net/enic/enic_main.c @@ -524,24 +524,22 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx, "policy. Applying the value in the adapter "\ "policy (%d).\n", queue_idx, nb_desc, enic->config.rq_desc_count); - } else if (nb_desc != enic->config.rq_desc_count) { - enic->config.rq_desc_count = nb_desc; - dev_info(enic, - "RX Queues - effective number of descs:%d\n", - nb_desc); + nb_desc = enic->config.rq_desc_count; } + dev_info(enic, "RX Queues - effective number of descs:%d\n", + nb_desc); } /* Allocate queue resources */ rc = vnic_rq_alloc(enic->vdev, rq, queue_idx, - enic->config.rq_desc_count, sizeof(struct rq_enet_desc)); + nb_desc, sizeof(struct rq_enet_desc)); if (rc) { dev_err(enic, "error in allocation of rq\n"); goto err_exit; } rc = vnic_cq_alloc(enic->vdev, &enic->cq[queue_idx], queue_idx, - socket_id, enic->config.rq_desc_count, + socket_id, nb_desc, sizeof(struct cq_enet_rq_desc)); if (rc) { dev_err(enic, "error in allocation of cq for rq\n"); @@ -550,7 +548,7 @@ int enic_alloc_rq(struct enic *enic, uint16_t queue_idx, /* Allocate the mbuf ring */ rq->mbuf_ring = (struct rte_mbuf **)rte_zmalloc_socket("rq->mbuf_ring", - sizeof(struct rte_mbuf *) * enic->config.rq_desc_count, + sizeof(struct rte_mbuf *) * nb_desc, RTE_CACHE_LINE_SIZE, rq->socket_id); if (rq->mbuf_ring != NULL)