MCPcopy Create free account
hub / github.com/F-Stack/f-stack / ice_set_rx_function

Function ice_set_rx_function

dpdk/drivers/net/ice/ice_rxtx.c:3454–3605  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3452}
3453
3454void __rte_cold
3455ice_set_rx_function(struct rte_eth_dev *dev)
3456{
3457 PMD_INIT_FUNC_TRACE();
3458 struct ice_adapter *ad =
3459 ICE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
3460#ifdef RTE_ARCH_X86
3461 struct ice_rx_queue *rxq;
3462 int i;
3463 int rx_check_ret = -1;
3464
3465 if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
3466 ad->rx_use_avx512 = false;
3467 ad->rx_use_avx2 = false;
3468 rx_check_ret = ice_rx_vec_dev_check(dev);
3469 if (ad->ptp_ena)
3470 rx_check_ret = -1;
3471 ad->rx_vec_offload_support =
3472 (rx_check_ret == ICE_VECTOR_OFFLOAD_PATH);
3473 if (rx_check_ret >= 0 && ad->rx_bulk_alloc_allowed &&
3474 rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) {
3475 ad->rx_vec_allowed = true;
3476 for (i = 0; i < dev->data->nb_rx_queues; i++) {
3477 rxq = dev->data->rx_queues[i];
3478 if (rxq && ice_rxq_vec_setup(rxq)) {
3479 ad->rx_vec_allowed = false;
3480 break;
3481 }
3482 }
3483
3484 if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512 &&
3485 rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 &&
3486 rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1)
3487#ifdef CC_AVX512_SUPPORT
3488 ad->rx_use_avx512 = true;
3489#else
3490 PMD_DRV_LOG(NOTICE,
3491 "AVX512 is not supported in build env");
3492#endif
3493 if (!ad->rx_use_avx512 &&
3494 (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2) == 1 ||
3495 rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1) &&
3496 rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_256)
3497 ad->rx_use_avx2 = true;
3498
3499 } else {
3500 ad->rx_vec_allowed = false;
3501 }
3502 }
3503
3504 if (ad->rx_vec_allowed) {
3505 if (dev->data->scattered_rx) {
3506 if (ad->rx_use_avx512) {
3507#ifdef CC_AVX512_SUPPORT
3508 if (ad->rx_vec_offload_support) {
3509 PMD_DRV_LOG(NOTICE,
3510 "Using AVX512 OFFLOAD Vector Scattered Rx (port %d).",
3511 dev->data->port_id);

Callers 3

ice_dev_initFunction · 0.85
ice_dev_startFunction · 0.85
ice_dcf_init_rx_queuesFunction · 0.85

Calls 5

rte_eal_process_typeFunction · 0.85
ice_rx_vec_dev_checkFunction · 0.85
ice_rxq_vec_setupFunction · 0.85
rte_cpu_get_flag_enabledFunction · 0.50

Tested by

no test coverage detected