1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2020 Inspur Corporation
5 #ifndef _GSO_TUNNEL_UDP4_H_
6 #define _GSO_TUNNEL_UDP4_H_
12 * Segment a tunneling packet with inner UDP/IPv4 headers. This function
13 * does not check if the input packet has correct checksums, and does not
14 * update checksums for output GSO segments. Furthermore, it does not
15 * process IP fragment packets.
18 * The packet mbuf to segment.
20 * The max length of a GSO segment, measured in bytes.
22 * MBUF pool used for allocating direct buffers for output segments.
23 * @param indirect_pool
24 * MBUF pool used for allocating indirect buffers for output segments.
26 * Pointer array used to store the MBUF addresses of output GSO
27 * segments, when it succeeds. If the memory space in pkts_out is
28 * insufficient, it fails and returns -EINVAL.
30 * The max number of items that 'pkts_out' can keep.
33 * - The number of GSO segments filled in pkts_out on success.
34 * - Return 0 if it needn't GSO.
35 * - Return -ENOMEM if run out of memory in MBUF pools.
36 * - Return -EINVAL for invalid parameters.
38 int gso_tunnel_udp4_segment(struct rte_mbuf *pkt,
40 struct rte_mempool *direct_pool,
41 struct rte_mempool *indirect_pool,
42 struct rte_mbuf **pkts_out,
43 uint16_t nb_pkts_out);