Hi Jananee,
> -----Original Message----- > From: Parthasarathy, JananeeX M > Sent: Friday, July 6, 2018 6:07 PM > To: [email protected] > Cc: Horton, Remy <[email protected]>; Pattan, Reshma > <[email protected]>; Parthasarathy, JananeeX M > <[email protected]>; Chaitanya Babu, TalluriX > <[email protected]> > Subject: [PATCH] add sample functions for packet forwarding > > From: Jananee Parthasarathy <[email protected]> > > Add sample test functions for packet forwarding. > These can be used for unit test cases for LatencyStats and BitrateStats > libraries. > > Signed-off-by: Chaitanya Babu Talluri <[email protected]> > Reviewed-by: Reshma Pattan <[email protected]> > --- > 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 = rte_socket_id(); > + rxtx[1] = rte_ring_create("R1", RING_SIZE, socket_id, > + RING_F_SP_ENQ|RING_F_SC_DEQ); > + if (rxtx[1] == NULL) { > + printf("%s() line %u: rte_ring_create R1 failed", > + __func__, __LINE__); > + return TEST_FAILED; > + } > + tx_portid = rte_eth_from_rings("net_ringa", rxtx, NUM_RINGS, rxtx, > + NUM_RINGS, SOCKET0); > + rx_portid = 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 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_burst and rx_burst. Thanks, Reshma

