DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
@ 2019-09-26 11:48 Haiyue Wang
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 1/4] ethdev: add the API for getting " Haiyue Wang
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Haiyue Wang @ 2019-09-26 11:48 UTC (permalink / raw)
  To: dev, ferruh.yigit, xiaolong.ye
  Cc: ray.kinsella, bernard.iremonger, chenmin.sun, Haiyue Wang

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(+)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v1 1/4] ethdev: add the API for getting burst mode information
  2019-09-26 11:48 [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information Haiyue Wang
@ 2019-09-26 11:48 ` Haiyue Wang
  2019-09-26 13:41   ` Ye Xiaolong
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 2/4] net/i40e: support to get the Rx/Tx burst mode Haiyue Wang
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Haiyue Wang @ 2019-09-26 11:48 UTC (permalink / raw)
  To: dev, ferruh.yigit, xiaolong.ye
  Cc: ray.kinsella, bernard.iremonger, chenmin.sun, 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.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 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(+)

diff --git a/doc/guides/rel_notes/release_19_11.rst b/doc/guides/rel_notes/release_19_11.rst
index 1b8bd6f35..e77ace531 100644
--- a/doc/guides/rel_notes/release_19_11.rst
+++ b/doc/guides/rel_notes/release_19_11.rst
@@ -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:
diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index d0da3322e..f9ea241d0 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4208,6 +4208,81 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 	return 0;
 }
 
+int
+rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
+			  struct rte_eth_burst_mode *mode)
+{
+	struct rte_eth_dev *dev;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+	if (mode == NULL)
+		return -EINVAL;
+
+	dev = &rte_eth_devices[port_id];
+
+	if (queue_id >= dev->data->nb_rx_queues) {
+		RTE_ETHDEV_LOG(ERR, "Invalid RX queue_id=%u\n", queue_id);
+		return -EINVAL;
+	}
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->rx_burst_mode_get, -ENOTSUP);
+
+	memset(mode, 0, sizeof(*mode));
+	dev->dev_ops->rx_burst_mode_get(dev, queue_id, mode);
+
+	return 0;
+}
+
+int
+rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
+			  struct rte_eth_burst_mode *mode)
+{
+	struct rte_eth_dev *dev;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+	if (mode == NULL)
+		return -EINVAL;
+
+	dev = &rte_eth_devices[port_id];
+
+	if (queue_id >= dev->data->nb_tx_queues) {
+		RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
+		return -EINVAL;
+	}
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->tx_burst_mode_get, -ENOTSUP);
+
+	memset(mode, 0, sizeof(*mode));
+	dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode);
+
+	return 0;
+}
+
+const char *
+rte_eth_burst_mode_option_name(uint64_t option)
+{
+	switch (option) {
+	case RTE_ETH_BURST_SCALAR: return "Scalar";
+	case RTE_ETH_BURST_VECTOR: return "Vector";
+
+	case RTE_ETH_BURST_ALTIVEC: return "AltiVec";
+	case RTE_ETH_BURST_NEON: return "Neon";
+	case RTE_ETH_BURST_SSE: return "SSE";
+	case RTE_ETH_BURST_AVX2: return "AVX2";
+	case RTE_ETH_BURST_AVX512: return "AVX512";
+
+	case RTE_ETH_BURST_SCATTERED: return "Scattered";
+	case RTE_ETH_BURST_BULK_ALLOC: return "Bulk Alloc";
+	case RTE_ETH_BURST_SIMPLE: return "Simple";
+
+	case RTE_ETH_BURST_PER_QUEUE: return "Per Queue";
+	}
+
+	return "";
+}
+
 int
 rte_eth_dev_set_mc_addr_list(uint16_t port_id,
 			     struct rte_ether_addr *mc_addr_set,
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index d937fb429..64bb84627 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1212,6 +1212,32 @@ struct rte_eth_txq_info {
 	uint16_t nb_desc;           /**< configured number of TXDs. */
 } __rte_cache_min_aligned;
 
+enum rte_eth_burst_mode_option {
+	RTE_ETH_BURST_SCALAR = (1 << 0),
+	RTE_ETH_BURST_VECTOR = (1 << 1),
+
+	/**< bits[15:2] are reserved for each vector type */
+	RTE_ETH_BURST_ALTIVEC = (1 << 2),
+	RTE_ETH_BURST_NEON = (1 << 3),
+	RTE_ETH_BURST_SSE = (1 << 4),
+	RTE_ETH_BURST_AVX2 = (1 << 5),
+	RTE_ETH_BURST_AVX512 = (1 << 6),
+
+	RTE_ETH_BURST_SCATTERED = (1 << 16), /**< Support scattered packets */
+	RTE_ETH_BURST_BULK_ALLOC = (1 << 17), /**< Support mbuf bulk alloc */
+	RTE_ETH_BURST_SIMPLE = (1 << 18),
+
+	RTE_ETH_BURST_PER_QUEUE = (1 << 19), /**< Support per queue burst */
+};
+
+/**
+ * Ethernet device RX/TX queue packet burst mode information structure.
+ * Used to retrieve information about packet burst mode setting.
+ */
+struct rte_eth_burst_mode {
+	uint64_t options;
+};
+
 /** Maximum name length for extended statistics counters */
 #define RTE_ETH_XSTATS_NAME_SIZE 64
 
@@ -3600,6 +3626,62 @@ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_txq_info *qinfo);
 
