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

Function ordered_basic

dpdk/drivers/event/opdl/opdl_test.c:187–322  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

185};
186
187static int
188ordered_basic(struct test *t)
189{
190 const uint8_t rx_port = 0;
191 const uint8_t w1_port = 1;
192 const uint8_t w3_port = 3;
193 const uint8_t tx_port = 4;
194 int err;
195 uint32_t i;
196 uint32_t deq_pkts;
197 struct rte_mbuf *mbufs[3];
198
199 const uint32_t MAGIC_SEQN = 1234;
200
201 /* Create instance with 5 ports */
202 if (init(t, 2, tx_port+1) < 0 ||
203 create_ports(t, tx_port+1) < 0 ||
204 create_queues_type(t, 2, OPDL_Q_TYPE_ORDERED)) {
205 PMD_DRV_LOG(ERR, "%d: Error initializing device", __LINE__);
206 return -1;
207 }
208
209 /*
210 * CQ mapping to QID
211 * We need three ports, all mapped to the same ordered qid0. Then we'll
212 * take a packet out to each port, re-enqueue in reverse order,
213 * then make sure the reordering has taken place properly when we
214 * dequeue from the tx_port.
215 *
216 * Simplified test setup diagram:
217 *
218 * rx_port w1_port
219 * \ / \
220 * qid0 - w2_port - qid1
221 * \ / \
222 * w3_port tx_port
223 */
224 /* CQ mapping to QID for LB ports (directed mapped on create) */
225 for (i = w1_port; i <= w3_port; i++) {
226 err = rte_event_port_link(evdev, t->port[i], &t->qid[0], NULL,
227 1);
228 if (err != 1) {
229 PMD_DRV_LOG(ERR, "%d: error mapping lb qid",
230 __LINE__);
231 cleanup(t);
232 return -1;
233 }
234 }
235
236 err = rte_event_port_link(evdev, t->port[tx_port], &t->qid[1], NULL,
237 1);
238 if (err != 1) {
239 PMD_DRV_LOG(ERR, "%d: error mapping TX qid", __LINE__);
240 cleanup(t);
241 return -1;
242 }
243
244 if (rte_event_dev_start(evdev) < 0) {

Callers 1

opdl_selftestFunction · 0.70

Calls 10

create_queues_typeFunction · 0.85
rte_event_port_linkFunction · 0.85
rte_event_dev_startFunction · 0.85
rte_event_enqueue_burstFunction · 0.85
rte_event_dequeue_burstFunction · 0.85
rte_event_dev_dumpFunction · 0.85
initFunction · 0.70
create_portsFunction · 0.70
cleanupFunction · 0.70
rte_gen_arpFunction · 0.70

Tested by

no test coverage detected