Skip to contentSkip to conversation

get Rx/Tx packet burst mode information

PATCH Superseded Haiyue Wang 4 participants 15 messages Sep 26, 2019 – Sep 27, 2019 Network drivers

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

cover get Rx/Tx packet burst mode information

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: 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                    | 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             | 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, 343 insertions(+)
Signature · 1 line
2.17.1
#1 lore raw

PATCH 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           | 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, 176 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 +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 dcb5ae651..b24b68363 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 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. */
 
@@ -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

Re: [dpdk-dev] [PATCH v1 1/4] ethdev: add the API for getting burst mode information

Quoted 15 lines · Haiyue Wang

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           | 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, 176 insertions(+)

[snip]

lib/librte_ethdev/rte_ethdev_core.h typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev, · line 299

Quoted 3 lines
lib/librte_ethdev/rte_ethdev_core.h +3 -0
+typedef void (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
+	uint16_t queue_id, struct rte_eth_burst_mode *mode);
+

There is ongoing effort to change the return type of dev_ops callback from void to int, like [1]

Better to keep align with it.

[1] http://patchwork.dpdk.org/project/dpdk/list/?series=6391

Thanks,
Xiaolong

Quoted 29 lines

typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu); /**< @internal Set MTU. */

lib/librte_ethdev/rte_ethdev_core.h +2 -0
@@ -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
#3 lore raw

Re: [dpdk-dev] [PATCH v1 1/4] ethdev: add the API for getting burst mode information

Quoted 34 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Thursday, September 26, 2019 21:41
To: Wang, Haiyue <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Kinsella, Ray <[email protected]>; Iremonger, Bernard <[email protected]>; Sun, Chenmin <[email protected]>
Subject: Re: [PATCH v1 1/4] ethdev: add the API for getting burst mode information

Quoted 15 lines · Haiyue Wang

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           | 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, 176 insertions(+)

[snip]

lib/librte_ethdev/rte_ethdev_core.h typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev, · line 299

Quoted 3 lines
lib/librte_ethdev/rte_ethdev_core.h +3 -0
+typedef void (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,
+	uint16_t queue_id, struct rte_eth_burst_mode *mode);
+

There is ongoing effort to change the return type of dev_ops callback from void to int, like [1]

Quoted 4 lines

Better to keep align with it.

[1] http://patchwork.dpdk.org/project/dpdk/list/?series=6391

OK, will update on v2.

Quoted 32 lines

Thanks,
Xiaolong

Quoted 29 lines

typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu); /**< @internal Set MTU. */

lib/librte_ethdev/rte_ethdev_core.h +2 -0
@@ -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 -1
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;
 };
--

2.17.1

#4 lore raw

PATCH 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 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..abbda1ae4 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);
+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
#5 lore raw

Re: [dpdk-dev] [PATCH v1 2/4] net/i40e: support to get the Rx/Tx burst mode

What about add Rx/Tx burst mode get callbacks form the commit subject?

Quoted 3 lines · Haiyue Wang

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

How about:

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

Thanks,
Xiaolong

#6 lore raw

Re: [dpdk-dev] [PATCH v1 2/4] net/i40e: support to get the Rx/Tx burst mode

Quoted 10 lines

-----Original Message-----
From: Ye, Xiaolong
Sent: Thursday, September 26, 2019 21:50
To: Wang, Haiyue <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Kinsella, Ray <[email protected]>; Iremonger, Bernard <[email protected]>; Sun, Chenmin <[email protected]>
Subject: Re: [PATCH v1 2/4] net/i40e: support to get the Rx/Tx burst mode

What about add Rx/Tx burst mode get callbacks form the commit subject?

+1, this makes patch clear, thanks.

Quoted 10 lines · Haiyue Wang
Quoted 3 lines

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

How about:

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

+1, clear log, really. ;-)

Quoted 2 lines

Thanks,
Xiaolong

#7 lore raw

PATCH 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 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 +54 -0

66 lines not on this page · raw message

drivers/net/ice/ice_rxtx.h +4 -0
index 25b3822df..eccfbe93f 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);
+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
#8 lore raw

PATCH 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 957c61fbe..ada89a19d 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 v1 4/4
#9 lore raw

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

