Skip to contentSkip to conversation

get Rx/Tx packet burst mode information

RFC Superseded Haiyue Wang 2 participants 7 messages Sep 10, 2019 – Sep 25, 2019 Network drivers

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

v3 cover get Rx/Tx packet burst mode information

v1 -> v2:
Avoid ABI breaking, add a simple trace API to export string type information.

v2 -> v3:
Use bit fields to present the burst mode setting, and rename the APIs.

Haiyue Wang (4):
ethdev: add the API for getting burst mode information net/i40e: support to get the Rx/Tx burst mode net/ice: support to get the Rx/Tx burst mode app/testpmd: show the Rx/Tx burst mode description

 app/test-pmd/config.c                    | 25 ++++++++
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 drivers/net/i40e/i40e_ethdev.c           |  2 +
 drivers/net/i40e/i40e_ethdev.h           |  4 ++
 drivers/net/i40e/i40e_rxtx.c             | 72 +++++++++++++++++++++
 drivers/net/ice/ice_ethdev.c             |  2 +
 drivers/net/ice/ice_rxtx.c               | 54 ++++++++++++++++
 drivers/net/ice/ice_rxtx.h               |  4 ++
 lib/librte_ethdev/rte_ethdev.c           | 75 ++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 82 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      |  5 ++
 lib/librte_ethdev/rte_ethdev_version.map |  5 ++
 12 files changed, 338 insertions(+)
Signature · 1 line
2.17.1
#1 lore raw

RFC v3 1/4 ethdev: add the API for getting burst mode information

Some PMDs have more than one RX/TX burst paths, add the ethdev API that allows an application to retrieve the mode information about Rx/Tx packet burst such as Scalar or Vector, and Vector technology like AVX2.

---
 doc/guides/rel_notes/release_19_11.rst   |  8 +++
 lib/librte_ethdev/rte_ethdev.c           | 75 ++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h           | 82 ++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev_core.h      |  5 ++
 lib/librte_ethdev/rte_ethdev_version.map |  5 ++
 5 files changed, 175 insertions(+)
doc/guides/rel_notes/release_19_11.rst +8 -0
index 27cfbd9e3..1d80e50fb 100644
@@ -56,6 +56,14 @@ New Features
      Also, make sure to start the actual text at the margin.
      =========================================================
 
+* **Added RX/TX packet burst mode get API.**
+
+  Added two new functions ``rte_eth_rx_burst_mode_get`` and
+  ``rte_eth_tx_burst_mode_get`` that allow an application
+  to retrieve the mode information about RX/TX packet burst
+  such as Scalar or Vector, and Vector technology like AVX2.
+  Another new function ``rte_eth_burst_mode_option_name`` is
+  provided for burst mode options stringification.
 
 Removed Items
 -------------
lib/librte_ethdev/rte_ethdev.c +75 -0

81 lines not on this page · raw message

lib/librte_ethdev/rte_ethdev.h +82 -0

94 lines not on this page · raw message

lib/librte_ethdev/rte_ethdev_core.h +5 -0
index 2922d5b7c..f28c3da8e 100644
@@ -170,6 +170,9 @@ typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
 	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
 
+typedef void (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
+	uint16_t queue_id, struct rte_eth_burst_mode *mode);
+
 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
 /**< @internal Set MTU. */
 
