Expose the active Tx burst mode and its offloads via the tx_burst_mode_get callback so applications can query how each queue sends packets. The string is derived from the Tx burst function actually installed on the device, so it reports the compact CQE path only when that path is really in use, and also lists the enabled offloads. Advertise the new capability in the feature matrix.
Signed-off-by: Jiacheng Ye <[email protected]> --- doc/guides/nics/features/hinic3.ini | 1 + doc/guides/rel_notes/release_26_11.rst | 1 + drivers/net/hinic3/hinic3_ethdev.c | 2 ++ drivers/net/hinic3/hinic3_tx.c | 31 ++++++++++++++++++++++++++ drivers/net/hinic3/hinic3_tx.h | 2 ++ 5 files changed, 37 insertions(+) diff --git a/doc/guides/nics/features/hinic3.ini b/doc/guides/nics/features/hinic3.ini index 81c3e85410..ba30a850e9 100644 --- a/doc/guides/nics/features/hinic3.ini +++ b/doc/guides/nics/features/hinic3.ini @@ -9,6 +9,7 @@ Link speed configuration = Y Rx interrupt = Y Queue start/stop = Y Runtime queue setup = Y +Burst mode info = Y MTU update = Y Scattered Rx = Y TSO = Y diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst index 89a182a17a..aba7601a04 100644 --- a/doc/guides/rel_notes/release_26_11.rst +++ b/doc/guides/rel_notes/release_26_11.rst @@ -179,6 +179,7 @@ New Features * Added a compact CQE receive data path. * Extended TCP segmentation offload (TSO) to 255 segments. * Added a compact task transmit data path. + * Added Tx burst mode reporting. * **Updated Intel iavf driver.** diff --git a/drivers/net/hinic3/hinic3_ethdev.c b/drivers/net/hinic3/hinic3_ethdev.c index 0f38e6b2b6..4bbc1a1efb 100644 --- a/drivers/net/hinic3/hinic3_ethdev.c +++ b/drivers/net/hinic3/hinic3_ethdev.c @@ -3892,6 +3892,7 @@ static const struct eth_dev_ops hinic3_pmd_ops = { .mac_addr_add = hinic3_mac_addr_add, .set_mc_addr_list = hinic3_set_mc_addr_list, .flow_ops_get = hinic3_dev_filter_ctrl, + .tx_burst_mode_get = hinic3_tx_burst_mode_get, .fec_get_capability = hinic3_fec_capability_get, .fec_get = hinic3_fec_get, .fec_set = hinic3_fec_set, @@ -3946,6 +3947,7 @@ static const struct eth_dev_ops hinic3_pmd_vf_ops = { .set_mc_addr_list = hinic3_set_mc_addr_list, .flow_ops_get = hinic3_dev_filter_ctrl, .eth_dev_priv_dump = hinic3_eth_dev_priv_dump, + .tx_burst_mode_get = hinic3_tx_burst_mode_get, }; /** diff --git a/drivers/net/hinic3/hinic3_tx.c b/drivers/net/hinic3/hinic3_tx.c index 3f44814405..0bee8a8691 100644 --- a/drivers/net/hinic3/hinic3_tx.c +++ b/drivers/net/hinic3/hinic3_tx.c @@ -1500,6 +1500,37 @@ hinic3_flush_txqs(struct hinic3_nic_dev *nic_dev) } } +int +hinic3_tx_burst_mode_get(struct rte_eth_dev *dev, + uint16_t tx_queue_id, + struct rte_eth_burst_mode *mode) +{ + uint64_t tx_offloads = dev->data->dev_conf.txmode.offloads; + struct hinic3_nic_dev *nic_dev; + struct hinic3_txq *txq = NULL; + + nic_dev = HINIC3_ETH_DEV_TO_PRIVATE_NIC_DEV(dev); + txq = nic_dev->txqs[tx_queue_id]; + if (!txq) + return -EINVAL; + + snprintf(mode->info, sizeof(mode->info), + "%s%s%s%s%s", + dev->tx_pkt_burst == hinic3_xmit_pkts_compact_task ? + "compact task" : "scalar", + (tx_offloads & RTE_ETH_TX_OFFLOAD_MULTI_SEGS) ? " + MULTI" : "", + (tx_offloads & (RTE_ETH_TX_OFFLOAD_TCP_TSO | + RTE_ETH_TX_OFFLOAD_VXLAN_TNL_TSO)) ? " + TSO" : "", + (tx_offloads & (RTE_ETH_TX_OFFLOAD_IPV4_CKSUM | + RTE_ETH_TX_OFFLOAD_UDP_CKSUM | + RTE_ETH_TX_OFFLOAD_TCP_CKSUM | + RTE_ETH_TX_OFFLOAD_SCTP_CKSUM | + RTE_ETH_TX_OFFLOAD_OUTER_IPV4_CKSUM)) ? " + CKSUM" : "", + (tx_offloads & RTE_ETH_TX_OFFLOAD_VLAN_INSERT) ? " + VLAN" : ""); + + return 0; +} + /** * It is responsible for sending data packets. * diff --git a/drivers/net/hinic3/hinic3_tx.h b/drivers/net/hinic3/hinic3_tx.h index 51024e4e99..3a6451f69b 100644 --- a/drivers/net/hinic3/hinic3_tx.h +++ b/drivers/net/hinic3/hinic3_tx.h @@ -404,4 +404,6 @@ uint16_t hinic3_prep_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb int hinic3_stop_sq(struct hinic3_txq *txq); int hinic3_start_all_sqs(struct rte_eth_dev *eth_dev); int hinic3_tx_done_cleanup(void *txq, uint32_t free_cnt); +int hinic3_tx_burst_mode_get(struct rte_eth_dev *dev, uint16_t tx_queue_id, + struct rte_eth_burst_mode *mode); #endif /**< _HINIC3_TX_H_ */ -- 2.33.0

