From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 9F6042716 for ; Wed, 2 Nov 2016 14:15:12 +0100 (CET) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga101.jf.intel.com with ESMTP; 02 Nov 2016 06:15:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,583,1473145200"; d="scan'208";a="26580506" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.57]) ([10.237.220.57]) by orsmga005.jf.intel.com with ESMTP; 02 Nov 2016 06:15:10 -0700 To: Fulvio Risso , Mauricio Vasquez B , 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> From: Ferruh Yigit Message-ID: <200cca44-01e1-084b-ce86-0e47ca943f9a@intel.com> Date: Wed, 2 Nov 2016 13:15:09 +0000 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <7a81d33e-4b91-7dca-e6e4-f009d295bebf@polito.it> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit 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:15:13 -0000 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