+/**
+ * Retrieve information about the Rx packet burst mode.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param queue_id
+ *   The Rx queue on the Ethernet device for which information
+ *   will be retrieved.
+ * @param mode
+ *   A pointer to a structure of type *rte_eth_burst_mode* to be filled
+ *   with the information of the packet burst mode.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The port_id or the queue_id is out of range.
+ */
+__rte_experimental
+int rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
+	struct rte_eth_burst_mode *mode);
+
+/**
+ * Retrieve information about the Tx packet burst mode.
+ *
+ * @param port_id
+ *   The port identifier of the Ethernet device.
+ * @param queue_id
+ *   The Tx queue on the Ethernet device for which information
+ *   will be retrieved.
+ * @param mode
+ *   A pointer to a structure of type *rte_eth_burst_mode* to be filled
+ *   with the information of the packet burst mode.
+ *
+ * @return
+ *   - 0: Success
+ *   - -ENOTSUP: routine is not supported by the device PMD.
+ *   - -EINVAL:  The port_id or the queue_id is out of range.
+ */
+__rte_experimental
+int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
+	struct rte_eth_burst_mode *mode);
+
+/**
+ * Retrieve name about burst mode option.
+ *
+ * @param mode
+ *   The burst mode option of type *rte_eth_burst_mode_option*.
+ *
+ * @return
+ *   - "": Not found
+ *   - "xxx": name of the mode option.
+ */
+__rte_experimental
+const char *
+rte_eth_burst_mode_option_name(uint64_t option);
+
 /**
  * Retrieve device registers and register attributes (number of registers and
  * register size)
diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h
index dcb5ae651..b24b68363 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -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. */
diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
index 6df42a47b..e59d51648 100644
--- a/lib/librte_ethdev/rte_ethdev_version.map
+++ b/lib/librte_ethdev/rte_ethdev_version.map
@@ -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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v1 2/4] net/i40e: support to get the Rx/Tx burst mode
  2019-09-26 11:48 [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information Haiyue Wang
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 1/4] ethdev: add the API for getting " Haiyue Wang
@ 2019-09-26 11:48 ` Haiyue Wang
  2019-09-26 13:49   ` Ye Xiaolong
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 3/4] net/ice: " Haiyue Wang
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Haiyue Wang @ 2019-09-26 11:48 UTC (permalink / raw)
  To: dev, ferruh.yigit, xiaolong.ye
  Cc: ray.kinsella, bernard.iremonger, chenmin.sun, Haiyue Wang

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

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 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(+)

diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c
index 76cd9f510..e212a7adb 100644
--- a/drivers/net/i40e/i40e_ethdev.c
+++ b/drivers/net/i40e/i40e_ethdev.c
@@ -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,
diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h
index 261954b9a..abbda1ae4 100644
--- a/drivers/net/i40e/i40e_ethdev.h
+++ b/drivers/net/i40e/i40e_ethdev.h
@@ -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);
diff --git a/drivers/net/i40e/i40e_rxtx.c b/drivers/net/i40e/i40e_rxtx.c
index 692c3bab4..d27a0bc87 100644
--- a/drivers/net/i40e/i40e_rxtx.c
+++ b/drivers/net/i40e/i40e_rxtx.c
@@ -3028,6 +3028,49 @@ i40e_set_rx_function(struct rte_eth_dev *dev)
 	}
 }
 
+void
+i40e_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+		       struct rte_eth_burst_mode *mode)
+{
+	eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
+	uint64_t options;
+
+	if (pkt_burst == i40e_recv_scattered_pkts)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == i40e_recv_pkts_bulk_alloc)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_BULK_ALLOC;
+	else if (pkt_burst == i40e_recv_pkts)
+		options = RTE_ETH_BURST_SCALAR;
+#ifdef RTE_ARCH_X86
+	else if (pkt_burst == i40e_recv_scattered_pkts_vec_avx2)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2 |
+			  RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == i40e_recv_pkts_vec_avx2)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2;
+	else if (pkt_burst == i40e_recv_scattered_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE |
+			  RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == i40e_recv_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE;
+#elif defined(RTE_ARCH_ARM64)
+	else if (pkt_burst == i40e_recv_scattered_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_NEON |
+			  RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == i40e_recv_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_NEON;
+#elif defined(RTE_ARCH_PPC_64)
+	else if (pkt_burst == i40e_recv_scattered_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_ALTIVEC |
+			  RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == i40e_recv_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_ALTIVEC;
+#endif
+	else
+		options = 0;
+
+	mode->options = options;
+}
+
 void __attribute__((cold))
 i40e_set_tx_function_flag(struct rte_eth_dev *dev, struct i40e_tx_queue *txq)
 {
@@ -3121,6 +3164,35 @@ i40e_set_tx_function(struct rte_eth_dev *dev)
 	}
 }
 
+void
+i40e_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+		       struct rte_eth_burst_mode *mode)
+{
+	eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
+	uint64_t options;
+
+	if (pkt_burst == i40e_xmit_pkts_simple)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SIMPLE;
+	else if (pkt_burst == i40e_xmit_pkts)
+		options = RTE_ETH_BURST_SCALAR;
+#ifdef RTE_ARCH_X86
+	else if (pkt_burst == i40e_xmit_pkts_vec_avx2)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2;
+	else if (pkt_burst == i40e_xmit_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE;
+#elif defined(RTE_ARCH_ARM64)
+	else if (pkt_burst == i40e_xmit_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_NEON;
+#elif defined(RTE_ARCH_PPC_64)
+	else if (pkt_burst == i40e_xmit_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_ALTIVEC;
+#endif
+	else
+		options = 0;
+
+	mode->options = options;
+}
+
 void __attribute__((cold))
 i40e_set_default_ptype_table(struct rte_eth_dev *dev)
 {
-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v1 3/4] net/ice: support to get the Rx/Tx burst mode
  2019-09-26 11:48 [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information Haiyue Wang
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 1/4] ethdev: add the API for getting " Haiyue Wang
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 2/4] net/i40e: support to get the Rx/Tx burst mode Haiyue Wang
@ 2019-09-26 11:48 ` Haiyue Wang
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 4/4] app/testpmd: show the Rx/Tx burst mode description Haiyue Wang
  2019-09-26 15:57 ` [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information Stephen Hemminger
  4 siblings, 0 replies; 15+ messages in thread
From: Haiyue Wang @ 2019-09-26 11:48 UTC (permalink / raw)
  To: dev, ferruh.yigit, xiaolong.ye
  Cc: ray.kinsella, bernard.iremonger, chenmin.sun, Haiyue Wang

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

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 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(+)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index c126d962c..38b141eea 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -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,
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index af96c0f41..2ad683ea9 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2441,6 +2441,37 @@ ice_set_rx_function(struct rte_eth_dev *dev)
 	}
 }
 
+void
+ice_rx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+		      struct rte_eth_burst_mode *mode)
+{
+	eth_rx_burst_t pkt_burst = dev->rx_pkt_burst;
+	uint64_t options;
+
+	if (pkt_burst == ice_recv_scattered_pkts)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == ice_recv_pkts_bulk_alloc)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_BULK_ALLOC;
+	else if (pkt_burst == ice_recv_pkts)
+		options = RTE_ETH_BURST_SCALAR;
+#ifdef RTE_ARCH_X86
+	else if (pkt_burst == ice_recv_scattered_pkts_vec_avx2)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2 |
+			  RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == ice_recv_pkts_vec_avx2)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2;
+	else if (pkt_burst == ice_recv_scattered_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE |
+			  RTE_ETH_BURST_SCATTERED;
+	else if (pkt_burst == ice_recv_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE;
+#endif
+	else
+		options = 0;
+
+	mode->options = options;
+}
+
 void __attribute__((cold))
 ice_set_tx_function_flag(struct rte_eth_dev *dev, struct ice_tx_queue *txq)
 {
@@ -2564,6 +2595,29 @@ ice_set_tx_function(struct rte_eth_dev *dev)
 	}
 }
 
