1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2014 Intel Corporation
5 #ifndef __INCLUDE_RTE_PORT_IP_FRAG_H__
6 #define __INCLUDE_RTE_PORT_IP_FRAG_H__
14 * RTE Port for IPv4 Fragmentation
16 * This port is built on top of pre-initialized single consumer rte_ring. In
17 * order to minimize the amount of packets stored in the ring at any given
18 * time, the IP fragmentation functionality is executed on ring read operation,
19 * hence this port is implemented as an input port. A regular ring_writer port
20 * can be created to write to the same ring.
22 * The packets written to the ring are either complete IP datagrams or jumbo
23 * frames (i.e. IP packets with length bigger than provided MTU value). The
24 * packets read from the ring are all non-jumbo frames. The complete IP
25 * datagrams written to the ring are not changed. The jumbo frames are
26 * fragmented into several IP packets with length less or equal to MTU.
36 /** ring_reader_ipv4_frag port parameters */
37 struct rte_port_ring_reader_frag_params {
38 /** Underlying single consumer ring that has to be pre-initialized. */
39 struct rte_ring *ring;
41 /** Maximum Transfer Unit (MTU). Maximum IP packet size (in bytes). */
44 /** Size of application dependent meta-data stored per each input packet
45 that has to be copied to each of the fragments originating from the
46 same input IP datagram. */
47 uint32_t metadata_size;
49 /** Pre-initialized buffer pool used for allocating direct buffers for
50 the output fragments. */
51 struct rte_mempool *pool_direct;
53 /** Pre-initialized buffer pool used for allocating indirect buffers for
54 the output fragments. */
55 struct rte_mempool *pool_indirect;
58 #define rte_port_ring_reader_ipv4_frag_params rte_port_ring_reader_frag_params
60 #define rte_port_ring_reader_ipv6_frag_params rte_port_ring_reader_frag_params
62 /** ring_reader_ipv4_frag port operations */
63 extern struct rte_port_in_ops rte_port_ring_reader_ipv4_frag_ops;
65 /** ring_reader_ipv6_frag port operations */
66 extern struct rte_port_in_ops rte_port_ring_reader_ipv6_frag_ops;