From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fm2nodo1.polito.it (fm2nodo1.polito.it [130.192.180.12]) by dpdk.org (Postfix) with ESMTP id 25C3E1023 for ; Wed, 2 Nov 2016 14:50:13 +0100 (CET) Received: from polito.it (frontmail2.polito.it [130.192.180.42]) by fm2nodo1.polito.it with ESMTP id uA2DoC1R001035-uA2DoC1T001035 (version=TLSv1.0 cipher=DHE-RSA-AES256-SHA bits=256 verify=CAFAIL); Wed, 2 Nov 2016 14:50:12 +0100 Received: from [190.9.209.39] (account d040768@polito.it HELO [192.168.1.58]) by polito.it (CommuniGate Pro SMTP 6.1.9) with ESMTPSA id 54295864; Wed, 02 Nov 2016 14:50:12 +0100 To: Ferruh Yigit , Fulvio Risso , bruce.richardson@intel.com References: <1477972113-2600-1-git-send-email-mauricio.vasquez@polito.it> <1478030140-7127-1-git-send-email-mauricio.vasquez@polito.it> <6c7a2a77-7370-3550-7aad-d98327f033ba@intel.com> <7a81d33e-4b91-7dca-e6e4-f009d295bebf@polito.it> <200cca44-01e1-084b-ce86-0e47ca943f9a@intel.com> From: Mauricio Vasquez Message-ID: Date: Wed, 2 Nov 2016 08:50:09 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <200cca44-01e1-084b-ce86-0e47ca943f9a@intel.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-FEAS-SYSTEM-WL: 130.192.180.42 Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH v2] net/ring: remove unnecessary NULL check 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: Wed, 02 Nov 2016 13:50:13 -0000 Dear Ferruh, You are right, I messed up the brackets. I already sent v3. Thanks, Mauricio. On 11/02/2016 08:15 AM, Ferruh Yigit wrote: > On 11/2/2016 12:49 PM, Fulvio Risso wrote: >> Dear Ferruh, >> Maybe I'm wrong, but I cannot see your point. >> The code is absolutely the same, only the following line >> >> if (eth_dev->data) { >> >> is actually removed. > Please double check the condition "rx_queues" freed: > > before the patch: > ========== > if (eth_dev->data) { > internals = eth_dev->data->dev_private; > if (internals->action == DEV_CREATE) { > /* > * it is only necessary to delete the rings in rx_queues because > * they are the same used in tx_queues > */ > for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { > r = eth_dev->data->rx_queues[i]; > rte_ring_free(r->rng); > } > } > > rte_free(eth_dev->data->rx_queues); > rte_free(eth_dev->data->tx_queues); > rte_free(eth_dev->data->dev_private); > } > ========== > > > After the patch: > ========== > internals = eth_dev->data->dev_private; > if (internals->action == DEV_CREATE) { > /* > * it is only necessary to delete the rings in rx_queues because > * they are the same used in tx_queues > */ > for (i = 0; i < eth_dev->data->nb_rx_queues; i++) { > r = eth_dev->data->rx_queues[i]; > rte_ring_free(r->rng); > } > > rte_free(eth_dev->data->rx_queues); > rte_free(eth_dev->data->tx_queues); > rte_free(eth_dev->data->dev_private); > } > ========== > > > Thanks, > ferruh >