Skip to contentSkip to conversation

get Rx/Tx packet burst mode information

PATCH Superseded Haiyue Wang 3 participants 8 messages Sep 26, 2019 – Oct 14, 2019 Network drivers

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

v2 cover get Rx/Tx packet burst mode information

v1 -> v2:
1). Change the return type of dev_ops callback from 'void' to
'int'.
2). Update the ice/i40 PMD patches with clear git commit log.

RFCv3 -> v1:

	https://patchwork.dpdk.org/patch/59103/
	https://patchwork.dpdk.org/patch/59104/
	https://patchwork.dpdk.org/patch/59105/
	https://patchwork.dpdk.org/patch/59106/
	1). Use the function 'rte_bsf64' to iterate the options for
	    getting the name.

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

 app/test-pmd/config.c                    | 29 +++++++++
 doc/guides/rel_notes/release_19_11.rst   |  9 +++
 drivers/net/i40e/i40e_ethdev.c           |  2 +
 drivers/net/i40e/i40e_ethdev.h           |  4 ++
 drivers/net/i40e/i40e_rxtx.c             | 76 ++++++++++++++++++++++
 drivers/net/ice/ice_ethdev.c             |  2 +
 drivers/net/ice/ice_rxtx.c               | 58 +++++++++++++++++
 drivers/net/ice/ice_rxtx.h               |  4 ++
 lib/librte_ethdev/rte_ethdev.c           | 71 ++++++++++++++++++++
 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, 347 insertions(+)
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 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   |  9 +++
 lib/librte_ethdev/rte_ethdev.c           | 71 ++++++++++++++++++++
 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, 172 insertions(+)
doc/guides/rel_notes/release_19_11.rst +9 -0
index 1b8bd6f35..e77ace531 100644
@@ -56,6 +56,15 @@ 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.
+
 * **Updated the Intel ice driver.**
 
   Updated the Intel ice driver with new features and improvements, including:
lib/librte_ethdev/rte_ethdev.c +71 -0

77 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 dcb5ae651..392aea8e6 100644
@@ -294,6 +294,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 int (*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. */
 
@@ -542,6 +545,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

PATCH v2 2/4 net/i40e: add Rx/Tx burst mode get callbacks

In reply to Haiyue Wang

Retrieve burst mode options according to the selected Rx/Tx burst function name.

---
 drivers/net/i40e/i40e_ethdev.c |  2 +
 drivers/net/i40e/i40e_ethdev.h |  4 ++
 drivers/net/i40e/i40e_rxtx.c   | 76 ++++++++++++++++++++++++++++++++++
 3 files changed, 82 insertions(+)
drivers/net/i40e/i40e_ethdev.c +2 -0
index 76cd9f510..e212a7adb 100644
@@ -493,6 +493,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 261954b9a..2ddaffbeb 100644
@@ -1209,6 +1209,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);
+int i40e_rx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			   struct rte_eth_burst_mode *mode);
+int 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 +76 -0

88 lines not on this page · raw message

Signature · 1 line
2.17.1
#3 lore raw

PATCH v2 3/4 net/ice: add Rx/Tx burst mode get callbacks

In reply to Haiyue Wang

Retrieve burst mode options according to the selected Rx/Tx burst function name.

---
 drivers/net/ice/ice_ethdev.c |  2 ++
 drivers/net/ice/ice_rxtx.c   | 58 ++++++++++++++++++++++++++++++++++++
 drivers/net/ice/ice_rxtx.h   |  4 +++
 3 files changed, 64 insertions(+)
drivers/net/ice/ice_ethdev.c +2 -0
index c126d962c..38b141eea 100644
@@ -158,6 +158,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 +58 -0

70 lines not on this page · raw message

drivers/net/ice/ice_rxtx.h +4 -0
index 25b3822df..31c53d535 100644
@@ -168,6 +168,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);
+int ice_rx_burst_mode_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			  struct rte_eth_burst_mode *mode);
+int 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

