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

Function rte_dev_event_monitor_start

dpdk/lib/eal/linux/eal_dev.c:306–354  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

304}
305
306int
307rte_dev_event_monitor_start(void)
308{
309 int ret = 0;
310
311 rte_rwlock_write_lock(&monitor_lock);
312
313 if (monitor_refcount) {
314 monitor_refcount++;
315 goto exit;
316 }
317
318 intr_handle = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE);
319 if (intr_handle == NULL) {
320 RTE_LOG(ERR, EAL, "Fail to allocate intr_handle\n");
321 goto exit;
322 }
323
324 ret = rte_intr_type_set(intr_handle, RTE_INTR_HANDLE_DEV_EVENT);
325 if (ret)
326 goto exit;
327
328 ret = rte_intr_fd_set(intr_handle, -1);
329 if (ret)
330 goto exit;
331
332 ret = dev_uev_socket_fd_create();
333 if (ret) {
334 RTE_LOG(ERR, EAL, "error create device event fd.\n");
335 goto exit;
336 }
337
338 ret = rte_intr_callback_register(intr_handle, dev_uev_handler, NULL);
339
340 if (ret) {
341 close(rte_intr_fd_get(intr_handle));
342 goto exit;
343 }
344
345 monitor_refcount++;
346
347exit:
348 if (ret) {
349 rte_intr_instance_free(intr_handle);
350 intr_handle = NULL;
351 }
352 rte_rwlock_write_unlock(&monitor_lock);
353 return ret;
354}
355
356int
357rte_dev_event_monitor_stop(void)

Callers 2

eth_hn_probeFunction · 0.50
mainFunction · 0.50

Calls 8

rte_intr_instance_allocFunction · 0.85
rte_intr_type_setFunction · 0.85
rte_intr_fd_setFunction · 0.85
dev_uev_socket_fd_createFunction · 0.85
rte_intr_fd_getFunction · 0.85
rte_intr_instance_freeFunction · 0.85
closeFunction · 0.50

Tested by 1

mainFunction · 0.40