From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 4A0C61BBE for ; Fri, 18 Mar 2016 11:24:42 +0100 (CET) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP; 18 Mar 2016 03:24:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,354,1455004800"; d="scan'208";a="936700906" Received: from bricha3-mobl3.ger.corp.intel.com ([10.237.221.44]) by orsmga002.jf.intel.com with SMTP; 18 Mar 2016 03:24:39 -0700 Received: by (sSMTP sendmail emulation); Fri, 18 Mar 2016 10:24:38 +0025 Date: Fri, 18 Mar 2016 10:24:38 +0000 From: Bruce Richardson To: John Daley Cc: dev@dpdk.org, Nelson Escobar Message-ID: <20160318102438.GD4848@bricha3-MOBL3> References: <1458254810-32283-1-git-send-email-johndale@cisco.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1458254810-32283-1-git-send-email-johndale@cisco.com> Organization: Intel Shannon Ltd. User-Agent: Mutt/1.5.23 (2014-03-12) Subject: Re: [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: , X-List-Received-Date: Fri, 18 Mar 2016 10:24:42 -0000 On Thu, Mar 17, 2016 at 03:46:50PM -0700, John Daley wrote: > 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(). Can you perhaps clarify what exactly happened when the calls got "screwed up"? Did the calls just fail, making the queue unusable, or did it crash the application, or something else. Similarly, can you perhaps reword the patch title to start with the word "fix" as this patch is for a bug-fix, and describe in a couple of words there what the bug was that was being fixed e.g. "fix rx queue lockup", rather than describing the technicalities of the fix. In general, try to avoid using function or variable names in the titles of messages. Lastly, can you please include a "Fixes" line in the message, as described here: http://dpdk.org/doc/guides/contributing/patches.html#commit-messages-body Thanks, /Bruce > > 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 >