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 task 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/nics/hinic3.rst | 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 ++ 6 files changed, 38 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/nics/hinic3.rst b/doc/guides/nics/hinic3.rst index c74b86b538..f46670e79f 100644 --- a/doc/guides/nics/hinic3.rst +++ b/doc/guides/nics/hinic3.rst @@ -24,6 +24,7 @@ Features - TSO offload - Promiscuous mode - Port hardware statistics +- Burst mode info - Jumbo frames - Link state information - Link flow control diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst index 0513d09d9f..04105af387 100644 --- a/doc/guides/rel_notes/release_26_11.rst +++ b/doc/guides/rel_notes/release_26_11.rst @@ -144,6 +144,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 5c4faef83f..23d28a585c 100644 --- a/drivers/net/hinic3/hinic3_ethdev.c +++ b/drivers/net/hinic3/hinic3_ethdev.c @@ -3905,6 +3905,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, @@ -3959,6 +3960,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

