From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id 23067A0471 for ; Fri, 21 Jun 2019 11:03:04 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 965BC1D581; Fri, 21 Jun 2019 11:03:02 +0200 (CEST) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id C3FB71D54D; Fri, 21 Jun 2019 11:03:00 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2019 02:02:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,399,1557212400"; d="scan'208";a="160921857" Received: from fmsmsx104.amr.corp.intel.com ([10.18.124.202]) by fmsmga008.fm.intel.com with ESMTP; 21 Jun 2019 02:02:59 -0700 Received: from fmsmsx118.amr.corp.intel.com (10.18.116.18) by fmsmsx104.amr.corp.intel.com (10.18.124.202) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 21 Jun 2019 02:02:58 -0700 Received: from shsmsx101.ccr.corp.intel.com (10.239.4.153) by fmsmsx118.amr.corp.intel.com (10.18.116.18) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 21 Jun 2019 02:02:58 -0700 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.72]) by SHSMSX101.ccr.corp.intel.com ([169.254.1.104]) with mapi id 14.03.0439.000; Fri, 21 Jun 2019 17:02:57 +0800 From: "Pei, Andy" To: "Ye, Xiaolong" CC: "dev@dpdk.org" , "Zhang, Helin" , "stable@dpdk.org" , "Zhang, Roy Fan" , "Zhang, Qi Z" , "Wu, Jingjing" , "Xing, Beilei" , "Yigit, Ferruh" , "Xu, Rosen" Thread-Topic: [dpdk-dev] [PATCH] net/i40e: fix core dumped when setting txq or rxq to 0 in VF Thread-Index: AQHVJ+5QzwbzJYveIUaBGRusG5wmdaalz4mw Date: Fri, 21 Jun 2019 09:02:56 +0000 Message-ID: <5941F446C088714A85408FA3132CFCBB01036793@SHSMSX105.ccr.corp.intel.com> References: <1561091696-213124-1-git-send-email-andy.pei@intel.com> <20190621114224.GA42981@intel.com> In-Reply-To: <20190621114224.GA42981@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.2.0.6 dlp-reaction: no-action x-originating-ip: [10.239.127.40] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix core dumped when setting txq or rxq to 0 in VF X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" HI -----Original Message----- From: Ye, Xiaolong=20 Sent: Friday, June 21, 2019 7:42 PM To: Pei, Andy Cc: dev@dpdk.org; Zhang, Helin ; stable@dpdk.org; Zh= ang, Roy Fan ; Zhang, Qi Z ;= Wu, Jingjing ; Xing, Beilei = ; Yigit, Ferruh ; Xu, Rosen Subject: Re: [dpdk-dev] [PATCH] net/i40e: fix core dumped when setting txq = or rxq to 0 in VF On 06/21, Andy Pei wrote: >Testpmd stucked and core dumped >when set invalid VF queue number. >This patch fix this issue. It's better to wrap the commit message within 72 characters. Perhaps someth= ing like: Testpmd would stuck and result in core dump when user specifies an invalid = VF queue number. This patch fixes this issue. What do you think? > >Fixes: d6b19729093e ("i40evf: support configurable crc stripping") >Cc: helin.zhang@intel.com >Cc: stable@dpdk.org > >Signed-off-by: Andy Pei >--- >Cc: roy.fan.zhang@intel.com >Cc: qi.z.zhang@intel.com >Cc: jingjing.wu@intel.com >Cc: beilei.xing@intel.com >Cc: ferruh.yigit@intel.com >Cc: rosen.xu@intel.com > > drivers/net/i40e/i40e_ethdev_vf.c | 35=20 > ++++++++++++++++++++++++++++------- > 1 file changed, 28 insertions(+), 7 deletions(-) > >diff --git a/drivers/net/i40e/i40e_ethdev_vf.c=20 >b/drivers/net/i40e/i40e_ethdev_vf.c >index 63dbe14..7096cc5 100644 >--- a/drivers/net/i40e/i40e_ethdev_vf.c >+++ b/drivers/net/i40e/i40e_ethdev_vf.c >@@ -573,7 +573,7 @@ struct rte_i40evf_xstats_name_off { { > txq_info->vsi_id =3D vsi_id; > txq_info->queue_id =3D queue_id; >- if (queue_id < nb_txq) { >+ if ((queue_id < nb_txq) && txq) { > txq_info->ring_len =3D txq->nb_tx_desc; > txq_info->dma_ring_addr =3D txq->tx_ring_phys_addr; > } >@@ -590,7 +590,7 @@ struct rte_i40evf_xstats_name_off { > rxq_info->vsi_id =3D vsi_id; > rxq_info->queue_id =3D queue_id; > rxq_info->max_pkt_size =3D max_pkt_size; >- if (queue_id < nb_rxq) { >+ if ((queue_id < nb_rxq) && rxq) { > rxq_info->ring_len =3D rxq->nb_rx_desc; > rxq_info->dma_ring_addr =3D rxq->rx_ring_phys_addr; > rxq_info->databuffer_size =3D >@@ -622,11 +622,32 @@ struct rte_i40evf_xstats_name_off { > vc_vqci->num_queue_pairs =3D nb_qp; >=20 > for (i =3D 0, vc_qpi =3D vc_vqci->qpair; i < nb_qp; i++, vc_qpi++) { >- i40evf_fill_virtchnl_vsi_txq_info(&vc_qpi->txq, >- vc_vqci->vsi_id, i, dev->data->nb_tx_queues, txq[i]); >- i40evf_fill_virtchnl_vsi_rxq_info(&vc_qpi->rxq, >- vc_vqci->vsi_id, i, dev->data->nb_rx_queues, >- vf->max_pkt_len, rxq[i]); >+ if (!txq) >+ i40evf_fill_virtchnl_vsi_txq_info(&vc_qpi->txq, >+ vc_vqci->vsi_id, >+ i, >+ dev->data->nb_tx_queues, >+ NULL); >+ else >+ i40evf_fill_virtchnl_vsi_txq_info(&vc_qpi->txq, >+ vc_vqci->vsi_id, >+ i, >+ dev->data->nb_tx_queues, >+ txq[i]); >+ if (!rxq) >+ i40evf_fill_virtchnl_vsi_rxq_info(&vc_qpi->rxq, >+ vc_vqci->vsi_id, >+ i, >+ dev->data->nb_rx_queues, >+ vf->max_pkt_len, >+ NULL); >+ else >+ i40evf_fill_virtchnl_vsi_rxq_info(&vc_qpi->rxq, >+ vc_vqci->vsi_id, >+ i, >+ dev->data->nb_rx_queues, >+ vf->max_pkt_len, >+ rxq[i]); No need to use one line for each parameter, I think you can still use the o= ld format. A tab is added at the beginning of the line, so the old format will exceed = 80 characters. So I suggests for use a new format but not one line for each parameter. A new line comes if the upper line is more than 80 characters. I will do this in v3 Thanks, Xiaolong > } > memset(&args, 0, sizeof(args)); > args.ops =3D VIRTCHNL_OP_CONFIG_VSI_QUEUES; >-- >1.8.3.1 >