New upstream version 18.02
[deb_dpdk.git] / lib / librte_port / rte_port_ras.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2014 Intel Corporation
3  */
4
5 #ifndef __INCLUDE_RTE_PORT_RAS_H__
6 #define __INCLUDE_RTE_PORT_RAS_H__
7
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11
12 /**
13  * @file
14  * RTE Port for IPv4 Reassembly
15  *
16  * This port is built on top of pre-initialized single producer rte_ring. In
17  * order to minimize the amount of packets stored in the ring at any given
18  * time, the IP reassembly functionality is executed on ring write operation,
19  * hence this port is implemented as an output port. A regular ring_reader port
20  * can be created to read from the same ring.
21  *
22  * The packets written to the ring are either complete IP datagrams or IP
23  * fragments. The packets read from the ring are all complete IP datagrams,
24  * either jumbo frames (i.e. IP packets with length bigger than MTU) or not.
25  * The complete IP datagrams written to the ring are not changed. The IP
26  * fragments written to the ring are first reassembled and into complete IP
27  * datagrams or dropped on error or IP reassembly time-out.
28  *
29  ***/
30
31 #include <stdint.h>
32
33 #include <rte_ring.h>
34
35 #include "rte_port.h"
36
37 /** ring_writer_ipv4_ras port parameters */
38 struct rte_port_ring_writer_ras_params {
39         /** Underlying single consumer ring that has to be pre-initialized. */
40         struct rte_ring *ring;
41
42         /** Recommended burst size to ring. The actual burst size can be bigger
43         or smaller than this value. */
44         uint32_t tx_burst_sz;
45 };
46
47 #define rte_port_ring_writer_ipv4_ras_params rte_port_ring_writer_ras_params
48
49 #define rte_port_ring_writer_ipv6_ras_params rte_port_ring_writer_ras_params
50
51 /** ring_writer_ipv4_ras port operations */
52 extern struct rte_port_out_ops rte_port_ring_writer_ipv4_ras_ops;
53
54 /** ring_writer_ipv6_ras port operations */
55 extern struct rte_port_out_ops rte_port_ring_writer_ipv6_ras_ops;
56
57 #ifdef __cplusplus
58 }
59 #endif
60
61 #endif