Skip to contentSkip to conversation

net/hns3: support trace Rx/Tx burst function

PATCH Applied Min Hu (Connor) 3 participants 5 messages Apr 9, 2021 – Apr 13, 2021 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net/hns3: support trace Rx/Tx burst function

From: Chengwen Feng <[email protected]>

This patch adds debug info for Rx/Tx burst function which was choosing.

---
 drivers/net/hns3/hns3_rxtx.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
drivers/net/hns3/hns3_rxtx.c +17 -0
index b45afcd..19adf00 100644
@@ -4205,6 +4205,22 @@ hns3_dummy_rxtx_burst(void *dpdk_txq __rte_unused,
 	return 0;
 }
 
+static void
+hns3_trace_rxtx_function(struct rte_eth_dev *dev)
+{
+	struct hns3_hw *hw = HNS3_DEV_PRIVATE_TO_HW(dev->data->dev_private);
+	struct rte_eth_burst_mode rx_mode;
+	struct rte_eth_burst_mode tx_mode;
+
+	memset(&rx_mode, 0, sizeof(rx_mode));
+	memset(&tx_mode, 0, sizeof(tx_mode));
+	(void)hns3_rx_burst_mode_get(dev, 0, &rx_mode);
+	(void)hns3_tx_burst_mode_get(dev, 0, &tx_mode);
+
+	hns3_dbg(hw, "using rx_pkt_burst: %s, tx_pkt_burst: %s.",
+		 rx_mode.info, tx_mode.info);
+}
+
 void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 {
 	struct hns3_adapter *hns = eth_dev->data->dev_private;
@@ -4217,6 +4233,7 @@ void hns3_set_rxtx_function(struct rte_eth_dev *eth_dev)
 		eth_dev->tx_pkt_burst = hns3_get_tx_function(eth_dev, &prep);
 		eth_dev->tx_pkt_prepare = prep;
 		eth_dev->tx_descriptor_status = hns3_dev_tx_descriptor_status;
+		hns3_trace_rxtx_function(eth_dev);
 	} else {
 		eth_dev->rx_pkt_burst = hns3_dummy_rxtx_burst;
 		eth_dev->tx_pkt_burst = hns3_dummy_rxtx_burst;
Signature · 1 line
2.7.4
#3 lore raw
Quoted 7 lines · David Marchand
Quoted 6 lines · Ferruh Yigit
Quoted 4 lines · Min Hu (Connor)

From: Chengwen Feng <[email protected]>

This patch adds debug info for Rx/Tx burst function which was choosing.

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

Applied to dpdk-next-net/main, thanks.

Can we avoid mentioning "trace" in the title?
This is to avoid confusion with rte_trace.

Indeed, I also though if it is adding rte_trace support when I first see the title, I will update it to:
"net/hns3: log selected datapath"

#4 lore raw
Quoted 11 lines · Ferruh Yigit
Quoted 10 lines · David Marchand
Quoted 9 lines · Ferruh Yigit
Quoted 6 lines · Min Hu (Connor)

From: Chengwen Feng <[email protected]>

This patch adds debug info for Rx/Tx burst function which was choosing.

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

Applied to dpdk-next-net/main, thanks.

Can we avoid mentioning "trace" in the title?
This is to avoid confusion with rte_trace.

Indeed, I also though if it is adding rte_trace support when I first see the title, I will update it to:
"net/hns3: log selected datapath"

OK, thanks Ferruh and David.

Quoted 1 line

.