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

Function rte_gen_arp

dpdk/drivers/event/sw/sw_evdev_selftest.c:56–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

54static struct rte_event release_ev;
55
56static inline struct rte_mbuf *
57rte_gen_arp(int portid, struct rte_mempool *mp)
58{
59 /*
60 * len = 14 + 46
61 * ARP, Request who-has 10.0.0.1 tell 10.0.0.2, length 46
62 */
63 static const uint8_t arp_request[] = {
64 /*0x0000:*/ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xec, 0xa8,
65 0x6b, 0xfd, 0x02, 0x29, 0x08, 0x06, 0x00, 0x01,
66 /*0x0010:*/ 0x08, 0x00, 0x06, 0x04, 0x00, 0x01, 0xec, 0xa8,
67 0x6b, 0xfd, 0x02, 0x29, 0x0a, 0x00, 0x00, 0x01,
68 /*0x0020:*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00,
69 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
70 /*0x0030:*/ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
71 0x00, 0x00, 0x00, 0x00
72 };
73 struct rte_mbuf *m;
74 int pkt_len = sizeof(arp_request) - 1;
75
76 m = rte_pktmbuf_alloc(mp);
77 if (!m)
78 return 0;
79
80 memcpy((void *)((uintptr_t)m->buf_addr + m->data_off),
81 arp_request, pkt_len);
82 rte_pktmbuf_pkt_len(m) = pkt_len;
83 rte_pktmbuf_data_len(m) = pkt_len;
84
85 RTE_SET_USED(portid);
86
87 return m;
88}
89
90static void
91xstats_print(void)

Callers 13

run_prio_packet_testFunction · 0.70
burst_packetsFunction · 0.70
xstats_testsFunction · 0.70
port_reconfig_creditsFunction · 0.70
xstats_id_reset_testsFunction · 0.70
qid_prioritiesFunction · 0.70
load_balancingFunction · 0.70
load_balancing_historyFunction · 0.70
invalid_qidFunction · 0.70
single_packetFunction · 0.70
inflight_countsFunction · 0.70

Calls 2

rte_pktmbuf_allocFunction · 0.85
memcpyFunction · 0.50

Tested by

no test coverage detected