[PATCH 25/27] net/hinic3: add Tx burst mode get
Jiacheng Ye
yejiacheng4 at h-partners.com
Mon Oct 19 17:19:27 CEST 2026
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 encodes whether the compact CQE path is in
use and which offloads are enabled.
Signed-off-by: Jiacheng Ye <yejiacheng4 at h-partners.com>
---
doc/guides/nics/features/hinic3.ini | 1 +
drivers/net/hinic3/hinic3_ethdev.c | 2 ++
drivers/net/hinic3/hinic3_tx.c | 32 +++++++++++++++++++++++++++++
drivers/net/hinic3/hinic3_tx.h | 2 ++
4 files changed, 37 insertions(+)
diff --git a/doc/guides/nics/features/hinic3.ini b/doc/guides/nics/features/hinic3.ini
index 6e3b52f96d..03109675ff 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 = P
Queue start/stop = Y
Runtime queue setup = Y
+Burst mode info = Y
MTU update = Y
Scattered Rx = Y
TSO = Y
diff --git a/drivers/net/hinic3/hinic3_ethdev.c b/drivers/net/hinic3/hinic3_ethdev.c
index 05382bc6db..db41614505 100644
--- a/drivers/net/hinic3/hinic3_ethdev.c
+++ b/drivers/net/hinic3/hinic3_ethdev.c
@@ -3715,6 +3715,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,
@@ -3769,6 +3770,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 6d2dc4ab8f..02d8802c0b 100644
--- a/drivers/net/hinic3/hinic3_tx.c
+++ b/drivers/net/hinic3/hinic3_tx.c
@@ -1303,6 +1303,38 @@ 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%s",
+ (nic_dev->config.rx_cqe_compact_en == HINIC3_RX_CQE_COMPACT_EN) ?
+ "compact CQE" : "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" : "",
+ (tx_offloads & RTE_ETH_TX_OFFLOAD_QINQ_INSERT) ? " + QINQ" : "");
+
+ 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 7780819e8e..d66b6031c7 100644
--- a/drivers/net/hinic3/hinic3_tx.h
+++ b/drivers/net/hinic3/hinic3_tx.h
@@ -395,4 +395,6 @@ uint16_t hinic3_xmit_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
More information about the dev
mailing list