From patchwork Thu Mar 17 22:46:50 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: 11574 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 349985684; Thu, 17 Mar 2016 23:47:14 +0100 (CET) Received: from rcdn-iport-8.cisco.com (rcdn-iport-8.cisco.com [173.37.86.79]) by dpdk.org (Postfix) with ESMTP id 3FACF5681 for ; Thu, 17 Mar 2016 23:47:13 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=2096; q=dns/txt; s=iport; t=1458254833; x=1459464433; h=from:to:cc:subject:date:message-id; bh=zSWFABjj2Ga663gS9dt8gQRlS62+PNzU/TJntRAOGtI=; b=YE+tk6QjNlEqQ88kI5fjddtOwG7a57+FE5RGrfdKjTNYhGYTAV4YZse1 PlOndhcHGcQaBakEWa0NB/CFa/vVBywJ57sJAtqlDp+InVvbU+7OMHDTB saMMChoNRirXAMmMt/WfvjXWFR/+TespKIJ3NU5iMJYMdqFvlpyvdJAVp o=; X-IronPort-AV: E=Sophos;i="5.24,351,1454976000"; d="scan'208";a="82196100" Received: from alln-core-7.cisco.com ([173.36.13.140]) by rcdn-iport-8.cisco.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 17 Mar 2016 22:47:12 +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 u2HMlC73003032; Thu, 17 Mar 2016 22:47:12 GMT Received: by cisco.com (Postfix, from userid 392789) id 0BEA23FAAD77; Thu, 17 Mar 2016 15:47:12 -0700 (PDT) From: John Daley To: dev@dpdk.org Cc: Nelson Escobar Date: Thu, 17 Mar 2016 15:46:50 -0700 Message-Id: <1458254810-32283-1-git-send-email-johndale@cisco.com> X-Mailer: git-send-email 2.7.0 Subject: [dpdk-dev] [PATCH] enic: don't set enic->config.rq_desc_count in enic_alloc_rq() 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 When the requested number of rx descriptors was less than the amount configured on the vic, enic_alloc_rq() was incorrectly setting enic->config.rq_desc_count to the lower value. This screwed up later calls to enic_alloc_rq(). Signed-off-by: Nelson Escobar Reviewed-by: John Daley --- 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)