PATCH v2 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 | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
app/test-pmd/config.c +29 -0
index a3b6cbd08..6676e8651 100644
@@ -330,9 +330,25 @@ 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)
+{
+	int offset;
+
+	while (options != 0) {
+		offset = rte_bsf64(options);
+
+		printf(" %s",
+		       rte_eth_burst_mode_option_name(1ULL << offset));
+
+		options &= ~(1ULL << offset);
+	}
+}
+
 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 = "*********************";
@@ -360,12 +376,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 = "*********************";
@@ -389,6 +412,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
Reviewed-by on the v2 series
#5 lore raw
In reply to Haiyue Wang
Quoted 19 lines · Haiyue Wang

v1 -> v2:
1). Change the return type of dev_ops callback from 'void' to
'int'.
2). Update the ice/i40 PMD patches with clear git commit log.

RFCv3 -> v1:

	https://patchwork.dpdk.org/patch/59103/
	https://patchwork.dpdk.org/patch/59104/
	https://patchwork.dpdk.org/patch/59105/
	https://patchwork.dpdk.org/patch/59106/
	1). Use the function 'rte_bsf64' to iterate the options for
	    getting the name.

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

Quoted 17 lines
app/test-pmd/config.c                    | 29 +++++++++
doc/guides/rel_notes/release_19_11.rst   |  9 +++
drivers/net/i40e/i40e_ethdev.c           |  2 +
drivers/net/i40e/i40e_ethdev.h           |  4 ++
drivers/net/i40e/i40e_rxtx.c             | 76 ++++++++++++++++++++++
drivers/net/ice/ice_ethdev.c             |  2 +
drivers/net/ice/ice_rxtx.c               | 58 +++++++++++++++++
drivers/net/ice/ice_rxtx.h               |  4 ++
lib/librte_ethdev/rte_ethdev.c           | 71 ++++++++++++++++++++
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, 347 insertions(+)
Signature · 1 line
2.17.1

For series:

#6 lore raw
In reply to Haiyue Wang
Quoted 13 lines · Haiyue Wang

v1 -> v2:
1). Change the return type of dev_ops callback from 'void' to
'int'.
2). Update the ice/i40 PMD patches with clear git commit log.

RFCv3 -> v1:

	https://patchwork.dpdk.org/patch/59103/
	https://patchwork.dpdk.org/patch/59104/
	https://patchwork.dpdk.org/patch/59105/
	https://patchwork.dpdk.org/patch/59106/
	1). Use the function 'rte_bsf64' to iterate the options for
	    getting the name.
Quoted 5 lines

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

Hi Haiyue,

Overall lgtm, but what do you think adding a new feature to default.ini for this, something like 'Burst mode info"?

And i40e and ixgbe patches can add this feature to the PMD .ini files.

Also please remind 'doc/guides/nics/features.rst' also needs to be updated with default.ini update.

Thanks,
ferruh

#7 lore raw

Hi, Ferruh

Quoted 30 lines

-----Original Message-----
From: Yigit, Ferruh
Sent: Monday, October 14, 2019 20:12
To: Wang, Haiyue <[email protected]>; [email protected]; Ye, Xiaolong <[email protected]>
Cc: Kinsella, Ray <[email protected]>; Iremonger, Bernard <[email protected]>; Sun, Chenmin <[email protected]>
Subject: Re: [PATCH v2 0/4] get Rx/Tx packet burst mode information

Quoted 13 lines · Haiyue Wang

v1 -> v2:
1). Change the return type of dev_ops callback from 'void' to
'int'.
2). Update the ice/i40 PMD patches with clear git commit log.

RFCv3 -> v1:

	https://patchwork.dpdk.org/patch/59103/
	https://patchwork.dpdk.org/patch/59104/
	https://patchwork.dpdk.org/patch/59105/
	https://patchwork.dpdk.org/patch/59106/
	1). Use the function 'rte_bsf64' to iterate the options for
	    getting the name.
Quoted 5 lines

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

Hi Haiyue,

Quoted 8 lines

Overall lgtm, but what do you think adding a new feature to default.ini for this, something like 'Burst mode info"?

And i40e and ixgbe patches can add this feature to the PMD .ini files.

Also please remind 'doc/guides/nics/features.rst' also needs to be updated with default.ini update.

No problem, I will update it in v3.

Quoted 2 lines

Thanks,
ferruh