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

Function test_app_setup_event_dev

dpdk/app/test/test_dispatcher.c:122–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

120}
121
122static int
123test_app_setup_event_dev(struct test_app *app)
124{
125 int rc;
126 int i;
127
128 rc = test_app_create_vdev(app);
129 if (rc != TEST_SUCCESS)
130 return rc;
131
132 struct rte_event_dev_config config = {
133 .nb_event_queues = NUM_QUEUES,
134 .nb_event_ports = NUM_PORTS,
135 .nb_events_limit = MAX_EVENTS,
136 .nb_event_queue_flows = 64,
137 .nb_event_port_dequeue_depth = DEQUEUE_BURST_SIZE,
138 .nb_event_port_enqueue_depth = ENQUEUE_BURST_SIZE
139 };
140
141 rc = rte_event_dev_configure(app->event_dev_id, &config);
142
143 TEST_ASSERT_SUCCESS(rc, "Unable to configure event device");
144
145 struct rte_event_queue_conf queue_config = {
146 .priority = RTE_EVENT_DEV_PRIORITY_NORMAL,
147 .schedule_type = RTE_SCHED_TYPE_ATOMIC,
148 .nb_atomic_flows = 64
149 };
150
151 for (i = 0; i < NUM_QUEUES; i++) {
152 uint8_t queue_id = i;
153
154 rc = rte_event_queue_setup(app->event_dev_id, queue_id,
155 &queue_config);
156
157 TEST_ASSERT_SUCCESS(rc, "Unable to setup queue %d", queue_id);
158 }
159
160 struct rte_event_port_conf port_config = {
161 .new_event_threshold = NEW_EVENT_THRESHOLD,
162 .dequeue_depth = DEQUEUE_BURST_SIZE,
163 .enqueue_depth = ENQUEUE_BURST_SIZE
164 };
165
166 for (i = 0; i < NUM_PORTS; i++) {
167 uint8_t event_port_id = i;
168
169 rc = rte_event_port_setup(app->event_dev_id, event_port_id,
170 &port_config);
171 TEST_ASSERT_SUCCESS(rc, "Failed to create event port %d",
172 event_port_id);
173
174 if (event_port_id == DRIVER_PORT_ID)
175 continue;
176
177 rc = rte_event_port_link(app->event_dev_id, event_port_id,
178 NULL, NULL, 0);
179

Callers 1

test_setupFunction · 0.85

Calls 5

test_app_create_vdevFunction · 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

Tested by

no test coverage detected