1 /* SPDX-License-Identifier: BSD-3-Clause
3 * Copyright(c) 2019-2020 Xilinx, Inc.
4 * Copyright(c) 2018-2019 Solarflare Communications Inc.
6 * This software was jointly developed between OKTET Labs (under contract
7 * for Solarflare) and Solarflare Communications, Inc.
17 /** Standard TSO header length */
18 #define SFC_TSOH_STD_LEN 256
20 /** The number of TSO option descriptors that precede the packet descriptors */
21 #define SFC_EF10_TSO_OPT_DESCS_NUM 2
24 * The number of DMA descriptors for TSO header that may or may not precede the
25 * packet's payload descriptors
27 #define SFC_EF10_TSO_HDR_DESCS_NUM 1
29 static inline uint16_t
30 sfc_tso_ip4_get_ipid(const uint8_t *pkt_hdrp, size_t ip_hdr_off)
32 const struct rte_ipv4_hdr *ip_hdrp;
35 ip_hdrp = (const struct rte_ipv4_hdr *)(pkt_hdrp + ip_hdr_off);
36 rte_memcpy(&ipid, &ip_hdrp->packet_id, sizeof(ipid));
38 return rte_be_to_cpu_16(ipid);
41 unsigned int sfc_tso_prepare_header(uint8_t *tsoh, size_t header_len,
42 struct rte_mbuf **in_seg, size_t *in_off);
48 #endif /* _SFC_TSO_H */