| 817 | } |
| 818 | |
| 819 | static void |
| 820 | sw_stop(struct rte_eventdev *dev) |
| 821 | { |
| 822 | struct sw_evdev *sw = sw_pmd_priv(dev); |
| 823 | int32_t runstate; |
| 824 | |
| 825 | /* Stop the scheduler if it's running */ |
| 826 | runstate = rte_service_runstate_get(sw->service_id); |
| 827 | if (runstate == 1) |
| 828 | rte_service_runstate_set(sw->service_id, 0); |
| 829 | |
| 830 | while (rte_service_may_be_active(sw->service_id)) |
| 831 | rte_pause(); |
| 832 | |
| 833 | /* Flush all events out of the device */ |
| 834 | while (!(sw_qids_empty(sw) && sw_ports_empty(sw))) { |
| 835 | sw_event_schedule(dev); |
| 836 | sw_drain_ports(dev); |
| 837 | sw_drain_queues(dev); |
| 838 | } |
| 839 | |
| 840 | sw_clean_qid_iqs(dev); |
| 841 | sw_xstats_uninit(sw); |
| 842 | sw->started = 0; |
| 843 | rte_smp_wmb(); |
| 844 | |
| 845 | if (runstate == 1) |
| 846 | rte_service_runstate_set(sw->service_id, 1); |
| 847 | } |
| 848 | |
| 849 | static int |
| 850 | sw_close(struct rte_eventdev *dev) |
nothing calls this directly
no test coverage detected