| 761 | } |
| 762 | |
| 763 | void |
| 764 | idpf_set_rx_function(struct rte_eth_dev *dev) |
| 765 | { |
| 766 | struct idpf_vport *vport = dev->data->dev_private; |
| 767 | #ifdef RTE_ARCH_X86 |
| 768 | struct idpf_rx_queue *rxq; |
| 769 | int i; |
| 770 | |
| 771 | if (idpf_rx_vec_dev_check_default(dev) == IDPF_VECTOR_PATH && |
| 772 | rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { |
| 773 | vport->rx_vec_allowed = true; |
| 774 | |
| 775 | if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512) |
| 776 | #ifdef CC_AVX512_SUPPORT |
| 777 | if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 && |
| 778 | rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1 && |
| 779 | rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512DQ)) |
| 780 | vport->rx_use_avx512 = true; |
| 781 | #else |
| 782 | PMD_DRV_LOG(NOTICE, |
| 783 | "AVX512 is not supported in build env"); |
| 784 | #endif /* CC_AVX512_SUPPORT */ |
| 785 | } else { |
| 786 | vport->rx_vec_allowed = false; |
| 787 | } |
| 788 | #endif /* RTE_ARCH_X86 */ |
| 789 | |
| 790 | #ifdef RTE_ARCH_X86 |
| 791 | if (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT) { |
| 792 | if (vport->rx_vec_allowed) { |
| 793 | for (i = 0; i < dev->data->nb_rx_queues; i++) { |
| 794 | rxq = dev->data->rx_queues[i]; |
| 795 | (void)idpf_qc_splitq_rx_vec_setup(rxq); |
| 796 | } |
| 797 | #ifdef CC_AVX512_SUPPORT |
| 798 | if (vport->rx_use_avx512) { |
| 799 | PMD_DRV_LOG(NOTICE, |
| 800 | "Using Split AVX512 Vector Rx (port %d).", |
| 801 | dev->data->port_id); |
| 802 | dev->rx_pkt_burst = idpf_dp_splitq_recv_pkts_avx512; |
| 803 | return; |
| 804 | } |
| 805 | #endif /* CC_AVX512_SUPPORT */ |
| 806 | } |
| 807 | PMD_DRV_LOG(NOTICE, |
| 808 | "Using Split Scalar Rx (port %d).", |
| 809 | dev->data->port_id); |
| 810 | dev->rx_pkt_burst = idpf_dp_splitq_recv_pkts; |
| 811 | } else { |
| 812 | if (vport->rx_vec_allowed) { |
| 813 | for (i = 0; i < dev->data->nb_tx_queues; i++) { |
| 814 | rxq = dev->data->rx_queues[i]; |
| 815 | (void)idpf_qc_singleq_rx_vec_setup(rxq); |
| 816 | } |
| 817 | #ifdef CC_AVX512_SUPPORT |
| 818 | if (vport->rx_use_avx512) { |
| 819 | PMD_DRV_LOG(NOTICE, |
| 820 | "Using Single AVX512 Vector Rx (port %d).", |
no test coverage detected