| 3777 | } |
| 3778 | |
| 3779 | void |
| 3780 | pmd_test_exit(void) |
| 3781 | { |
| 3782 | portid_t pt_id; |
| 3783 | unsigned int i; |
| 3784 | int ret; |
| 3785 | |
| 3786 | if (test_done == 0) |
| 3787 | stop_packet_forwarding(); |
| 3788 | |
| 3789 | #ifndef RTE_EXEC_ENV_WINDOWS |
| 3790 | for (i = 0 ; i < RTE_DIM(mempools) ; i++) { |
| 3791 | if (mempools[i]) { |
| 3792 | if (mp_alloc_type == MP_ALLOC_ANON) |
| 3793 | rte_mempool_mem_iter(mempools[i], dma_unmap_cb, |
| 3794 | NULL); |
| 3795 | } |
| 3796 | } |
| 3797 | #endif |
| 3798 | if (ports != NULL) { |
| 3799 | no_link_check = 1; |
| 3800 | RTE_ETH_FOREACH_DEV(pt_id) { |
| 3801 | printf("\nStopping port %d...\n", pt_id); |
| 3802 | fflush(stdout); |
| 3803 | stop_port(pt_id); |
| 3804 | } |
| 3805 | RTE_ETH_FOREACH_DEV(pt_id) { |
| 3806 | printf("\nShutting down port %d...\n", pt_id); |
| 3807 | fflush(stdout); |
| 3808 | close_port(pt_id); |
| 3809 | } |
| 3810 | } |
| 3811 | |
| 3812 | if (hot_plug) { |
| 3813 | ret = rte_dev_event_monitor_stop(); |
| 3814 | if (ret) { |
| 3815 | RTE_LOG(ERR, EAL, |
| 3816 | "fail to stop device event monitor."); |
| 3817 | return; |
| 3818 | } |
| 3819 | |
| 3820 | ret = rte_dev_event_callback_unregister(NULL, |
| 3821 | dev_event_callback, NULL); |
| 3822 | if (ret < 0) { |
| 3823 | RTE_LOG(ERR, EAL, |
| 3824 | "fail to unregister device event callback.\n"); |
| 3825 | return; |
| 3826 | } |
| 3827 | |
| 3828 | ret = rte_dev_hotplug_handle_disable(); |
| 3829 | if (ret) { |
| 3830 | RTE_LOG(ERR, EAL, |
| 3831 | "fail to disable hotplug handling.\n"); |
| 3832 | return; |
| 3833 | } |
| 3834 | } |
| 3835 | for (i = 0 ; i < RTE_DIM(mempools) ; i++) { |
| 3836 | if (mempools[i]) |
no test coverage detected