MCPcopy Create free account
hub / github.com/F-Stack/f-stack / gso_tcp4_segment

Function gso_tcp4_segment

dpdk/lib/gso/gso_tcp4.c:34–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32}
33
34int
35gso_tcp4_segment(struct rte_mbuf *pkt,
36 uint16_t gso_size,
37 uint8_t ipid_delta,
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{
43 struct rte_ipv4_hdr *ipv4_hdr;
44 uint16_t pyld_unit_size, hdr_offset;
45 uint16_t frag_off;
46 int ret;
47
48 /* Don't process the fragmented packet */
49 ipv4_hdr = (struct rte_ipv4_hdr *)(rte_pktmbuf_mtod(pkt, char *) +
50 pkt->l2_len);
51 frag_off = rte_be_to_cpu_16(ipv4_hdr->fragment_offset);
52 if (unlikely(IS_FRAGMENTED(frag_off))) {
53 return 0;
54 }
55
56 /* Don't process the packet without data */
57 hdr_offset = pkt->l2_len + pkt->l3_len + pkt->l4_len;
58 if (unlikely(hdr_offset >= pkt->pkt_len)) {
59 return 0;
60 }
61
62 pyld_unit_size = gso_size - hdr_offset;
63
64 /* Segment the payload */
65 ret = gso_do_segment(pkt, hdr_offset, pyld_unit_size, direct_pool,
66 indirect_pool, pkts_out, nb_pkts_out);
67 if (ret > 1)
68 update_ipv4_tcp_headers(pkt, ipid_delta, pkts_out, ret);
69
70 return ret;
71}

Callers 1

rte_gso_segmentFunction · 0.85

Calls 2

gso_do_segmentFunction · 0.85
update_ipv4_tcp_headersFunction · 0.85

Tested by

no test coverage detected