+void
+ice_tx_burst_mode_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+		      struct rte_eth_burst_mode *mode)
+{
+	eth_tx_burst_t pkt_burst = dev->tx_pkt_burst;
+	uint64_t options;
+
+	if (pkt_burst == ice_xmit_pkts_simple)
+		options = RTE_ETH_BURST_SCALAR | RTE_ETH_BURST_SIMPLE;
+	else if (pkt_burst == ice_xmit_pkts)
+		options = RTE_ETH_BURST_SCALAR;
+#ifdef RTE_ARCH_X86
+	else if (pkt_burst == ice_xmit_pkts_vec_avx2)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_AVX2;
+	else if (pkt_burst == ice_xmit_pkts_vec)
+		options = RTE_ETH_BURST_VECTOR | RTE_ETH_BURST_SSE;
+#endif
+	else
+		options = 0;
+
+	mode->options = options;
+}
+
 /* For each value it means, datasheet of hardware can tell more details
  *
  * @note: fix ice_dev_supported_ptypes_get() if any change here.
diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h
index 25b3822df..eccfbe93f 100644
--- a/drivers/net/ice/ice_rxtx.h
+++ b/drivers/net/ice/ice_rxtx.h
@@ -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);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* [dpdk-dev] [PATCH v1 4/4] app/testpmd: show the Rx/Tx burst mode description
  2019-09-26 11:48 [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information Haiyue Wang
                   ` (2 preceding siblings ...)
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 3/4] net/ice: " Haiyue Wang
@ 2019-09-26 11:48 ` Haiyue Wang
  2019-09-26 13:57   ` Ye Xiaolong
  2019-09-26 15:57 ` [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information Stephen Hemminger
  4 siblings, 1 reply; 15+ messages in thread
From: Haiyue Wang @ 2019-09-26 11:48 UTC (permalink / raw)
  To: dev, ferruh.yigit, xiaolong.ye
  Cc: ray.kinsella, bernard.iremonger, chenmin.sun, 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"

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
---
 app/test-pmd/config.c | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 957c61fbe..ada89a19d 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -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");
 }
 
-- 
2.17.1


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/4] ethdev: add the API for getting burst mode information
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 1/4] ethdev: add the API for getting " Haiyue Wang
@ 2019-09-26 13:41   ` Ye Xiaolong
  2019-09-26 13:48     ` Wang, Haiyue
  0 siblings, 1 reply; 15+ messages in thread
From: Ye Xiaolong @ 2019-09-26 13:41 UTC (permalink / raw)
  To: Haiyue Wang
  Cc: dev, ferruh.yigit, ray.kinsella, bernard.iremonger, chenmin.sun

On 09/26, Haiyue Wang wrote:
>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.
>
>Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
>Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
>---
> 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]

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

> 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. */
>diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
>index 6df42a47b..e59d51648 100644
>--- a/lib/librte_ethdev/rte_ethdev_version.map
>+++ b/lib/librte_ethdev/rte_ethdev_version.map
>@@ -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
>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v1 1/4] ethdev: add the API for getting burst mode information
  2019-09-26 13:41   ` Ye Xiaolong
@ 2019-09-26 13:48     ` Wang, Haiyue
  0 siblings, 0 replies; 15+ messages in thread
