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

Function eventdev_setup

dpdk/app/test/test_pdcp.c:2119–2153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2117}
2118
2119static inline int
2120eventdev_setup(void)
2121{
2122 struct rte_event_dev_config dev_conf;
2123 struct rte_event_dev_info info;
2124 int ret, evdev = 0;
2125
2126 if (!rte_event_dev_count())
2127 return TEST_SKIPPED;
2128
2129 ret = rte_event_dev_info_get(evdev, &info);
2130 TEST_ASSERT_SUCCESS(ret, "Failed to get event dev info");
2131 TEST_ASSERT(info.max_num_events < 0 || info.max_num_events >= 1,
2132 "ERROR max_num_events=%d < max_events=%d", info.max_num_events, 1);
2133
2134 eventdev_conf_default_set(&dev_conf, &info);
2135 ret = rte_event_dev_configure(evdev, &dev_conf);
2136 TEST_ASSERT_SUCCESS(ret, "Failed to configure eventdev");
2137
2138 ret = rte_event_queue_setup(evdev, TEST_EV_QUEUE_ID, NULL);
2139 TEST_ASSERT_SUCCESS(ret, "Failed to setup queue=%d", TEST_EV_QUEUE_ID);
2140
2141 /* Configure event port */
2142 ret = rte_event_port_setup(evdev, TEST_EV_PORT_ID, NULL);
2143 TEST_ASSERT_SUCCESS(ret, "Failed to setup port=%d", TEST_EV_PORT_ID);
2144 ret = rte_event_port_link(evdev, TEST_EV_PORT_ID, NULL, NULL, 0);
2145 TEST_ASSERT(ret >= 0, "Failed to link all queues port=%d", TEST_EV_PORT_ID);
2146
2147 ret = rte_event_dev_start(evdev);
2148 TEST_ASSERT_SUCCESS(ret, "Failed to start device");
2149
2150 testsuite_params.evdev = evdev;
2151
2152 return TEST_SUCCESS;
2153}
2154
2155static int
2156event_timer_setup(void)

Callers 1

Calls 8

rte_event_dev_countFunction · 0.85
rte_event_dev_info_getFunction · 0.85
rte_event_dev_configureFunction · 0.85
rte_event_queue_setupFunction · 0.85
rte_event_port_setupFunction · 0.85
rte_event_port_linkFunction · 0.85
rte_event_dev_startFunction · 0.85

Tested by

no test coverage detected