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

Function xstats_tests

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

Source from the content-addressed store, hash-verified

833}
834
835static int
836xstats_tests(struct test *t)
837{
838 const int wrk_enq = 2;
839 int err;
840
841 /* Create instance with 4 ports */
842 if (init(t, 1, 4) < 0 ||
843 create_ports(t, 4) < 0 ||
844 create_atomic_qids(t, 1) < 0) {
845 printf("%d: Error initializing device\n", __LINE__);
846 return -1;
847 }
848
849 /* CQ mapping to QID */
850 err = rte_event_port_link(evdev, t->port[wrk_enq], NULL, NULL, 0);
851 if (err != 1) {
852 printf("%d: error mapping lb qid\n", __LINE__);
853 cleanup(t);
854 return -1;
855 }
856
857 if (rte_event_dev_start(evdev) < 0) {
858 printf("%d: Error with start call\n", __LINE__);
859 return -1;
860 }
861
862 const uint32_t XSTATS_MAX = 1024;
863
864 uint32_t i;
865 uint64_t ids[XSTATS_MAX];
866 uint64_t values[XSTATS_MAX];
867 struct rte_event_dev_xstats_name xstats_names[XSTATS_MAX];
868
869 for (i = 0; i < XSTATS_MAX; i++)
870 ids[i] = i;
871
872 /* Device names / values */
873 int ret = rte_event_dev_xstats_names_get(evdev,
874 RTE_EVENT_DEV_XSTATS_DEVICE,
875 0, xstats_names, ids, XSTATS_MAX);
876 if (ret != 8) {
877 printf("%d: expected 8 stats, got return %d\n", __LINE__, ret);
878 return -1;
879 }
880 ret = rte_event_dev_xstats_get(evdev,
881 RTE_EVENT_DEV_XSTATS_DEVICE,
882 0, ids, values, ret);
883 if (ret != 8) {
884 printf("%d: expected 8 stats, got return %d\n", __LINE__, ret);
885 return -1;
886 }
887
888 /* Port names / values */
889 ret = rte_event_dev_xstats_names_get(evdev,
890 RTE_EVENT_DEV_XSTATS_PORT, 0,
891 xstats_names, ids, XSTATS_MAX);
892 if (ret != 21) {

Callers 1

test_sw_eventdevFunction · 0.85

Calls 14

rte_event_port_linkFunction · 0.85
rte_event_dev_startFunction · 0.85
rte_event_dev_xstats_getFunction · 0.85
rte_event_enqueue_burstFunction · 0.85
rte_event_dev_dumpFunction · 0.85
initFunction · 0.70
create_portsFunction · 0.70
create_atomic_qidsFunction · 0.70
cleanupFunction · 0.70

Tested by

no test coverage detected