From: Wang, Haiyue @ 2019-09-26 13:48 UTC (permalink / raw)
  To: Ye, Xiaolong
  Cc: dev, Yigit, Ferruh, Kinsella, Ray, Iremonger, Bernard, Sun, Chenmin

> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Thursday, September 26, 2019 21:41
> To: Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Kinsella, Ray <ray.kinsella@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>; Sun, Chenmin <chenmin.sun@intel.com>
> Subject: Re: [PATCH v1 1/4] ethdev: add the API for getting burst mode information
> 
> On 09/26, Haiyue Wang wrote:
> >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.
> >
> >Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> >Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
> >---
> > 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]
> 
> >+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
> 

OK, will update on v2.

> Thanks,
> Xiaolong
> 
> > 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. */
> >diff --git a/lib/librte_ethdev/rte_ethdev_version.map b/lib/librte_ethdev/rte_ethdev_version.map
> >index 6df42a47b..e59d51648 100644
> >--- a/lib/librte_ethdev/rte_ethdev_version.map
> >+++ b/lib/librte_ethdev/rte_ethdev_version.map
> >@@ -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
> >

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v1 2/4] net/i40e: support to get the Rx/Tx burst mode
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 2/4] net/i40e: support to get the Rx/Tx burst mode Haiyue Wang
@ 2019-09-26 13:49   ` Ye Xiaolong
  2019-09-26 14:18     ` Wang, Haiyue
  0 siblings, 1 reply; 15+ messages in thread
From: Ye Xiaolong @ 2019-09-26 13:49 UTC (permalink / raw)
  To: Haiyue Wang
  Cc: dev, ferruh.yigit, ray.kinsella, bernard.iremonger, chenmin.sun

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

On 09/26, Haiyue Wang wrote:
>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

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v1 4/4] app/testpmd: show the Rx/Tx burst mode description
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 4/4] app/testpmd: show the Rx/Tx burst mode description Haiyue Wang
@ 2019-09-26 13:57   ` Ye Xiaolong
  0 siblings, 0 replies; 15+ messages in thread
From: Ye Xiaolong @ 2019-09-26 13:57 UTC (permalink / raw)
  To: Haiyue Wang
  Cc: dev, ferruh.yigit, ray.kinsella, bernard.iremonger, chenmin.sun

On 09/26, Haiyue Wang wrote:
>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"
>
>Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
>Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
>---
> app/test-pmd/config.c | 29 +++++++++++++++++++++++++++++
> 1 file changed, 29 insertions(+)
>
>diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
>index 957c61fbe..ada89a19d 100644
>--- a/app/test-pmd/config.c
>+++ b/app/test-pmd/config.c
>@@ -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");
> }
> 
>-- 
>2.17.1
>

Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v1 2/4] net/i40e: support to get the Rx/Tx burst mode
  2019-09-26 13:49   ` Ye Xiaolong
