From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by dpdk.org (Postfix) with ESMTP id 4DB801B44A for ; Tue, 10 Jul 2018 11:53:51 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jul 2018 02:53:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,334,1526367600"; d="scan'208";a="71060331" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by fmsmga001.fm.intel.com with ESMTP; 10 Jul 2018 02:53:49 -0700 Received: from irsmsx112.ger.corp.intel.com (10.108.20.5) by irsmsx105.ger.corp.intel.com (163.33.3.28) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 10 Jul 2018 10:53:48 +0100 Received: from irsmsx109.ger.corp.intel.com ([169.254.13.124]) by irsmsx112.ger.corp.intel.com ([169.254.1.22]) with mapi id 14.03.0319.002; Tue, 10 Jul 2018 10:53:48 +0100 From: "Pattan, Reshma" To: "Parthasarathy, JananeeX M" , "dev@dpdk.org" CC: "Horton, Remy" , "Chaitanya Babu, TalluriX" Thread-Topic: [PATCH] add sample functions for packet forwarding Thread-Index: AQHUFUvXTOsf9mY5xk+DGKoxaiiaOaSIM9Pg Date: Tue, 10 Jul 2018 09:53:48 +0000 Message-ID: <3AEA2BF9852C6F48A459DA490692831F2A36D1AD@IRSMSX109.ger.corp.intel.com> References: <1530896835-19629-1-git-send-email-jananeex.m.parthasarathy@intel.com> In-Reply-To: <1530896835-19629-1-git-send-email-jananeex.m.parthasarathy@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.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Subject: Re: [dpdk-dev] [PATCH] add sample functions for packet forwarding 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, 10 Jul 2018 09:53:53 -0000 Hi Jananee, > -----Original Message----- > From: Parthasarathy, JananeeX M > Sent: Friday, July 6, 2018 6:07 PM > To: dev@dpdk.org > Cc: Horton, Remy ; Pattan, Reshma > ; Parthasarathy, JananeeX M > ; Chaitanya Babu, TalluriX > > Subject: [PATCH] add sample functions for packet forwarding >=20 > From: Jananee Parthasarathy >=20 > Add sample test functions for packet forwarding. > These can be used for unit test cases for LatencyStats and BitrateStats > libraries. >=20 > Signed-off-by: Chaitanya Babu Talluri > Reviewed-by: Reshma Pattan > --- > a/test/test/sample_packet_forward.c b/test/test/sample_packet_forward.c > new file mode 100644 > index 000000000..6f66b83f8 > --- /dev/null > +++ b/test/test/sample_packet_forward.c > @@ -0,0 +1,80 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(c) 2018 Intel Corporation > + */ > +int > +test_ring_setup(void) > +{ > + uint16_t socket_id =3D rte_socket_id(); > + rxtx[1] =3D rte_ring_create("R1", RING_SIZE, socket_id, > + RING_F_SP_ENQ|RING_F_SC_DEQ); > + if (rxtx[1] =3D=3D NULL) { > + printf("%s() line %u: rte_ring_create R1 failed", > + __func__, __LINE__); > + return TEST_FAILED; > + } > + tx_portid =3D rte_eth_from_rings("net_ringa", rxtx, NUM_RINGS, rxtx, > + NUM_RINGS, SOCKET0); > + rx_portid =3D rte_eth_from_rings("net_ringb", rxtx, NUM_RINGS, rxtx, > + NUM_RINGS, SOCKET0); > + Here also socket_id should be used, so u can remove SOCKET0 and its macro. > diff --git a/test/test/sample_packet_forward.h > b/test/test/sample_packet_forward.h #define SOCKET0 0=20 This can be removed now as rte_socke_id() is used now. #define > +RING_SIZE 256 #define NUM_RINGS 2 Instead of NUM_RINGS, you can name it as NUM_QUEUES. You can have this value as 1, as you are using only 1 queue anyway in *tx_b= urst and rx_burst. Thanks, Reshma