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

Function xstats_brute_force

dpdk/drivers/event/sw/sw_evdev_selftest.c:1371–1420  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1369}
1370
1371static int
1372xstats_brute_force(struct test *t)
1373{
1374 uint32_t i;
1375 const uint32_t XSTATS_MAX = 1024;
1376 uint64_t ids[XSTATS_MAX];
1377 uint64_t values[XSTATS_MAX];
1378 struct rte_event_dev_xstats_name xstats_names[XSTATS_MAX];
1379
1380
1381 /* Create instance with 4 ports */
1382 if (init(t, 1, 4) < 0 ||
1383 create_ports(t, 4) < 0 ||
1384 create_atomic_qids(t, 1) < 0) {
1385 printf("%d: Error initializing device\n", __LINE__);
1386 return -1;
1387 }
1388
1389 int err = rte_event_port_link(evdev, t->port[0], NULL, NULL, 0);
1390 if (err != 1) {
1391 printf("%d: error mapping lb qid\n", __LINE__);
1392 goto fail;
1393 }
1394
1395 if (rte_event_dev_start(evdev) < 0) {
1396 printf("%d: Error with start call\n", __LINE__);
1397 goto fail;
1398 }
1399
1400 for (i = 0; i < XSTATS_MAX; i++)
1401 ids[i] = i;
1402
1403 for (i = 0; i < 3; i++) {
1404 uint32_t mode = RTE_EVENT_DEV_XSTATS_DEVICE + i;
1405 uint32_t j;
1406 for (j = 0; j < UINT8_MAX; j++) {
1407 rte_event_dev_xstats_names_get(evdev, mode,
1408 j, xstats_names, ids, XSTATS_MAX);
1409
1410 rte_event_dev_xstats_get(evdev, mode, j, ids,
1411 values, XSTATS_MAX);
1412 }
1413 }
1414
1415 cleanup(t);
1416 return 0;
1417fail:
1418 cleanup(t);
1419 return -1;
1420}
1421
1422static int
1423xstats_id_reset_tests(struct test *t)

Callers 1

test_sw_eventdevFunction · 0.85

Calls 9

rte_event_port_linkFunction · 0.85
rte_event_dev_startFunction · 0.85
rte_event_dev_xstats_getFunction · 0.85
initFunction · 0.70
create_portsFunction · 0.70
create_atomic_qidsFunction · 0.70
cleanupFunction · 0.70
printfFunction · 0.50

Tested by

no test coverage detected