1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2018 Intel Corporation
5 #ifndef _SAMPLE_PACKET_FORWARD_H_
6 #define _SAMPLE_PACKET_FORWARD_H_
10 /* MACROS to support virtual ring creation */
15 #define NUM_PACKETS 10
21 /* Sample test to create virtual rings and tx,rx portid from rings */
22 int test_ring_setup(struct rte_ring **ring, uint16_t *portid);
24 /* configure and start device created by test_ring_setup */
25 int test_dev_start(uint16_t port, struct rte_mempool *mp);
27 /* Sample test to free the virtual rings */
28 void test_ring_free(struct rte_ring *rxtx);
30 /* Sample test to forward packet using virtual port id */
31 int test_packet_forward(struct rte_mbuf **pbuf, uint16_t portid,
34 /* sample test to allocate buffer for pkts */
35 int test_get_mbuf_from_pool(struct rte_mempool **mp, struct rte_mbuf **pbuf,
38 /* Sample test to create the mempool */
39 int test_get_mempool(struct rte_mempool **mp, char *poolname);
41 /* sample test to deallocate the allocated buffers and mempool */
42 void test_put_mbuf_to_pool(struct rte_mempool *mp, struct rte_mbuf **pbuf);
44 /* Sample test to free the mempool */
45 void test_mp_free(struct rte_mempool *mp);
47 /* Sample test to release the vdev */
48 void test_vdev_uninit(const char *vdev);
50 #endif /* _SAMPLE_PACKET_FORWARD_H_ */