@@ -418,6 +421,8 @@ struct eth_dev_ops {
 	eth_dev_infos_get_t        dev_infos_get; /**< Get device info. */
 	eth_rxq_info_get_t         rxq_info_get; /**< retrieve RX queue information. */
 	eth_txq_info_get_t         txq_info_get; /**< retrieve TX queue information. */
+	eth_burst_mode_get_t       rx_burst_mode_get; /**< Get RX burst mode */
+	eth_burst_mode_get_t       tx_burst_mode_get; /**< Get TX burst mode */
 	eth_fw_version_get_t       fw_version_get; /**< Get firmware version. */
 	eth_dev_supported_ptypes_get_t dev_supported_ptypes_get;
 	/**< Get packet types supported and identified by device. */
lib/librte_ethdev/rte_ethdev_version.map +5 -0
index 6df42a47b..e59d51648 100644
@@ -283,4 +283,9 @@ EXPERIMENTAL {
 
 	# added in 19.08
 	rte_eth_read_clock;
+
+	# added in 19.11
+	rte_eth_rx_burst_mode_get;
+	rte_eth_tx_burst_mode_get;
+	rte_eth_burst_mode_option_name;
 };
Signature · 1 line
2.17.1
#2 lore raw

RFC v3 2/4 net/i40e: support to get the Rx/Tx burst mode

In reply to Haiyue Wang

According to the selected Rx/Tx burst function name, retrieve the related burst mode options.

---
 drivers/net/i40e/i40e_ethdev.c |  2 +
 drivers/net/i40e/i40e_ethdev.h |  4 ++
 drivers/net/i40e/i40e_rxtx.c   | 72 ++++++++++++++++++++++++++++++++++
 3 files changed, 78 insertions(+)
drivers/net/i40e/i40e_ethdev.c +2 -0
index 4e40b7ab5..41296da01 100644
@@ -491,6 +491,8 @@ static const struct eth_dev_ops i40e_eth_dev_ops = {
 	.filter_ctrl                  = i40e_dev_filter_ctrl,
 	.rxq_info_get                 = i40e_rxq_info_get,
 	.txq_info_get                 = i40e_txq_info_get,
+	.rx_burst_mode_get            = i40e_rx_burst_mode_get,
+	.tx_burst_mode_get            = i40e_tx_burst_mode_get,
 	.mirror_rule_set              = i40e_mirror_rule_set,
 	.mirror_rule_reset            = i40e_mirror_rule_reset,
 	.timesync_enable              = i40e_timesync_enable,
drivers/net/i40e/i40e_ethdev.h +4 -0
index 38ac3ead6..3eb1b3780 100644
@@ -1177,6 +1177,10 @@ void i40e_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	struct rte_eth_rxq_info *qinfo);
 void i40e_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	struct rte_eth_txq_info *qinfo);
+void i40e_rx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			    struct rte_eth_burst_mode *mode);
+void i40e_tx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			    struct rte_eth_burst_mode *mode);
 struct i40e_ethertype_filter *
 i40e_sw_ethertype_filter_lookup(struct i40e_ethertype_rule *ethertype_rule,
 			const struct i40e_ethertype_filter_input *input);
drivers/net/i40e/i40e_rxtx.c +72 -0

84 lines not on this page · raw message

Signature · 1 line
2.17.1
#3 lore raw

RFC v3 3/4 net/ice: support to get the Rx/Tx burst mode

In reply to Haiyue Wang

According to the selected Rx/Tx burst function name, retrieve the related burst mode options.

---
 drivers/net/ice/ice_ethdev.c |  2 ++
 drivers/net/ice/ice_rxtx.c   | 54 ++++++++++++++++++++++++++++++++++++
 drivers/net/ice/ice_rxtx.h   |  4 +++
 3 files changed, 60 insertions(+)
drivers/net/ice/ice_ethdev.c +2 -0
index 63997fdfb..784e07744 100644
@@ -147,6 +147,8 @@ static const struct eth_dev_ops ice_eth_dev_ops = {
 	.vlan_pvid_set                = ice_vlan_pvid_set,
 	.rxq_info_get                 = ice_rxq_info_get,
 	.txq_info_get                 = ice_txq_info_get,
+	.rx_burst_mode_get            = ice_rx_burst_mode_get,
+	.tx_burst_mode_get            = ice_tx_burst_mode_get,
 	.get_eeprom_length            = ice_get_eeprom_length,
 	.get_eeprom                   = ice_get_eeprom,
 	.rx_queue_count               = ice_rx_queue_count,
drivers/net/ice/ice_rxtx.c +54 -0

66 lines not on this page · raw message

drivers/net/ice/ice_rxtx.h +4 -0
index e9214110c..8bdd4369c 100644
@@ -166,6 +166,10 @@ void ice_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 		      struct rte_eth_rxq_info *qinfo);
 void ice_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 		      struct rte_eth_txq_info *qinfo);
+void ice_rx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			   struct rte_eth_burst_mode *mode);
+void ice_tx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			   struct rte_eth_burst_mode *mode);
 int ice_rx_descriptor_status(void *rx_queue, uint16_t offset);
 int ice_tx_descriptor_status(void *tx_queue, uint16_t offset);
 void ice_set_default_ptype_table(struct rte_eth_dev *dev);
Signature · 1 line
2.17.1
#4 lore raw

RFC v3 4/4 app/testpmd: show the Rx/Tx burst mode description

