| 1511 | } |
| 1512 | |
| 1513 | void |
| 1514 | cpfl_set_tx_function(struct rte_eth_dev *dev) |
| 1515 | { |
| 1516 | struct cpfl_vport *cpfl_vport = dev->data->dev_private; |
| 1517 | struct idpf_vport *vport = &cpfl_vport->base; |
| 1518 | #ifdef RTE_ARCH_X86 |
| 1519 | #ifdef CC_AVX512_SUPPORT |
| 1520 | struct cpfl_tx_queue *cpfl_txq; |
| 1521 | int i; |
| 1522 | #endif /* CC_AVX512_SUPPORT */ |
| 1523 | |
| 1524 | if (cpfl_tx_vec_dev_check_default(dev) == CPFL_VECTOR_PATH && |
| 1525 | rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_128) { |
| 1526 | vport->tx_vec_allowed = true; |
| 1527 | if (rte_vect_get_max_simd_bitwidth() >= RTE_VECT_SIMD_512) |
| 1528 | #ifdef CC_AVX512_SUPPORT |
| 1529 | { |
| 1530 | if (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F) == 1 && |
| 1531 | rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512BW) == 1) |
| 1532 | vport->tx_use_avx512 = true; |
| 1533 | if (vport->tx_use_avx512) { |
| 1534 | for (i = 0; i < dev->data->nb_tx_queues; i++) { |
| 1535 | cpfl_txq = dev->data->tx_queues[i]; |
| 1536 | idpf_qc_tx_vec_avx512_setup(&cpfl_txq->base); |
| 1537 | } |
| 1538 | } |
| 1539 | } |
| 1540 | #else |
| 1541 | PMD_DRV_LOG(NOTICE, |
| 1542 | "AVX512 is not supported in build env"); |
| 1543 | #endif /* CC_AVX512_SUPPORT */ |
| 1544 | } else { |
| 1545 | vport->tx_vec_allowed = false; |
| 1546 | } |
| 1547 | #endif /* RTE_ARCH_X86 */ |
| 1548 | |
| 1549 | #ifdef RTE_ARCH_X86 |
| 1550 | if (vport->txq_model == VIRTCHNL2_QUEUE_MODEL_SPLIT) { |
| 1551 | if (vport->tx_vec_allowed) { |
| 1552 | #ifdef CC_AVX512_SUPPORT |
| 1553 | if (vport->tx_use_avx512) { |
| 1554 | PMD_DRV_LOG(NOTICE, |
| 1555 | "Using Split AVX512 Vector Tx (port %d).", |
| 1556 | dev->data->port_id); |
| 1557 | dev->tx_pkt_burst = idpf_dp_splitq_xmit_pkts_avx512; |
| 1558 | dev->tx_pkt_prepare = idpf_dp_prep_pkts; |
| 1559 | return; |
| 1560 | } |
| 1561 | #endif /* CC_AVX512_SUPPORT */ |
| 1562 | } |
| 1563 | PMD_DRV_LOG(NOTICE, |
| 1564 | "Using Split Scalar Tx (port %d).", |
| 1565 | dev->data->port_id); |
| 1566 | dev->tx_pkt_burst = idpf_dp_splitq_xmit_pkts; |
| 1567 | dev->tx_pkt_prepare = idpf_dp_prep_pkts; |
| 1568 | } else { |
| 1569 | if (vport->tx_vec_allowed) { |
| 1570 | #ifdef CC_AVX512_SUPPORT |
no test coverage detected