| 3266 | |
| 3267 | |
| 3268 | void __rte_cold |
| 3269 | i40e_set_rx_function(struct rte_eth_dev *dev) |
| 3270 | { |
| 3271 | struct i40e_adapter *ad = |
| 3272 | I40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private); |
| 3273 | uint16_t rx_using_sse, i; |
| 3274 | /* In order to allow Vector Rx there are a few configuration |
| 3275 | * conditions to be met and Rx Bulk Allocation should be allowed. |
| 3276 | */ |
| 3277 | if (rte_eal_process_type() == RTE_PROC_PRIMARY) { |
| 3278 | #ifdef RTE_ARCH_X86 |
| 3279 | ad->rx_use_avx512 = false; |
| 3280 | ad->rx_use_avx2 = false; |
| 3281 | #endif |
| 3282 | if (i40e_rx_vec_dev_conf_condition_check(dev) || |
| 3283 | !ad->rx_bulk_alloc_allowed) { |
| 3284 | PMD_INIT_LOG(DEBUG, "Port[%d] doesn't meet" |
| 3285 | " Vector Rx preconditions", |
| 3286 | dev->data->port_id); |
| 3287 | |
| 3288 | ad->rx_vec_allowed = false; |
| 3289 | } |
| 3290 | if (ad->rx_vec_allowed) { |
| 3291 | for (i = 0; i < dev->data->nb_rx_queues; i++) { |
| 3292 | struct i40e_rx_queue *rxq = |
| 3293 | dev->data->rx_queues[i]; |
| 3294 | |
| 3295 | if (rxq && i40e_rxq_vec_setup(rxq)) { |
| 3296 | ad->rx_vec_allowed = false; |
| 3297 | break; |
| 3298 | } |
| 3299 | } |
| 3300 | #ifdef RTE_ARCH_X86 |
| 3301 | ad->rx_use_avx512 = get_avx_supported(1); |
| 3302 | |
| 3303 | if (!ad->rx_use_avx512) |
| 3304 | ad->rx_use_avx2 = get_avx_supported(0); |
| 3305 | #endif |
| 3306 | } |
| 3307 | } |
| 3308 | |
| 3309 | if (ad->rx_vec_allowed && |
| 3310 | rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { |
| 3311 | #ifdef RTE_ARCH_X86 |
| 3312 | if (dev->data->scattered_rx) { |
| 3313 | if (ad->rx_use_avx512) { |
| 3314 | #ifdef CC_AVX512_SUPPORT |
| 3315 | PMD_DRV_LOG(NOTICE, |
| 3316 | "Using AVX512 Vector Scattered Rx (port %d).", |
| 3317 | dev->data->port_id); |
| 3318 | dev->rx_pkt_burst = |
| 3319 | i40e_recv_scattered_pkts_vec_avx512; |
| 3320 | #endif |
| 3321 | } else { |
| 3322 | PMD_INIT_LOG(DEBUG, |
| 3323 | "Using %sVector Scattered Rx (port %d).", |
| 3324 | ad->rx_use_avx2 ? "avx2 " : "", |
| 3325 | dev->data->port_id); |
no test coverage detected