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 51124A0471 for ; Fri, 21 Jun 2019 10:17:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2AB331D56B; Fri, 21 Jun 2019 10:17:43 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 0FF571D56A; Fri, 21 Jun 2019 10:17:40 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 Jun 2019 01:17:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,399,1557212400"; d="scan'208";a="311927443" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga004.jf.intel.com with ESMTP; 21 Jun 2019 01:17:38 -0700 Received: from FMSMSX109.amr.corp.intel.com (10.18.116.9) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 21 Jun 2019 01:17:38 -0700 Received: from shsmsx106.ccr.corp.intel.com (10.239.4.159) by fmsmsx109.amr.corp.intel.com (10.18.116.9) with Microsoft SMTP Server (TLS) id 14.3.439.0; Fri, 21 Jun 2019 01:17:38 -0700 Received: from shsmsx105.ccr.corp.intel.com ([169.254.11.72]) by SHSMSX106.ccr.corp.intel.com ([169.254.10.89]) with mapi id 14.03.0439.000; Fri, 21 Jun 2019 16:17:36 +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+5QzwbzJYveIUaBGRusG5wmdaalw3Cw Date: Fri, 21 Jun 2019 08:17:35 +0000 Message-ID: <5941F446C088714A85408FA3132CFCBB0103674C@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 Xiaolong, Will do in this way in V2. Thanks=20 -----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. Thanks, Xiaolong > } > memset(&args, 0, sizeof(args)); > args.ops =3D VIRTCHNL_OP_CONFIG_VSI_QUEUES; >-- >1.8.3.1 >