| 564 | } |
| 565 | |
| 566 | static int |
| 567 | ifpga_monitor_stop_func(struct ifpga_rawdev *dev) |
| 568 | { |
| 569 | int ret; |
| 570 | |
| 571 | if (!dev || !dev->poll_enabled) |
| 572 | return 0; |
| 573 | |
| 574 | dev->poll_enabled = 0; |
| 575 | |
| 576 | if (!(__atomic_fetch_sub(&ifpga_monitor_refcnt, 1, __ATOMIC_RELAXED) - 1) && |
| 577 | ifpga_monitor_start_thread.opaque_id != 0) { |
| 578 | ret = pthread_cancel((pthread_t)ifpga_monitor_start_thread.opaque_id); |
| 579 | if (ret) |
| 580 | IFPGA_RAWDEV_PMD_ERR("Can't cancel the thread"); |
| 581 | |
| 582 | ret = rte_thread_join(ifpga_monitor_start_thread, NULL); |
| 583 | if (ret) |
| 584 | IFPGA_RAWDEV_PMD_ERR("Can't join the thread"); |
| 585 | |
| 586 | return ret; |
| 587 | } |
| 588 | |
| 589 | return 0; |
| 590 | } |
| 591 | |
| 592 | static int |
| 593 | ifpga_fill_afu_dev(struct opae_accelerator *acc, |
no test coverage detected