| 3757 | } |
| 3758 | |
| 3759 | void __rte_cold |
| 3760 | ice_set_tx_function(struct rte_eth_dev *dev) |
| 3761 | { |
| 3762 | struct ice_adapter *ad = |
| 3763 | ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); |
| 3764 | #ifdef RTE_ARCH_X86 |
| 3765 | struct ice_tx_queue *txq; |
| 3766 | int i; |
| 3767 | int tx_check_ret = -1; |
| 3768 | |
| 3769 | if (rte_eal_process_type() == RTE_PROC_PRIMARY) { |
| 3770 | ad->tx_use_avx2 = false; |
| 3771 | ad->tx_use_avx512 = false; |
| 3772 | tx_check_ret = ice_tx_vec_dev_check(dev); |
| 3773 | if (tx_check_ret >= 0 && |
| 3774 | rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { |
| 3775 | ad->tx_vec_allowed = true; |
| 3776 | |
| 3777 | if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 && |
| 3778 | rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 && |
| 3779 | rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1) |
| 3780 | #ifdef CC_AVX512_SUPPORT |
| 3781 | ad->tx_use_avx512 = true; |
| 3782 | #else |
| 3783 | PMD_DRV_LOG(NOTICE, |
| 3784 | "AVX512 is not supported in build env"); |
| 3785 | #endif |
| 3786 | if (!ad->tx_use_avx512 && |
| 3787 | (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 || |
| 3788 | rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) && |
| 3789 | rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256) |
| 3790 | ad->tx_use_avx2 = true; |
| 3791 | |
| 3792 | if (!ad->tx_use_avx2 && !ad->tx_use_avx512 && |
| 3793 | tx_check_ret == ICE_VECTOR_OFFLOAD_PATH) |
| 3794 | ad->tx_vec_allowed = false; |
| 3795 | |
| 3796 | if (ad->tx_vec_allowed) { |
| 3797 | for (i = 0; i < dev->data->nb_tx_queues; i++) { |
| 3798 | txq = dev->data->tx_queues[i]; |
| 3799 | if (txq && ice_txq_vec_setup(txq)) { |
| 3800 | ad->tx_vec_allowed = false; |
| 3801 | break; |
| 3802 | } |
| 3803 | } |
| 3804 | } |
| 3805 | } else { |
| 3806 | ad->tx_vec_allowed = false; |
| 3807 | } |
| 3808 | } |
| 3809 | |
| 3810 | if (ad->tx_vec_allowed) { |
| 3811 | dev->tx_pkt_prepare = NULL; |
| 3812 | if (ad->tx_use_avx512) { |
| 3813 | #ifdef CC_AVX512_SUPPORT |
| 3814 | if (tx_check_ret == ICE_VECTOR_OFFLOAD_PATH) { |
| 3815 | PMD_DRV_LOG(NOTICE, |
| 3816 | "Using AVX512 OFFLOAD Vector Tx (port %d).", |
no test coverage detected