Quoted 76 lines · 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 +15 -0
index 957c61fbe..ada89a19d 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) {

app/test-pmd/config.c +1 -0
+	struct rte_eth_burst_mode mode;
	struct rte_eth_rxq_info qinfo;
	int32_t rc;
	static const char *info_border = "*********************";
app/test-pmd/config.c +6 -0
@@ -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) {

app/test-pmd/config.c +1 -0
+	struct rte_eth_burst_mode mode;
	struct rte_eth_txq_info qinfo;
	int32_t rc;
	static const char *info_border = "*********************";
app/test-pmd/config.c +6 -0
@@ -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
#10 lore raw
In reply to Haiyue Wang
Quoted 14 lines · On Thu, 26 Sep 2019 19:48:14 +0800 Haiyue Wang <[email protected]> wrote:

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: 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

Quoted 14 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             | 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, 343 insertions(+)

A couple of meta comments:
1) Could this be part of dev_info_get somehow?

2) Why should application care? Is this just a test hook?

#11 lore raw

Hi Stephen,

Quoted 41 lines

-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, September 26, 2019 23:57
To: Wang, Haiyue <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Ye, Xiaolong <[email protected]>; Kinsella, Ray <[email protected]>; Iremonger, Bernard <[email protected]>; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information

Quoted 14 lines · On Thu, 26 Sep 2019 19:48:14 +0800 Haiyue Wang <[email protected]> wrote:

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: 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

Quoted 14 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             | 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, 343 insertions(+)
Quoted 3 lines

A couple of meta comments:
1) Could this be part of dev_info_get somehow?

https://patchwork.dpdk.org/patch/57624/
'Think of a better way that doesn't break ABI.' ;-)

Quoted 1 line

2) Why should application care? Is this just a test hook?

https://patches.dpdk.org/cover/57623/
This is from FD.io VPP's bug, and finally, we come out this API for application accessing the burst mode information. It can be used as a simple trace or something like performance analysis like why slow ? Not in vector, anyway, application can get this burst mode information now, not just open PMD debug log level.

#12 lore raw
Quoted 43 lines · Haiyue

Hi Stephen,

Quoted 41 lines

-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, September 26, 2019 23:57
To: Wang, Haiyue <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Ye, Xiaolong <[email protected]>; Kinsella, Ray <[email protected]>; Iremonger, Bernard <[email protected]>; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information

Quoted 28 lines · On Thu, 26 Sep 2019 19:48:14 +0800 Haiyue Wang <[email protected]> wrote:

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: 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                    | 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             | 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, 343 insertions(+)
Quoted 6 lines
Quoted 3 lines

A couple of meta comments:
1) Could this be part of dev_info_get somehow?

https://patchwork.dpdk.org/patch/57624/
'Think of a better way that doesn't break ABI.' ;-)

That comment was made relative to 19.08, but 19.11 is the time where API/ABI breakage is allowed.

Quoted 9 lines
Quoted 1 line

2) Why should application care? Is this just a test hook?

https://patches.dpdk.org/cover/57623/
This is from FD.io VPP's bug, and finally, we come out this API for application accessing the burst mode information. It can be used as a simple trace or something like performance analysis like why slow ? Not in vector, anyway, application can get this burst mode information now, not just open PMD debug log level.

From an architecture perspective, diagnostics are good but VPP is probably taking that too far. It is possible to expose local symbols if they want to keep using dlsym() by adjusting linker flags. It is more that VPP is stripping everything. Since VPP has chosen to go their own way is fixable inside VPP without changing DPDK. Also, long term VPP is going away from using DPDK drivers. Probably soon they will have their own drivers for i40e and ice anyway.

The basis of my concern is that this is one of those kind of API's that creates long term technical debt around supporting it as other things change.

#13 lore raw
Quoted 50 lines · Stephen Hemminger
Quoted 47 lines · Haiyue

Hi Stephen,

Quoted 44 lines

-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, September 26, 2019 23:57
To: Wang, Haiyue <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Ye, Xiaolong <[email protected]>; Kinsella, Ray <[email protected]>; Iremonger, Bernard <[email protected]>; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information

Quoted 14 lines · On Thu, 26 Sep 2019 19:48:14 +0800 Haiyue Wang <[email protected]> wrote:

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: 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

Quoted 14 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             | 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, 343 insertions(+)

A couple of meta comments:
1) Could this be part of dev_info_get somehow?

Quoted 5 lines
Quoted 2 lines

https://patchwork.dpdk.org/patch/57624/
'Think of a better way that doesn't break ABI.' ;-)

That comment was made relative to 19.08, but 19.11 is the time where API/ABI breakage is allowed.

'rte_eth_dev_info_get()' is already a little messy, yes this can be part of it but I think separate, smaller, better defined APIs are better. Also almost everybody interested in 'rte_eth_dev_info_get()', but not sure everyone will be interested in this info.

