| 1410 | } |
| 1411 | |
| 1412 | void |
| 1413 | cpfl_set_rx_function(struct rte_eth_dev *dev) |
| 1414 | { |
| 1415 | struct cpfl_vport *cpfl_vport = dev->data->dev_private; |
| 1416 | struct idpf_vport *vport = &cpfl_vport->base; |
| 1417 | #ifdef RTE_ARCH_X86 |
| 1418 | struct cpfl_rx_queue *cpfl_rxq; |
| 1419 | int i; |
| 1420 | |
| 1421 | if (cpfl_rx_vec_dev_check_default(dev) == CPFL_VECTOR_PATH && |
| 1422 | rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { |
| 1423 | vport->rx_vec_allowed = true; |
| 1424 | |
| 1425 | if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512) |
| 1426 | #ifdef CC_AVX512_SUPPORT |
| 1427 | if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 && |
| 1428 | rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1 && |
| 1429 | rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512DQ)) |
| 1430 | vport->rx_use_avx512 = true; |
| 1431 | #else |
| 1432 | PMD_DRV_LOG(NOTICE, |
| 1433 | "AVX512 is not supported in build env"); |
| 1434 | #endif /* CC_AVX512_SUPPORT */ |
| 1435 | } else { |
| 1436 | vport->rx_vec_allowed = false; |
| 1437 | } |
| 1438 | #endif /* RTE_ARCH_X86 */ |
| 1439 | |
| 1440 | #ifdef RTE_ARCH_X86 |
| 1441 | if (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT) { |
| 1442 | if (vport->rx_vec_allowed) { |
| 1443 | for (i = 0; i < dev->data->nb_rx_queues; i++) { |
| 1444 | cpfl_rxq = dev->data->rx_queues[i]; |
| 1445 | if (cpfl_rxq->hairpin_info.hairpin_q) |
| 1446 | continue; |
| 1447 | (void)idpf_qc_splitq_rx_vec_setup(&cpfl_rxq->base); |
| 1448 | } |
| 1449 | #ifdef CC_AVX512_SUPPORT |
| 1450 | if (vport->rx_use_avx512) { |
| 1451 | PMD_DRV_LOG(NOTICE, |
| 1452 | "Using Split AVX512 Vector Rx (port %d).", |
| 1453 | dev->data->port_id); |
| 1454 | dev->rx_pkt_burst = idpf_dp_splitq_recv_pkts_avx512; |
| 1455 | return; |
| 1456 | } |
| 1457 | #endif /* CC_AVX512_SUPPORT */ |
| 1458 | } |
| 1459 | PMD_DRV_LOG(NOTICE, |
| 1460 | "Using Split Scalar Rx (port %d).", |
| 1461 | dev->data->port_id); |
| 1462 | dev->rx_pkt_burst = idpf_dp_splitq_recv_pkts; |
| 1463 | } else { |
| 1464 | if (vport->rx_vec_allowed) { |
| 1465 | for (i = 0; i < dev->data->nb_rx_queues; i++) { |
| 1466 | cpfl_rxq = dev->data->rx_queues[i]; |
| 1467 | (void)idpf_qc_singleq_rx_vec_setup(&cpfl_rxq->base); |
| 1468 | } |
| 1469 | #ifdef CC_AVX512_SUPPORT |
no test coverage detected