From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 295722C0C for ; Wed, 6 Apr 2016 18:46:46 +0200 (CEST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP; 06 Apr 2016 09:46:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,447,1455004800"; d="scan'208";a="953042194" Received: from irsmsx101.ger.corp.intel.com ([163.33.3.153]) by fmsmga002.fm.intel.com with ESMTP; 06 Apr 2016 09:46:17 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by IRSMSX101.ger.corp.intel.com (163.33.3.153) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 6 Apr 2016 17:46:17 +0100 Received: from irsmsx108.ger.corp.intel.com ([169.254.11.13]) by irsmsx112.ger.corp.intel.com ([169.254.1.234]) with mapi id 14.03.0248.002; Wed, 6 Apr 2016 17:46:17 +0100 From: "Dumitrescu, Cristian" To: "Sanford, Robert" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH 1/4] app/test: enhance test_port_ring_writer Thread-Index: AQHRiTO5VjuQ7ydUk0OagVp0Axdtup91ehoAgAe60CA= Date: Wed, 6 Apr 2016 16:46:16 +0000 Message-ID: <3EB4FA525960D640B5BDFFD6A3D8912647983EA6@IRSMSX108.ger.corp.intel.com> References: <1459198297-49854-1-git-send-email-rsanford@akamai.com> <1459198297-49854-2-git-send-email-rsanford@akamai.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiMDQyMTRiMmUtOWMxMy00MWRjLWEwZTktZjdhMmU3OTljZjE2IiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IjBhRkRuUkljR3BpVHRLOWtVQzc3QlhjNTU4STBiR3VjRGEyemR5d1ZhV2c9In0= x-ctpclassification: CTP_IC 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 1/4] app/test: enhance test_port_ring_writer 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, 06 Apr 2016 16:46:46 -0000 Hi Robert, Sorry for my delay, I am traveling this week, I will reply as soon as I fin= d a slot to focus on this, hopefully in the next couple of days, thanks for= your patience. Regards, Cristian > -----Original Message----- > From: Sanford, Robert [mailto:rsanford@akamai.com] > Sent: Friday, April 1, 2016 12:43 PM > To: dev@dpdk.org; Dumitrescu, Cristian > Subject: Re: [dpdk-dev] [PATCH 1/4] app/test: enhance > test_port_ring_writer >=20 > We don't need to change this line, because we never access more than > RTE_PORT_IN_BURST_SIZE_MAX (64) elements in this array: >=20 > - struct rte_mbuf *mbuf[RTE_PORT_IN_BURST_SIZE_MAX]; > + struct rte_mbuf *mbuf[2 * RTE_PORT_IN_BURST_SIZE_MAX]; >=20 >=20 > -- > Robert >=20 > >Add code to send two 60-packet bursts to a ring port_out. > >This tests a ring writer buffer overflow problem and fix > >(in patch 2/4). > > > >Signed-off-by: Robert Sanford > >--- > > app/test/test_table_ports.c | 27 +++++++++++++++++++++++++-- > > 1 files changed, 25 insertions(+), 2 deletions(-) > > > >diff --git a/app/test/test_table_ports.c b/app/test/test_table_ports.c > >index 2532367..0c0ec0a 100644 > >--- a/app/test/test_table_ports.c > >+++ b/app/test/test_table_ports.c > >@@ -149,8 +149,8 @@ test_port_ring_writer(void) > > > > /* -- Traffic TX -- */ > > int expected_pkts, received_pkts; > >- struct rte_mbuf *mbuf[RTE_PORT_IN_BURST_SIZE_MAX]; > >- struct rte_mbuf *res_mbuf[RTE_PORT_IN_BURST_SIZE_MAX]; > >+ struct rte_mbuf *mbuf[2 * RTE_PORT_IN_BURST_SIZE_MAX]; > >+ struct rte_mbuf *res_mbuf[2 * RTE_PORT_IN_BURST_SIZE_MAX]; > > > > port_ring_writer_params.ring =3D RING_TX; > > port_ring_writer_params.tx_burst_sz =3D > RTE_PORT_IN_BURST_SIZE_MAX; > >@@ -216,5 +216,28 @@ test_port_ring_writer(void) > > for (i =3D 0; i < RTE_PORT_IN_BURST_SIZE_MAX; i++) > > rte_pktmbuf_free(res_mbuf[i]); > > > >+ /* TX Bulk - send two 60-packet bursts */ > >+ uint64_t pkt_mask =3D 0xfffffffffffffff0ULL; > >+ > >+ for (i =3D 0; i < 4; i++) > >+ mbuf[i] =3D NULL; > >+ for (i =3D 4; i < 64; i++) > >+ mbuf[i] =3D rte_pktmbuf_alloc(pool); > >+ rte_port_ring_writer_ops.f_tx_bulk(port, mbuf, pkt_mask); > >+ for (i =3D 4; i < 64; i++) > >+ mbuf[i] =3D rte_pktmbuf_alloc(pool); > >+ rte_port_ring_writer_ops.f_tx_bulk(port, mbuf, pkt_mask); > >+ rte_port_ring_writer_ops.f_flush(port); > >+ > >+ expected_pkts =3D 2 * 60; > >+ received_pkts =3D > rte_ring_sc_dequeue_burst(port_ring_writer_params.ring, > >+ (void **)res_mbuf, 2 * RTE_PORT_IN_BURST_SIZE_MAX); > >+ > >+ if (received_pkts !=3D expected_pkts) > >+ return -10; > >+ > >+ for (i =3D 0; i < received_pkts; i++) > >+ rte_pktmbuf_free(res_mbuf[i]); > >+ > > return 0; > > } > >-- > >1.7.1 >=20 >=20