| 54 | static struct rte_event release_ev; |
| 55 | |
| 56 | static inline struct rte_mbuf * |
| 57 | rte_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 | |
| 90 | static void |
| 91 | xstats_print(void) |
no test coverage detected