1 /* SPDX-License-Identifier: BSD-3-Clause 2 * Copyright(c) 2018 Intel Corporation 3 */ 4 5 #ifndef _GSO_UDP4_H_ 6 #define _GSO_UDP4_H_ 7 8 #include <stdint.h> 9 #include <rte_mbuf.h> 10 11 /** 12 * Segment an UDP/IPv4 packet. This function doesn't check if the input 13 * packet has correct checksums, and doesn't update checksums for output 14 * GSO segments. Furthermore, it doesn't process IP fragment packets. 15 * 16 * @param pkt 17 * The packet mbuf to segment. 18 * @param gso_size 19 * The max length of a GSO segment, measured in bytes. 20 * @param direct_pool 21 * MBUF pool used for allocating direct buffers for output segments. 22 * @param indirect_pool 23 * MBUF pool used for allocating indirect buffers for output segments. 24 * @param pkts_out 25 * Pointer array used to store the MBUF addresses of output GSO 26 * segments, when the function succeeds. If the memory space in 27 * pkts_out is insufficient, it fails and returns -EINVAL. 28 * @param nb_pkts_out 29 * The max number of items that 'pkts_out' can keep. 30 * 31 * @return 32 * - The number of GSO segments filled in pkts_out on success. 33 * - Return -ENOMEM if run out of memory in MBUF pools. 34 * - Return -EINVAL for invalid parameters. 35 */ 36 int gso_udp4_segment(struct rte_mbuf *pkt, 37 uint16_t gso_size, 38 struct rte_mempool *direct_pool, 39 struct rte_mempool *indirect_pool, 40 struct rte_mbuf **pkts_out, 41 uint16_t nb_pkts_out); 42 #endif 43