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

Function rte_intr_callback_unregister_pending

dpdk/lib/eal/linux/eal_interrupts.c:567–616  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

565}
566
567int
568rte_intr_callback_unregister_pending(const struct rte_intr_handle *intr_handle,
569 rte_intr_callback_fn cb_fn, void *cb_arg,
570 rte_intr_unregister_callback_fn ucb_fn)
571{
572 int ret;
573 struct rte_intr_source *src;
574 struct rte_intr_callback *cb, *next;
575
576 /* do parameter checking first */
577 if (rte_intr_fd_get(intr_handle) < 0) {
578 RTE_LOG(ERR, EAL, "Unregistering with invalid input parameter\n");
579 return -EINVAL;
580 }
581
582 rte_spinlock_lock(&intr_lock);
583
584 /* check if the interrupt source for the fd is existent */
585 TAILQ_FOREACH(src, &intr_sources, next) {
586 if (rte_intr_fd_get(src->intr_handle) == rte_intr_fd_get(intr_handle))
587 break;
588 }
589
590 /* No interrupt source registered for the fd */
591 if (src == NULL) {
592 ret = -ENOENT;
593
594 /* only usable if the source is active */
595 } else if (src->active == 0) {
596 ret = -EAGAIN;
597
598 } else {
599 ret = 0;
600
601 /* walk through the callbacks and mark all that match. */
602 for (cb = TAILQ_FIRST(&src->callbacks); cb != NULL; cb = next) {
603 next = TAILQ_NEXT(cb, next);
604 if (cb->cb_fn == cb_fn && (cb_arg == (void *)-1 ||
605 cb->cb_arg == cb_arg)) {
606 cb->pending_delete = 1;
607 cb->ucb_fn = ucb_fn;
608 ret++;
609 }
610 }
611 }
612
613 rte_spinlock_unlock(&intr_lock);
614
615 return ret;
616}
617
618int
619rte_intr_callback_unregister(const struct rte_intr_handle *intr_handle,

Callers 2

memif_disconnectFunction · 0.50
memif_intr_handlerFunction · 0.50

Calls 3

rte_intr_fd_getFunction · 0.85
rte_spinlock_lockFunction · 0.50
rte_spinlock_unlockFunction · 0.50

Tested by

no test coverage detected