xref: /dpdk/lib/port/rte_port_ras.h (revision 719834a6849e1daf4a70ff7742bbcc3ae7e25607)
199a2dd95SBruce Richardson /* SPDX-License-Identifier: BSD-3-Clause
299a2dd95SBruce Richardson  * Copyright(c) 2010-2014 Intel Corporation
399a2dd95SBruce Richardson  */
499a2dd95SBruce Richardson 
599a2dd95SBruce Richardson #ifndef __INCLUDE_RTE_PORT_RAS_H__
699a2dd95SBruce Richardson #define __INCLUDE_RTE_PORT_RAS_H__
799a2dd95SBruce Richardson 
899a2dd95SBruce Richardson /**
999a2dd95SBruce Richardson  * @file
1099a2dd95SBruce Richardson  * RTE Port for IPv4 Reassembly
1199a2dd95SBruce Richardson  *
1299a2dd95SBruce Richardson  * This port is built on top of pre-initialized single producer rte_ring. In
1399a2dd95SBruce Richardson  * order to minimize the amount of packets stored in the ring at any given
1499a2dd95SBruce Richardson  * time, the IP reassembly functionality is executed on ring write operation,
1599a2dd95SBruce Richardson  * hence this port is implemented as an output port. A regular ring_reader port
1699a2dd95SBruce Richardson  * can be created to read from the same ring.
1799a2dd95SBruce Richardson  *
1899a2dd95SBruce Richardson  * The packets written to the ring are either complete IP datagrams or IP
1999a2dd95SBruce Richardson  * fragments. The packets read from the ring are all complete IP datagrams,
2099a2dd95SBruce Richardson  * either jumbo frames (i.e. IP packets with length bigger than MTU) or not.
2199a2dd95SBruce Richardson  * The complete IP datagrams written to the ring are not changed. The IP
2299a2dd95SBruce Richardson  * fragments written to the ring are first reassembled and into complete IP
2399a2dd95SBruce Richardson  * datagrams or dropped on error or IP reassembly time-out.
243e4c5be9SThomas Monjalon  */
2599a2dd95SBruce Richardson 
2699a2dd95SBruce Richardson #include <stdint.h>
2799a2dd95SBruce Richardson 
2899a2dd95SBruce Richardson #include "rte_port.h"
2999a2dd95SBruce Richardson 
30*719834a6SMattias Rönnblom #ifdef __cplusplus
31*719834a6SMattias Rönnblom extern "C" {
32*719834a6SMattias Rönnblom #endif
33*719834a6SMattias Rönnblom 
3499a2dd95SBruce Richardson /** ring_writer_ipv4_ras port parameters */
3599a2dd95SBruce Richardson struct rte_port_ring_writer_ras_params {
3699a2dd95SBruce Richardson 	/** Underlying single consumer ring that has to be pre-initialized. */
3799a2dd95SBruce Richardson 	struct rte_ring *ring;
3899a2dd95SBruce Richardson 
3999a2dd95SBruce Richardson 	/** Recommended burst size to ring. The actual burst size can be bigger
4099a2dd95SBruce Richardson 	or smaller than this value. */
4199a2dd95SBruce Richardson 	uint32_t tx_burst_sz;
4299a2dd95SBruce Richardson };
4399a2dd95SBruce Richardson 
4499a2dd95SBruce Richardson #define rte_port_ring_writer_ipv4_ras_params rte_port_ring_writer_ras_params
4599a2dd95SBruce Richardson 
4699a2dd95SBruce Richardson #define rte_port_ring_writer_ipv6_ras_params rte_port_ring_writer_ras_params
4799a2dd95SBruce Richardson 
4899a2dd95SBruce Richardson /** ring_writer_ipv4_ras port operations */
4999a2dd95SBruce Richardson extern struct rte_port_out_ops rte_port_ring_writer_ipv4_ras_ops;
5099a2dd95SBruce Richardson 
5199a2dd95SBruce Richardson /** ring_writer_ipv6_ras port operations */
5299a2dd95SBruce Richardson extern struct rte_port_out_ops rte_port_ring_writer_ipv6_ras_ops;
5399a2dd95SBruce Richardson 
5499a2dd95SBruce Richardson #ifdef __cplusplus
5599a2dd95SBruce Richardson }
5699a2dd95SBruce Richardson #endif
5799a2dd95SBruce Richardson 
5899a2dd95SBruce Richardson #endif
59