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

Function app_init_rings

dpdk/app/test/test_table.c:103–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101}
102
103static void
104app_init_rings(void)
105{
106 uint32_t i;
107
108 for (i = 0; i < N_PORTS; i++) {
109 char name[32];
110
111 snprintf(name, sizeof(name), "app_ring_rx_%u", i);
112 rings_rx[i] = rte_ring_lookup(name);
113 if (rings_rx[i] == NULL) {
114 rings_rx[i] = rte_ring_create(
115 name,
116 RING_RX_SIZE,
117 0,
118 RING_F_SP_ENQ | RING_F_SC_DEQ);
119 }
120 if (rings_rx[i] == NULL)
121 rte_panic("Cannot create RX ring %u\n", i);
122 }
123
124 for (i = 0; i < N_PORTS; i++) {
125 char name[32];
126
127 snprintf(name, sizeof(name), "app_ring_tx_%u", i);
128 rings_tx[i] = rte_ring_lookup(name);
129 if (rings_tx[i] == NULL) {
130 rings_tx[i] = rte_ring_create(
131 name,
132 RING_TX_SIZE,
133 0,
134 RING_F_SP_ENQ | RING_F_SC_DEQ);
135 }
136 if (rings_tx[i] == NULL)
137 rte_panic("Cannot create TX ring %u\n", i);
138 }
139
140}
141
142static int
143test_table(void)

Callers 1

test_tableFunction · 0.70

Calls 3

snprintfFunction · 0.85
rte_ring_lookupFunction · 0.85
rte_ring_createFunction · 0.85

Tested by

no test coverage detected