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

Function test_send_basic_packets

dpdk/app/test/test_pmd_ring.c:68–97  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68static int
69test_send_basic_packets(void)
70{
71 struct rte_mbuf bufs[RING_SIZE];
72 struct rte_mbuf *pbufs[RING_SIZE];
73 int i;
74
75 printf("Testing send and receive RING_SIZE/2 packets (tx_porta -> rx_portb)\n");
76
77 for (i = 0; i < RING_SIZE/2; i++)
78 pbufs[i] = &bufs[i];
79
80 if (rte_eth_tx_burst(tx_porta, 0, pbufs, RING_SIZE/2) < RING_SIZE/2) {
81 printf("Failed to transmit packet burst port %d\n", tx_porta);
82 return TEST_FAILED;
83 }
84
85 if (rte_eth_rx_burst(rx_portb, 0, pbufs, RING_SIZE) != RING_SIZE/2) {
86 printf("Failed to receive packet burst on port %d\n", rx_portb);
87 return TEST_FAILED;
88 }
89
90 for (i = 0; i < RING_SIZE/2; i++)
91 if (pbufs[i] != &bufs[i]) {
92 printf("Error: received data does not match that transmitted\n");
93 return TEST_FAILED;
94 }
95
96 return TEST_SUCCESS;
97}
98
99static int
100test_send_basic_packets_port(int port)

Callers

nothing calls this directly

Calls 3

rte_eth_tx_burstFunction · 0.85
rte_eth_rx_burstFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected