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

Function v6_allocate_packet_of

dpdk/app/test/test_ipfrag.c:221–243  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221static void
222v6_allocate_packet_of(struct rte_mbuf *b, int fill, size_t s, uint8_t ttl,
223 uint8_t proto, uint16_t pktid)
224{
225 /* Create a packet, 2k bytes long */
226 b->data_off = 0;
227 char *data = rte_pktmbuf_mtod(b, char *);
228
229 memset(data, fill, sizeof(struct rte_ipv6_hdr) + s);
230
231 struct rte_ipv6_hdr *hdr = (struct rte_ipv6_hdr *)data;
232 b->pkt_len = s + sizeof(struct rte_ipv6_hdr);
233 b->data_len = b->pkt_len;
234
235 /* basic v6 header */
236 hdr->vtc_flow = rte_cpu_to_be_32(0x60 << 24 | pktid);
237 hdr->payload_len = rte_cpu_to_be_16(b->pkt_len);
238 hdr->proto = proto;
239 hdr->hop_limits = ttl;
240
241 memset(hdr->src_addr, 0x08, sizeof(hdr->src_addr));
242 memset(hdr->dst_addr, 0x04, sizeof(hdr->src_addr));
243}
244
245static inline void
246test_free_fragments(struct rte_mbuf *mb[], uint32_t num)

Callers 1

test_ip_fragFunction · 0.85

Calls 1

memsetFunction · 0.85

Tested by

no test coverage detected