From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id 4966D1B264; Tue, 31 Oct 2017 10:14:53 +0100 (CET) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga105.fm.intel.com with ESMTP; 31 Oct 2017 02:14:52 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,323,1505804400"; d="scan'208";a="144201953" Received: from irsmsx110.ger.corp.intel.com ([163.33.3.25]) by orsmga004.jf.intel.com with ESMTP; 31 Oct 2017 02:14:51 -0700 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.28]) by irsmsx110.ger.corp.intel.com ([163.33.3.25]) with mapi id 14.03.0319.002; Tue, 31 Oct 2017 09:14:50 +0000 From: "Jastrzebski, MichalX K" To: "Mrzyglod, DanielX T" , "dev@dpdk.org" CC: "Mrzyglod, DanielX T" , "Liang, Cunming" , "stable@dpdk.org" , "Yigit, Ferruh" , "Jain, Deepak K" Thread-Topic: [dpdk-dev] [PATCH v2] test/pmd_perf: fix for segmentation fault Thread-Index: AQHTT0AvMHjr3sMWnEqh+3O0adD5rKL9sqSw Date: Tue, 31 Oct 2017 09:14:50 +0000 Message-ID: <60ABE07DBB3A454EB7FAD707B4BB158213C4BCE1@IRSMSX109.ger.corp.intel.com> References: <20171013142057.54980-1-michalx.k.jastrzebski@intel.com> <20171027162408.90288-1-danielx.t.mrzyglod@intel.com> In-Reply-To: <20171027162408.90288-1-danielx.t.mrzyglod@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.0.0.116 dlp-reaction: no-action x-ctpclassification: CTP_IC x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMzJhNjFmODQtYTZhZC00OTdjLTliNDAtZjgzYzgwMzdjMGI1IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE2LjUuOS4zIiwiVHJ1c3RlZExhYmVsSGFzaCI6IlM2WGFaeTlNazI2aEh1VHRIUVp6blpaYTR2SWUxbGd4Nm5uV0RRTURiVEE9In0= x-originating-ip: [163.33.239.182] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH v2] test/pmd_perf: fix for segmentation fault 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: , X-List-Received-Date: Tue, 31 Oct 2017 09:14:55 -0000 > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Daniel Mrzyglod > Sent: Friday, October 27, 2017 6:24 PM > To: dev@dpdk.org > Cc: Mrzyglod, DanielX T ; Liang, Cunming > ; stable@dpdk.org > Subject: [dpdk-dev] [PATCH v2] test/pmd_perf: fix for segmentation fault >=20 > Error can be reproduce if we run pmd_perf_autotest with more then > one device in such way: > RTE>>set_rxtx_sc poll_before_xmit > RTE>>pmd_perf_autotest >=20 > if first burst was value less than MAX_PKT_BURST in the end we overwrite > pkts_burst table for rx which was supposed for another interface. >=20 > Fixes: 002ade70e933 ("app/test: measure cycles per packet in Rx/Tx") > Cc: cunming.liang@intel.com > Cc: stable@dpdk.org >=20 > Signed-off-by: Daniel Mrzyglod > --- > test/test/test_pmd_perf.c | 15 +++++++++------ > 1 file changed, 9 insertions(+), 6 deletions(-) >=20 > diff --git a/test/test/test_pmd_perf.c b/test/test/test_pmd_perf.c > index a3e29ed..255f260 100644 > --- a/test/test/test_pmd_perf.c > +++ b/test/test/test_pmd_perf.c > @@ -572,6 +572,7 @@ poll_burst(void *args) > unsigned i, portid, nb_rx =3D 0; > uint64_t total; > uint64_t timeout =3D MAX_IDLE; > + int num[RTE_MAX_ETHPORTS]; >=20 > lcore_id =3D rte_lcore_id(); > conf =3D &lcore_conf[lcore_id]; > @@ -591,6 +592,7 @@ poll_burst(void *args) > for (i =3D 0; i < conf->nb_ports; i++) { > portid =3D conf->portlist[i]; > next[portid] =3D i * pkt_per_port; > + num[portid] =3D pkt_per_port; > } >=20 > while (!rte_atomic64_read(&start)) > @@ -601,8 +603,8 @@ poll_burst(void *args) > for (i =3D 0; i < conf->nb_ports; i++) { > portid =3D conf->portlist[i]; > nb_rx =3D rte_eth_rx_burst(portid, 0, > - &pkts_burst[next[portid]], > - MAX_PKT_BURST); > + &pkts_burst[next[portid]], > + RTE_MIN(MAX_PKT_BURST, > num[portid])); > if (unlikely(nb_rx =3D=3D 0)) { > timeout--; > if (unlikely(timeout =3D=3D 0)) > @@ -610,6 +612,7 @@ poll_burst(void *args) > continue; > } > next[portid] +=3D nb_rx; > + num[portid] -=3D nb_rx; > total -=3D nb_rx; > } > } > @@ -618,7 +621,6 @@ poll_burst(void *args) >=20 > printf("%"PRIu64" packets lost, IDLE %"PRIu64" times\n", > total, MAX_IDLE - timeout); > - > /* clean up */ > total =3D pkt_per_port * conf->nb_ports - total; > for (i =3D 0; i < total; i++) > @@ -644,7 +646,7 @@ exec_burst(uint32_t flags, int lcore) > conf =3D &lcore_conf[lcore]; >=20 > pkt_per_port =3D MAX_TRAFFIC_BURST; > - num =3D pkt_per_port; > + num =3D pkt_per_port * conf->nb_ports; >=20 > rte_atomic64_init(&start); >=20 > @@ -661,11 +663,12 @@ exec_burst(uint32_t flags, int lcore) > nb_tx =3D RTE_MIN(MAX_PKT_BURST, num); > for (i =3D 0; i < conf->nb_ports; i++) { > portid =3D conf->portlist[i]; > - rte_eth_tx_burst(portid, 0, > + nb_tx =3D rte_eth_tx_burst(portid, 0, > &tx_burst[idx], nb_tx); > idx +=3D nb_tx; > + num -=3D nb_tx; > } > - num -=3D nb_tx; > + > } >=20 > sleep(5); > -- > 2.7.4 Acked-by: Michal Jastrzebski