Quoted 24 lines
Quoted 10 lines
Quoted 2 lines

2) Why should application care? Is this just a test hook?

https://patches.dpdk.org/cover/57623/
This is from FD.io VPP's bug, and finally, we come out this API for application accessing the burst mode information. It can be used as a simple trace or something like performance analysis like why slow ? Not in vector, anyway, application can get this burst mode information now, not just open PMD debug log level.

From an architecture perspective, diagnostics are good but VPP is probably taking that too far. It is possible to expose local symbols if they want to keep using dlsym() by adjusting linker flags. It is more that VPP is stripping everything. Since VPP has chosen to go their own way is fixable inside VPP without changing DPDK. Also, long term VPP is going away from using DPDK drivers. Probably soon they will have their own drivers for i40e and ice anyway.

The basis of my concern is that this is one of those kind of API's that creates long term technical debt around supporting it as other things change.

#14 lore raw
In reply to Stephen Hemminger
Quoted 60 lines

-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Friday, September 27, 2019 01:15
To: Wang, Haiyue <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Ye, Xiaolong <[email protected]>; Kinsella, Ray <[email protected]>; Iremonger, Bernard <[email protected]>; Sun, Chenmin <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information

Quoted 8 lines · Haiyue

Hi Stephen,

Quoted 6 lines

-----Original Message-----
From: Stephen Hemminger [mailto:[email protected]]
Sent: Thursday, September 26, 2019 23:57
To: Wang, Haiyue <[email protected]>
Cc: [email protected]; Yigit, Ferruh <[email protected]>; Ye, Xiaolong <[email protected]>; Kinsella, Ray <[email protected]>; Iremonger, Bernard <[email protected]>; Sun,

Chenmin

Quoted 39 lines
Quoted 38 lines

<[email protected]>
Subject: Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information

Quoted 14 lines · On Thu, 26 Sep 2019 19:48:14 +0800 Haiyue Wang <[email protected]> wrote:

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: 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

Quoted 14 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             | 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, 343 insertions(+)

A couple of meta comments:
1) Could this be part of dev_info_get somehow?

Quoted 6 lines
Quoted 2 lines

https://patchwork.dpdk.org/patch/57624/
'Think of a better way that doesn't break ABI.' ;-)

That comment was made relative to 19.08, but 19.11 is the time where API/ABI breakage is allowed.

Since 'rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)' focuses on 'port' level, the new rx/tx_burst_mode API can support 'queue' level:
'rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id ...', in other words, PMD can optimize their queues in Vector/Scalar/... modes for each queue, not have to just one mode for all queues at the same time, this API can return "Per Queue" information.

Quoted 19 lines
Quoted 9 lines
Quoted 1 line

2) Why should application care? Is this just a test hook?

https://patches.dpdk.org/cover/57623/
This is from FD.io VPP's bug, and finally, we come out this API for application accessing the burst mode information. It can be used as a simple trace or something like performance analysis like why slow ? Not in vector, anyway, application can get this burst mode information now, not just open PMD debug log level.

From an architecture perspective, diagnostics are good but VPP is probably taking that too far. It is possible to expose local symbols if they want to keep using dlsym() by adjusting linker flags. It is more that VPP is stripping everything. Since VPP has chosen to go their own way is fixable inside VPP without changing DPDK. Also, long term VPP is going away from using DPDK drivers. Probably soon they will have their own drivers for i40e and ice anyway.

Quoted 3 lines

The basis of my concern is that this is one of those kind of API's that creates long term technical debt around supporting it as other things change.

At first, we use 'string format' to make VPP happy, now, we use bit-fields for general use.

People come, people go, even VPP left DPDK, now, testpmd is the first user, and I think it is good for 'test' the PMD with friendly information:

testpmd> show rxq info 0 0

********************* Infos for port 0 , RX queue 0 *********************
Mempool: mbuf_pool_socket_0
RX prefetch threshold: 0
RX host threshold: 0
RX writeback threshold: 0
RX free threshold: 32
RX drop packets: off
RX deferred start: off
RX scattered packets: off
Number of RXDs: 1024
Burst mode: Vector AVX2 =============> direct information, not have to check the
code and open debug to make sure every setting
is right.

testpmd> show txq info 0 0

********************* Infos for port 0 , TX queue 0 ********************* TX prefetch threshold: 32
TX host threshold: 0
TX writeback threshold: 0
TX RS threshold: 32
TX free threshold: 32
TX deferred start: off
Number of TXDs: 1024
Burst mode: Vector AVX2 =============>