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

Function test_ethdev_configure_port

dpdk/app/test/test_pmd_ring.c:22–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

20static int tx_porta, rx_portb, rxtx_portc, rxtx_portd, rxtx_porte;
21
22static int
23test_ethdev_configure_port(int port)
24{
25 struct rte_eth_conf null_conf;
26 struct rte_eth_link link;
27 int ret;
28
29 memset(&null_conf, 0, sizeof(struct rte_eth_conf));
30
31 if (rte_eth_dev_configure(port, 1, 2, &null_conf) < 0) {
32 printf("Configure failed for port %d\n", port);
33 return -1;
34 }
35
36 /* Test queue release */
37 if (rte_eth_dev_configure(port, 1, 1, &null_conf) < 0) {
38 printf("Configure failed for port %d\n", port);
39 return -1;
40 }
41
42 if (rte_eth_tx_queue_setup(port, 0, RING_SIZE, SOCKET0, NULL) < 0) {
43 printf("TX queue setup failed port %d\n", port);
44 return -1;
45 }
46
47 if (rte_eth_rx_queue_setup(port, 0, RING_SIZE, SOCKET0,
48 NULL, mp) < 0) {
49 printf("RX queue setup failed port %d\n", port);
50 return -1;
51 }
52
53 if (rte_eth_dev_start(port) < 0) {
54 printf("Error starting port %d\n", port);
55 return -1;
56 }
57
58 ret = rte_eth_link_get(port, &link);
59 if (ret < 0) {
60 printf("Link get failed for port %u: %s",
61 port, rte_strerror(-ret));
62 return -1;
63 }
64
65 return 0;
66}
67
68static int
69test_send_basic_packets(void)

Callers 2

Calls 8

memsetFunction · 0.85
rte_eth_dev_configureFunction · 0.85
rte_eth_tx_queue_setupFunction · 0.85
rte_eth_rx_queue_setupFunction · 0.85
rte_eth_dev_startFunction · 0.85
rte_eth_link_getFunction · 0.85
rte_strerrorFunction · 0.85
printfFunction · 0.50

Tested by

no test coverage detected