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.
35 /** ring_reader_ipv4_frag port parameters */
36 struct rte_port_ring_reader_frag_params {
37 /** Underlying single consumer ring that has to be pre-initialized. */
38 struct rte_ring *ring;
40 /** Maximum Transfer Unit (MTU). Maximum IP packet size (in bytes). */
43 /** Size of application dependent meta-data stored per each input packet
44 that has to be copied to each of the fragments originating from the
45 same input IP datagram. */
46 uint32_t metadata_size;
48 /** Pre-initialized buffer pool used for allocating direct buffers for
49 the output fragments. */
50 struct rte_mempool *pool_direct;
52 /** Pre-initialized buffer pool used for allocating indirect buffers for
53 the output fragments. */
54 struct rte_mempool *pool_indirect;
57 #define rte_port_ring_reader_ipv4_frag_params rte_port_ring_reader_frag_params
59 #define rte_port_ring_reader_ipv6_frag_params rte_port_ring_reader_frag_params
61 /** ring_reader_ipv4_frag port operations */
62 extern struct rte_port_in_ops rte_port_ring_reader_ipv4_frag_ops;
64 /** ring_reader_ipv6_frag port operations */
65 extern struct rte_port_in_ops rte_port_ring_reader_ipv6_frag_ops;