From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Daley Subject: [PATCH] enic: don't set enic->config.rq_desc_count in enic_alloc_rq() Date: Thu, 17 Mar 2016 15:46:50 -0700 Message-ID: <1458254810-32283-1-git-send-email-johndale@cisco.com> Cc: Nelson Escobar To: dev@dpdk.org Return-path: 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) 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) -- 2.7.0