42 static inline uint32_t
43 __rte_raw_cksum(
const void *buf,
size_t len, uint32_t sum)
48 buf != end; buf =
RTE_PTR_ADD(buf,
sizeof(uint16_t))) {
51 memcpy(&v, buf,
sizeof(uint16_t));
59 memcpy(&left, end, 1);
75 static inline uint16_t
76 __rte_raw_cksum_reduce(uint32_t sum)
78 sum = ((sum & 0xffff0000) >> 16) + (sum & 0xffff);
79 sum = ((sum & 0xffff0000) >> 16) + (sum & 0xffff);
93 static inline uint16_t
98 sum = __rte_raw_cksum(buf, len, 0);
99 return __rte_raw_cksum_reduce(sum);
123 uint32_t seglen, done;
128 const char *, off), len);
137 for (seg = m; seg != NULL; seg = seg->
next) {
143 RTE_ASSERT(seg != NULL);
158 tmp = __rte_raw_cksum(buf, seglen, 0);
168 if (seglen > len - done)
172 *cksum = __rte_raw_cksum_reduce(sum);
#define RTE_ALIGN_FLOOR(val, align)
static uint16_t rte_bswap16(uint16_t _x)
#define rte_pktmbuf_mtod_offset(m, t, o)
#define RTE_PTR_ADD(ptr, x)
#define rte_pktmbuf_mtod(m, t)
static uint16_t rte_raw_cksum(const void *buf, size_t len)
#define rte_pktmbuf_pkt_len(m)
#define rte_pktmbuf_data_len(m)
static int rte_raw_cksum_mbuf(const struct rte_mbuf *m, uint32_t off, uint32_t len, uint16_t *cksum)