@ 2019-09-26 14:18     ` Wang, Haiyue
  0 siblings, 0 replies; 15+ messages in thread
From: Wang, Haiyue @ 2019-09-26 14:18 UTC (permalink / raw)
  To: Ye, Xiaolong
  Cc: dev, Yigit, Ferruh, Kinsella, Ray, Iremonger, Bernard, Sun, Chenmin

> -----Original Message-----
> From: Ye, Xiaolong
> Sent: Thursday, September 26, 2019 21:50
> To: Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Kinsella, Ray <ray.kinsella@intel.com>;
> Iremonger, Bernard <bernard.iremonger@intel.com>; Sun, Chenmin <chenmin.sun@intel.com>
> 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.

> On 09/26, Haiyue Wang wrote:
> >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. ;-)

> Thanks,
> Xiaolong

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
  2019-09-26 11:48 [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information Haiyue Wang
                   ` (3 preceding siblings ...)
  2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 4/4] app/testpmd: show the Rx/Tx burst mode description Haiyue Wang
@ 2019-09-26 15:57 ` Stephen Hemminger
  2019-09-26 16:36   ` Wang, Haiyue
  4 siblings, 1 reply; 15+ messages in thread
From: Stephen Hemminger @ 2019-09-26 15:57 UTC (permalink / raw)
  To: Haiyue Wang
  Cc: dev, ferruh.yigit, xiaolong.ye, ray.kinsella, bernard.iremonger,
	chenmin.sun

On Thu, 26 Sep 2019 19:48:14 +0800
Haiyue Wang <haiyue.wang@intel.com> 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(+)
> 

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?

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
  2019-09-26 15:57 ` [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information Stephen Hemminger
@ 2019-09-26 16:36   ` Wang, Haiyue
  2019-09-26 17:15     ` Stephen Hemminger
  0 siblings, 1 reply; 15+ messages in thread
From: Wang, Haiyue @ 2019-09-26 16:36 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, Yigit, Ferruh, Ye, Xiaolong, Kinsella, Ray, Iremonger,
	Bernard, Sun, Chenmin

Hi Stephen,

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Thursday, September 26, 2019 23:57
> To: Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>;
> Kinsella, Ray <ray.kinsella@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>; Sun, Chenmin
> <chenmin.sun@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
> 
> On Thu, 26 Sep 2019 19:48:14 +0800
> Haiyue Wang <haiyue.wang@intel.com> 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(+)
> >
> 
> 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.'  ;-)

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



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
  2019-09-26 16:36   ` Wang, Haiyue
@ 2019-09-26 17:15     ` Stephen Hemminger
  2019-09-26 17:36       ` Ferruh Yigit
  2019-09-27  1:17       ` Wang, Haiyue
  0 siblings, 2 replies; 15+ messages in thread
From: Stephen Hemminger @ 2019-09-26 17:15 UTC (permalink / raw)
  To: Wang, Haiyue
  Cc: dev, Yigit, Ferruh, Ye, Xiaolong, Kinsella, Ray, Iremonger,
	Bernard, Sun, Chenmin

On Thu, 26 Sep 2019 16:36:09 +0000
"Wang, Haiyue" <haiyue.wang@intel.com> wrote:

> Hi Stephen,
> 
> > -----Original Message-----
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Thursday, September 26, 2019 23:57
> > To: Wang, Haiyue <haiyue.wang@intel.com>
> > Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>;
> > Kinsella, Ray <ray.kinsella@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>; Sun, Chenmin
> > <chenmin.sun@intel.com>
> > Subject: Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
> > 
> > On Thu, 26 Sep 2019 19:48:14 +0800
> > Haiyue Wang <haiyue.wang@intel.com> 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(+)
> > >  
> > 
> > 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.
 
> > 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.

^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
  2019-09-26 17:15     ` Stephen Hemminger
@ 2019-09-26 17:36       ` Ferruh Yigit
  2019-09-27  1:17       ` Wang, Haiyue
  1 sibling, 0 replies; 15+ messages in thread
