| 1420 | } |
| 1421 | |
| 1422 | static int |
| 1423 | xstats_id_reset_tests(struct test *t) |
| 1424 | { |
| 1425 | const int wrk_enq = 2; |
| 1426 | int err; |
| 1427 | |
| 1428 | /* Create instance with 4 ports */ |
| 1429 | if (init(t, 1, 4) < 0 || |
| 1430 | create_ports(t, 4) < 0 || |
| 1431 | create_atomic_qids(t, 1) < 0) { |
| 1432 | printf("%d: Error initializing device\n", __LINE__); |
| 1433 | return -1; |
| 1434 | } |
| 1435 | |
| 1436 | /* CQ mapping to QID */ |
| 1437 | err = rte_event_port_link(evdev, t->port[wrk_enq], NULL, NULL, 0); |
| 1438 | if (err != 1) { |
| 1439 | printf("%d: error mapping lb qid\n", __LINE__); |
| 1440 | goto fail; |
| 1441 | } |
| 1442 | |
| 1443 | if (rte_event_dev_start(evdev) < 0) { |
| 1444 | printf("%d: Error with start call\n", __LINE__); |
| 1445 | goto fail; |
| 1446 | } |
| 1447 | |
| 1448 | #define XSTATS_MAX 1024 |
| 1449 | int ret; |
| 1450 | uint32_t i; |
| 1451 | uint64_t ids[XSTATS_MAX]; |
| 1452 | uint64_t values[XSTATS_MAX]; |
| 1453 | struct rte_event_dev_xstats_name xstats_names[XSTATS_MAX]; |
| 1454 | |
| 1455 | for (i = 0; i < XSTATS_MAX; i++) |
| 1456 | ids[i] = i; |
| 1457 | |
| 1458 | #define NUM_DEV_STATS 8 |
| 1459 | /* Device names / values */ |
| 1460 | int num_stats = rte_event_dev_xstats_names_get(evdev, |
| 1461 | RTE_EVENT_DEV_XSTATS_DEVICE, |
| 1462 | 0, xstats_names, ids, XSTATS_MAX); |
| 1463 | if (num_stats != NUM_DEV_STATS) { |
| 1464 | printf("%d: expected %d stats, got return %d\n", __LINE__, |
| 1465 | NUM_DEV_STATS, num_stats); |
| 1466 | goto fail; |
| 1467 | } |
| 1468 | ret = rte_event_dev_xstats_get(evdev, |
| 1469 | RTE_EVENT_DEV_XSTATS_DEVICE, |
| 1470 | 0, ids, values, num_stats); |
| 1471 | if (ret != NUM_DEV_STATS) { |
| 1472 | printf("%d: expected %d stats, got return %d\n", __LINE__, |
| 1473 | NUM_DEV_STATS, ret); |
| 1474 | goto fail; |
| 1475 | } |
| 1476 | |
| 1477 | #define NPKTS 7 |
| 1478 | for (i = 0; i < NPKTS; i++) { |
| 1479 | struct rte_event ev; |
no test coverage detected