In reply to Haiyue Wang

Add the 'Burst mode' section into command 'show rxq|txq info <port_id> <queue_id>' to show the Rx/Tx burst mode description like:
"Burst mode: Vector AVX2 Scattered"

---
 app/test-pmd/config.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
app/test-pmd/config.c +25 -0
index 1a5a5c13c..d10ad6cfa 100644
@@ -324,9 +324,21 @@ nic_stats_mapping_display(portid_t port_id)
 	       nic_stats_mapping_border, nic_stats_mapping_border);
 }
 
+static void
+burst_mode_options_display(uint64_t options)
+{
+	uint64_t opt;
+
+	for (opt = 1; options != 0; opt <<= 1, options >>= 1) {
+		if (options & 1)
+			printf(" %s", rte_eth_burst_mode_option_name(opt));
+	}
+}
+
 void
 rx_queue_infos_display(portid_t port_id, uint16_t queue_id)
 {
+	struct rte_eth_burst_mode mode;
 	struct rte_eth_rxq_info qinfo;
 	int32_t rc;
 	static const char *info_border = "*********************";
@@ -354,12 +366,19 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id)
 	printf("\nRX scattered packets: %s",
 		(qinfo.scattered_rx != 0) ? "on" : "off");
 	printf("\nNumber of RXDs: %hu", qinfo.nb_desc);
+
+	if (rte_eth_rx_burst_mode_get(port_id, queue_id, &mode) == 0) {
+		printf("\nBurst mode:");
+		burst_mode_options_display(mode.options);
+	}
+
 	printf("\n");
 }
 
 void
 tx_queue_infos_display(portid_t port_id, uint16_t queue_id)
 {
+	struct rte_eth_burst_mode mode;
 	struct rte_eth_txq_info qinfo;
 	int32_t rc;
 	static const char *info_border = "*********************";
@@ -383,6 +402,12 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id)
 	printf("\nTX deferred start: %s",
 		(qinfo.conf.tx_deferred_start != 0) ? "on" : "off");
 	printf("\nNumber of TXDs: %hu", qinfo.nb_desc);
+
+	if (rte_eth_tx_burst_mode_get(port_id, queue_id, &mode) == 0) {
+		printf("\nBurst mode:");
+		burst_mode_options_display(mode.options);
+	}
+
 	printf("\n");
 }
 
Signature · 1 line
2.17.1
Acked-by on v3 4/4
#5 lore raw

Re: [dpdk-dev] [RFC v3 4/4] app/testpmd: show the Rx/Tx burst mode description

Quoted 9 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Haiyue Wang
Sent: Tuesday, September 10, 2019 5:34 PM
To: [email protected]; Yigit, Ferruh <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Cc: Wang, Haiyue <[email protected]>
Subject: [dpdk-dev] [RFC v3 4/4] app/testpmd: show the Rx/Tx burst mode description

Quoted 5 lines

Add the 'Burst mode' section into command 'show rxq|txq info <port_id> <queue_id>' to show the Rx/Tx burst mode description like:
"Burst mode: Vector AVX2 Scattered"

#6 lore raw

Re: [dpdk-dev] [RFC v3 4/4] app/testpmd: show the Rx/Tx burst mode description

Thanks, Bernard.

Hi Ferruh,

Can this series patches be for 20.02 upstream ?

BR,
Haiyue

Quoted 24 lines

-----Original Message-----
From: Iremonger, Bernard
Sent: Friday, September 13, 2019 00:08
To: Wang, Haiyue <[email protected]>; [email protected]; Yigit, Ferruh <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Cc: Wang, Haiyue <[email protected]>
Subject: RE: [dpdk-dev] [RFC v3 4/4] app/testpmd: show the Rx/Tx burst mode description

Quoted 9 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Haiyue Wang
Sent: Tuesday, September 10, 2019 5:34 PM
To: [email protected]; Yigit, Ferruh <[email protected]>; [email protected]; Sun, Chenmin <[email protected]>
Cc: Wang, Haiyue <[email protected]>
Subject: [dpdk-dev] [RFC v3 4/4] app/testpmd: show the Rx/Tx burst mode description

Quoted 5 lines

Add the 'Burst mode' section into command 'show rxq|txq info <port_id> <queue_id>' to show the Rx/Tx burst mode description like:
"Burst mode: Vector AVX2 Scattered"