dpdk/app/test/sample_packet_forward.h
<<
>>
Prefs
   1/* SPDX-License-Identifier: BSD-3-Clause
   2 * Copyright(c) 2018 Intel Corporation
   3 */
   4
   5#ifndef _SAMPLE_PACKET_FORWARD_H_
   6#define _SAMPLE_PACKET_FORWARD_H_
   7
   8#include <stdint.h>
   9
  10/* MACROS to support virtual ring creation */
  11#define RING_SIZE 256
  12#define NUM_QUEUES 1
  13#define NB_MBUF 512
  14
  15#define NUM_PACKETS 10
  16
  17struct rte_mbuf;
  18struct rte_mempool;
  19struct rte_ring;
  20
  21/* Sample test to create virtual rings and tx,rx portid from rings */
  22int test_ring_setup(struct rte_ring **ring, uint16_t *portid);
  23
  24/* configure and start device created by test_ring_setup */
  25int test_dev_start(uint16_t port, struct rte_mempool *mp);
  26
  27/* Sample test to free the virtual rings */
  28void test_ring_free(struct rte_ring *rxtx);
  29
  30/* Sample test to forward packet using virtual port id */
  31int test_packet_forward(struct rte_mbuf **pbuf, uint16_t portid,
  32                uint16_t queue_id);
  33
  34/* sample test to allocate buffer for pkts */
  35int test_get_mbuf_from_pool(struct rte_mempool **mp, struct rte_mbuf **pbuf,
  36                char *poolname);
  37
  38/* Sample test to create the mempool */
  39int test_get_mempool(struct rte_mempool **mp, char *poolname);
  40
  41/* sample test to deallocate the allocated buffers and mempool */
  42void test_put_mbuf_to_pool(struct rte_mempool *mp, struct rte_mbuf **pbuf);
  43
  44/* Sample test to free the mempool */
  45void test_mp_free(struct rte_mempool *mp);
  46
  47/* Sample test to release the vdev */
  48void test_vdev_uninit(const char *vdev);
  49
  50#endif /* _SAMPLE_PACKET_FORWARD_H_ */
  51