From: Ferruh Yigit @ 2019-09-26 17:36 UTC (permalink / raw)
  To: Stephen Hemminger, Wang, Haiyue
  Cc: dev, Ye, Xiaolong, Kinsella, Ray, Iremonger, Bernard, Sun, Chenmin

On 9/26/2019 6:15 PM, Stephen Hemminger wrote:
> On Thu, 26 Sep 2019 16:36:09 +0000
> "Wang, Haiyue" <haiyue.wang@intel.com> wrote:
> 
>> Hi Stephen,
>>
>>> -----Original Message-----
>>> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
>>> Sent: Thursday, September 26, 2019 23:57
>>> To: Wang, Haiyue <haiyue.wang@intel.com>
>>> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>;
>>> Kinsella, Ray <ray.kinsella@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>; Sun, Chenmin
>>> <chenmin.sun@intel.com>
>>> Subject: Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
>>>
>>> On Thu, 26 Sep 2019 19:48:14 +0800
>>> Haiyue Wang <haiyue.wang@intel.com> 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(+)
>>>>  
>>>
>>> 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.

'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.

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


^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
  2019-09-26 17:15     ` Stephen Hemminger
  2019-09-26 17:36       ` Ferruh Yigit
@ 2019-09-27  1:17       ` Wang, Haiyue
  1 sibling, 0 replies; 15+ messages in thread
From: Wang, Haiyue @ 2019-09-27  1:17 UTC (permalink / raw)
  To: Stephen Hemminger
  Cc: dev, Yigit, Ferruh, Ye, Xiaolong, Kinsella, Ray, Iremonger,
	Bernard, Sun, Chenmin

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Friday, September 27, 2019 01:15
> To: Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>;
> Kinsella, Ray <ray.kinsella@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>; Sun, Chenmin
> <chenmin.sun@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
> 
> On Thu, 26 Sep 2019 16:36:09 +0000
> "Wang, Haiyue" <haiyue.wang@intel.com> wrote:
> 
> > Hi Stephen,
> >
> > > -----Original Message-----
> > > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > > Sent: Thursday, September 26, 2019 23:57
> > > To: Wang, Haiyue <haiyue.wang@intel.com>
> > > Cc: dev@dpdk.org; Yigit, Ferruh <ferruh.yigit@intel.com>; Ye, Xiaolong <xiaolong.ye@intel.com>;
> > > Kinsella, Ray <ray.kinsella@intel.com>; Iremonger, Bernard <bernard.iremonger@intel.com>; Sun,
> Chenmin
> > > <chenmin.sun@intel.com>
> > > Subject: Re: [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information
> > >
> > > On Thu, 26 Sep 2019 19:48:14 +0800
> > > Haiyue Wang <haiyue.wang@intel.com> 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(+)
> > > >
> > >
> > > 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.
> 

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.

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

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2019-09-27  1:17 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-26 11:48 [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information Haiyue Wang
2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 1/4] ethdev: add the API for getting " Haiyue Wang
2019-09-26 13:41   ` Ye Xiaolong
2019-09-26 13:48     ` Wang, Haiyue
2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 2/4] net/i40e: support to get the Rx/Tx burst mode Haiyue Wang
2019-09-26 13:49   ` Ye Xiaolong
2019-09-26 14:18     ` Wang, Haiyue
2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 3/4] net/ice: " Haiyue Wang
2019-09-26 11:48 ` [dpdk-dev] [PATCH v1 4/4] app/testpmd: show the Rx/Tx burst mode description Haiyue Wang
2019-09-26 13:57   ` Ye Xiaolong
2019-09-26 15:57 ` [dpdk-dev] [PATCH v1 0/4] get Rx/Tx packet burst mode information Stephen Hemminger
2019-09-26 16:36   ` Wang, Haiyue
2019-09-26 17:15     ` Stephen Hemminger
2019-09-26 17:36       ` Ferruh Yigit
2019-09-27  1:17       ` Wang, Haiyue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).