From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 508B311C5 for ; Wed, 14 Sep 2016 16:00:34 +0200 (CEST) Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga103.jf.intel.com with ESMTP; 14 Sep 2016 07:00:21 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.30,334,1470726000"; d="scan'208";a="1050167173" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.117]) ([10.237.220.117]) by orsmga002.jf.intel.com with ESMTP; 14 Sep 2016 07:00:20 -0700 To: Rich Lane , dev@dpdk.org References: <1470166496-70610-1-git-send-email-rich.lane@bigswitch.com> Cc: Helin Zhang , Jingjing Wu From: Ferruh Yigit Message-ID: <7d569e83-6310-b1d6-c727-be5d0d9f3103@intel.com> Date: Wed, 14 Sep 2016 15:00:19 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1470166496-70610-1-git-send-email-rich.lane@bigswitch.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix null pointer dereferences when using VMDQ+RSS 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, 14 Sep 2016 14:00:34 -0000 On 8/2/2016 8:34 PM, Rich Lane wrote: > When using VMDQ+RSS, the queue ids used by the application are not > contiguous (see i40e_pf_config_rss). Most of the driver already handled > this, but there were a few cases where it assumed all configured queues > had been setup. > > Fixes: 4861cde46116 ("i40e: new poll mode driver") > Fixes: 6b4537128394 ("i40e: free queue memory when closing") > Fixes: 8e109464c022 ("i40e: allow vector Rx and Tx usage") > > Signed-off-by: Rich Lane > --- > drivers/net/i40e/i40e_rxtx.c | 15 ++++++++++++--- > 1 file changed, 12 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c > index 554d167..0556a4d 100644 > --- a/drivers/net/i40e/i40e_rxtx.c > +++ b/drivers/net/i40e/i40e_rxtx.c > @@ -2948,11 +2948,15 @@ i40e_dev_clear_queues(struct rte_eth_dev *dev) > PMD_INIT_FUNC_TRACE(); > > for (i = 0; i < dev->data->nb_tx_queues; i++) { > + if (!dev->data->tx_queues[i]) > + continue; > i40e_tx_queue_release_mbufs(dev->data->tx_queues[i]); > i40e_reset_tx_queue(dev->data->tx_queues[i]); > } > > for (i = 0; i < dev->data->nb_rx_queues; i++) { > + if (!dev->data->rx_queues[i]) > + continue; > i40e_rx_queue_release_mbufs(dev->data->rx_queues[i]); > i40e_reset_rx_queue(dev->data->rx_queues[i]); > } > @@ -2966,12 +2970,16 @@ i40e_dev_free_queues(struct rte_eth_dev *dev) > PMD_INIT_FUNC_TRACE(); > > for (i = 0; i < dev->data->nb_rx_queues; i++) { > + if (!dev->data->rx_queues[i]) > + continue; > i40e_dev_rx_queue_release(dev->data->rx_queues[i]); > dev->data->rx_queues[i] = NULL; > } > dev->data->nb_rx_queues = 0; > > for (i = 0; i < dev->data->nb_tx_queues; i++) { > + if (!dev->data->tx_queues[i]) > + continue; > i40e_dev_tx_queue_release(dev->data->tx_queues[i]); > dev->data->tx_queues[i] = NULL; > } > @@ -3154,7 +3162,7 @@ i40e_set_rx_function(struct rte_eth_dev *dev) > struct i40e_rx_queue *rxq = > dev->data->rx_queues[i]; > > - if (i40e_rxq_vec_setup(rxq)) { > + if (rxq && i40e_rxq_vec_setup(rxq)) { > ad->rx_vec_allowed = false; > break; > } > @@ -3216,7 +3224,8 @@ i40e_set_rx_function(struct rte_eth_dev *dev) > for (i = 0; i < dev->data->nb_rx_queues; i++) { > struct i40e_rx_queue *rxq = dev->data->rx_queues[i]; > > - rxq->rx_using_sse = rx_using_sse; > + if (rxq) > + rxq->rx_using_sse = rx_using_sse; > } > } > } > @@ -3255,7 +3264,7 @@ i40e_set_tx_function(struct rte_eth_dev *dev) > struct i40e_tx_queue *txq = > dev->data->tx_queues[i]; > > - if (i40e_txq_vec_setup(txq)) { > + if (txq && i40e_txq_vec_setup(txq)) { > ad->tx_vec_allowed = false; > break; > } > i40e maintainers, can you please review the patch? Thanks, ferruh