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

Function test_packet_forward

dpdk/app/test/sample_packet_forward.c:126–143  ·  view source on GitHub ↗

Sample test to forward packets using virtual portids */

Source from the content-addressed store, hash-verified

124
125/* Sample test to forward packets using virtual portids */
126int
127test_packet_forward(struct rte_mbuf **pbuf, uint16_t portid, uint16_t queue_id)
128{
129 /* send and receive packet and check for stats update */
130 if (rte_eth_tx_burst(portid, queue_id, pbuf, NUM_PACKETS)
131 < NUM_PACKETS) {
132 printf("%s() line %u: Error sending packet to"
133 " port %d\n", __func__, __LINE__, portid);
134 return -1;
135 }
136 if (rte_eth_rx_burst(portid, queue_id, pbuf, NUM_PACKETS)
137 < NUM_PACKETS) {
138 printf("%s() line %u: Error receiving packet from"
139 " port %d\n", __func__, __LINE__, portid);
140 return -1;
141 }
142 return 0;
143}

Callers 3

send_pktsFunction · 0.85
test_bit_packet_forwardFunction · 0.85

Calls 3

rte_eth_tx_burstFunction · 0.85
rte_eth_rx_burstFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected