DPDK patches and discussions
 help / color / Atom feed
* [dpdk-dev] [RFC v2 0/3] show the Rx/Tx burst description field
@ 2019-08-13  3:06 Haiyue Wang
  2019-08-13  3:06 ` [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information Haiyue Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Haiyue Wang @ 2019-08-13  3:06 UTC (permalink / raw)
  To: dev; +Cc: Haiyue Wang

v1: ABI breaking
http://mails.dpdk.org/archives/dev/2019-August/140916.html
      https://patchwork.dpdk.org/patch/57624/
      https://patchwork.dpdk.org/patch/57625/
      https://patchwork.dpdk.org/patch/57626/

v2: add a simple trace API to export string type information, if the
return value > 0, then valid information is generated.

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: on
Number of RXDs: 1024
Burst description: AVX2 Vector Scattered Rx

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 description: AVX2 Vector Tx

Haiyue Wang (3):
  ethdev: add the API for getting trace information
  testpmd: show the Rx/Tx burst description
  net/ice: support the Rx/Tx burst description trace

 app/test-pmd/config.c               | 12 +++++++++
 drivers/net/ice/ice_ethdev.c        | 26 +++++++++++++++++++
 drivers/net/ice/ice_rxtx.c          | 52 +++++++++++++++++++++++++++++++++++++
 drivers/net/ice/ice_rxtx.h          |  4 +++
 lib/librte_ethdev/rte_ethdev.c      | 18 +++++++++++++
 lib/librte_ethdev/rte_ethdev.h      |  9 +++++++
 lib/librte_ethdev/rte_ethdev_core.h |  4 +++
 7 files changed, 125 insertions(+)

-- 
2.7.4


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

* [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
  2019-08-13  3:06 [dpdk-dev] [RFC v2 0/3] show the Rx/Tx burst description field Haiyue Wang
@ 2019-08-13  3:06 ` Haiyue Wang
  2019-08-13  3:24   ` Stephen Hemminger
  2019-08-13  3:06 ` [dpdk-dev] [RFC v2 2/3] testpmd: show the Rx/Tx burst description Haiyue Wang
  2019-08-13  3:06 ` [dpdk-dev] [RFC v2 3/3] net/ice: support the Rx/Tx burst description trace Haiyue Wang
  2 siblings, 1 reply; 10+ messages in thread
From: Haiyue Wang @ 2019-08-13  3:06 UTC (permalink / raw)
  To: dev; +Cc: Haiyue Wang

Enhance the PMD to support retrieving trace information like
Rx/Tx burst selection etc.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 lib/librte_ethdev/rte_ethdev.c      | 18 ++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h      |  9 +++++++++
 lib/librte_ethdev/rte_ethdev_core.h |  4 ++++
 3 files changed, 31 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 17d183e..6098fad 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
 }
 
 int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+		       enum rte_eth_trace type, char *buf, int sz)
+{
+	struct rte_eth_dev *dev;
+
+	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+	if (buf == NULL)
+		return -EINVAL;
+
+	dev = &rte_eth_devices[port_id];
+
+	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
+
+	return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);
+}
+
+int
 rte_eth_dev_set_mc_addr_list(uint16_t port_id,
 			     struct rte_ether_addr *mc_addr_set,
 			     uint32_t nb_mc_addr)
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index dc6596b..9405157 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -404,6 +404,11 @@ struct rte_eth_rxmode {
 	uint64_t offloads;
 };
 
+enum rte_eth_trace {
+	ETH_TRACE_RX_BURST,
+	ETH_TRACE_TX_BURST,
+};
+
 /**
  * VLAN types to indicate if it is for single VLAN, inner VLAN or outer VLAN.
  * Note that single VLAN is treated the same as inner VLAN.
@@ -3556,6 +3561,10 @@ 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);
 
+int
+rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
+	enum rte_eth_trace type, char *buf, int sz);
+
 /**
  * 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 2922d5b..366bf5b 100644
--- a/lib/librte_ethdev/rte_ethdev_core.h
+++ b/lib/librte_ethdev/rte_ethdev_core.h
@@ -170,6 +170,9 @@ typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,
 typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,
 	uint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);
 
+typedef int (*eth_trace_info_get_t)(struct rte_eth_dev *dev,
+	uint16_t queue_id, enum rte_eth_trace type, char *buf, int sz);
+
 typedef int (*mtu_set_t)(struct rte_eth_dev *dev, uint16_t mtu);
 /**< @internal Set MTU. */
 
@@ -418,6 +421,7 @@ 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_trace_info_get_t       trace_info_get; /**< Get trace. */
 	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. */
-- 
2.7.4


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

* [dpdk-dev] [RFC v2 2/3] testpmd: show the Rx/Tx burst description
  2019-08-13  3:06 [dpdk-dev] [RFC v2 0/3] show the Rx/Tx burst description field Haiyue Wang
  2019-08-13  3:06 ` [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information Haiyue Wang
@ 2019-08-13  3:06 ` Haiyue Wang
  2019-08-13  3:06 ` [dpdk-dev] [RFC v2 3/3] net/ice: support the Rx/Tx burst description trace Haiyue Wang
  2 siblings, 0 replies; 10+ messages in thread
From: Haiyue Wang @ 2019-08-13  3:06 UTC (permalink / raw)
  To: dev; +Cc: Haiyue Wang

Add the 'Burst description' section into command 'show rxq|txq info
<port_id> <queue_id>' to show the Rx/Tx burst description by new trace
API.

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

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..52814ba 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -330,6 +330,7 @@ rx_queue_infos_display(portid_t port_id, uint16_t queue_id)
 	struct rte_eth_rxq_info qinfo;
 	int32_t rc;
 	static const char *info_border = "*********************";
+	char burst_info[128];
 
 	rc = rte_eth_rx_queue_info_get(port_id, queue_id, &qinfo);
 	if (rc != 0) {
@@ -354,6 +355,11 @@ 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_trace_info_get(port_id, queue_id, ETH_TRACE_RX_BURST,
+				   burst_info, sizeof(burst_info)) > 0)
+		printf("\nBurst description: %s\n", burst_info);
+
 	printf("\n");
 }
 
@@ -363,6 +369,7 @@ tx_queue_infos_display(portid_t port_id, uint16_t queue_id)
 	struct rte_eth_txq_info qinfo;
 	int32_t rc;
 	static const char *info_border = "*********************";
+	char burst_info[128];
 
 	rc = rte_eth_tx_queue_info_get(port_id, queue_id, &qinfo);
 	if (rc != 0) {
@@ -383,6 +390,11 @@ 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_trace_info_get(port_id, queue_id, ETH_TRACE_TX_BURST,
+				   burst_info, sizeof(burst_info)) > 0)
+		printf("\nBurst description: %s\n", burst_info);
+
 	printf("\n");
 }
 
-- 
2.7.4


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

* [dpdk-dev] [RFC v2 3/3] net/ice: support the Rx/Tx burst description trace
  2019-08-13  3:06 [dpdk-dev] [RFC v2 0/3] show the Rx/Tx burst description field Haiyue Wang
  2019-08-13  3:06 ` [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information Haiyue Wang
  2019-08-13  3:06 ` [dpdk-dev] [RFC v2 2/3] testpmd: show the Rx/Tx burst description Haiyue Wang
@ 2019-08-13  3:06 ` Haiyue Wang
  2 siblings, 0 replies; 10+ messages in thread
From: Haiyue Wang @ 2019-08-13  3:06 UTC (permalink / raw)
  To: dev; +Cc: Haiyue Wang

According to the Rx/Tx burst function that's selected currently, format
the distinct burst description information for apps to query.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 drivers/net/ice/ice_ethdev.c | 26 ++++++++++++++++++++++
 drivers/net/ice/ice_rxtx.c   | 52 ++++++++++++++++++++++++++++++++++++++++++++
 drivers/net/ice/ice_rxtx.h   |  4 ++++
 3 files changed, 82 insertions(+)

diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 44a14cb..bad5c23 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -99,6 +99,8 @@ static int ice_dev_udp_tunnel_port_add(struct rte_eth_dev *dev,
 			struct rte_eth_udp_tunnel *udp_tunnel);
 static int ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
 			struct rte_eth_udp_tunnel *udp_tunnel);
+static int ice_trace_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			      enum rte_eth_trace type, char *buf, int sz);
 
 static const struct rte_pci_id pci_id_ice_map[] = {
 	{ RTE_PCI_DEVICE(ICE_INTEL_VENDOR_ID, ICE_DEV_ID_E810C_BACKPLANE) },
@@ -147,6 +149,7 @@ 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,
+	.trace_info_get               = ice_trace_info_get,
 	.get_eeprom_length            = ice_get_eeprom_length,
 	.get_eeprom                   = ice_get_eeprom,
 	.rx_queue_count               = ice_rx_queue_count,
@@ -3765,6 +3768,29 @@ ice_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,
 }
 
 static int
+ice_trace_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+		   enum rte_eth_trace type, char *buf, int sz)
+{
+	int ret;
+
+	switch (type) {
+	case ETH_TRACE_RX_BURST:
+		ret = ice_rx_burst_info_get(dev, queue_id, buf, sz);
+		break;
+
+	case ETH_TRACE_TX_BURST:
+		ret = ice_tx_burst_info_get(dev, queue_id, buf, sz);
+		break;
+
+	default:
+		ret = -ENOTSUP;
+		break;
+	}
+
+	return ret;
+}
+
+static int
 ice_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 	      struct rte_pci_device *pci_dev)
 {
diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 0282b53..43d52c2 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -2385,6 +2385,35 @@ ice_set_rx_function(struct rte_eth_dev *dev)
 	}
 }
 
+int
+ice_rx_burst_info_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+		      char *buf, int sz)
+{
+	int len = 0;
+
+	if (dev->rx_pkt_burst == ice_recv_scattered_pkts)
+		len = snprintf(buf, sz, "Scattered Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts_bulk_alloc)
+		len = snprintf(buf, sz, "Bulk Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts)
+		len = snprintf(buf, sz, "Normal Rx");
+#ifdef RTE_ARCH_X86
+	else if (dev->rx_pkt_burst == ice_recv_scattered_pkts_vec_avx2)
+		len = snprintf(buf, sz, "AVX2 Vector Scattered Rx");
+	else if (dev->rx_pkt_burst == ice_recv_scattered_pkts_vec)
+		len = snprintf(buf, sz, "Vector Scattered Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts_vec_avx2)
+		len = snprintf(buf, sz, "AVX2 Vector Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts_vec)
+		len = snprintf(buf, sz, "Vector Rx");
+#endif
+
+	if (len >= sz)
+		len = -ENOSPC; /* The output was truncated */
+
+	return len;
+}
+
 void __attribute__((cold))
 ice_set_tx_function_flag(struct rte_eth_dev *dev, struct ice_tx_queue *txq)
 {
@@ -2454,6 +2483,29 @@ ice_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 	return i;
 }
 
+int
+ice_tx_burst_info_get(struct rte_eth_dev *dev, __rte_unused uint16_t queue_id,
+		      char *buf, int sz)
+{
+	int len = 0;
+
+	if (dev->tx_pkt_burst == ice_xmit_pkts_simple)
+		len = snprintf(buf, sz, "Simple Tx");
+	else if (dev->tx_pkt_burst == ice_xmit_pkts)
+		len = snprintf(buf, sz, "Normal Tx");
+#ifdef RTE_ARCH_X86
+	else if (dev->tx_pkt_burst == ice_xmit_pkts_vec_avx2)
+		len = snprintf(buf, sz, "AVX2 Vector Tx");
+	else if (dev->tx_pkt_burst == ice_xmit_pkts_vec)
+		len = snprintf(buf, sz, "Vector Tx");
+#endif
+
+	if (len >= sz)
+		len = -ENOSPC; /* The output was truncated */
+
+	return len;
+}
+
 void __attribute__((cold))
 ice_set_tx_function(struct rte_eth_dev *dev)
 {
diff --git a/drivers/net/ice/ice_rxtx.h b/drivers/net/ice/ice_rxtx.h
index e921411..f951088 100644
--- a/drivers/net/ice/ice_rxtx.h
+++ b/drivers/net/ice/ice_rxtx.h
@@ -188,4 +188,8 @@ uint16_t ice_recv_scattered_pkts_vec_avx2(void *rx_queue,
 					  uint16_t nb_pkts);
 uint16_t ice_xmit_pkts_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
 				uint16_t nb_pkts);
+int ice_rx_burst_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			  char *buf, int sz);
+int ice_tx_burst_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
+			  char *buf, int sz);
 #endif /* _ICE_RXTX_H_ */
-- 
2.7.4


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

* Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
  2019-08-13  3:06 ` [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information Haiyue Wang
@ 2019-08-13  3:24   ` Stephen Hemminger
  2019-08-13  4:37     ` Wang, Haiyue
                       ` (3 more replies)
  0 siblings, 4 replies; 10+ messages in thread
From: Stephen Hemminger @ 2019-08-13  3:24 UTC (permalink / raw)
  To: Haiyue Wang; +Cc: dev

On Tue, 13 Aug 2019 11:06:10 +0800
Haiyue Wang <haiyue.wang@intel.com> wrote:

> Enhance the PMD to support retrieving trace information like
> Rx/Tx burst selection etc.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> ---
>  lib/librte_ethdev/rte_ethdev.c      | 18 ++++++++++++++++++
>  lib/librte_ethdev/rte_ethdev.h      |  9 +++++++++
>  lib/librte_ethdev/rte_ethdev_core.h |  4 ++++
>  3 files changed, 31 insertions(+)
> 
> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> index 17d183e..6098fad 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
>  }
>  
>  int
> +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
> +		       enum rte_eth_trace type, char *buf, int sz)
> +{
> +	struct rte_eth_dev *dev;
> +
> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> +
> +	if (buf == NULL)
> +		return -EINVAL;
> +
> +	dev = &rte_eth_devices[port_id];
> +
> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
> +
> +	return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);

What if queueid is out of bounds?

The bigger problem is that this information is like a log message
and unstructured, which makes it device specific and useless for automation.

Why not just keep it in the log like it is now?

>  int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
>  	struct rte_eth_txq_info *qinfo);
>  
> +int
> +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
> +	enum rte_eth_trace type, char *buf, int sz);
> +

You didn't run checkpatch, otherwise you would have seen complaints
about not listing API as experimental.

Also the API would have to be in the map file as well.

Docbook comments are also missing.




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

* Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
  2019-08-13  3:24   ` Stephen Hemminger
@ 2019-08-13  4:37     ` Wang, Haiyue
  2019-08-13  9:57     ` David Marchand
                       ` (2 subsequent siblings)
  3 siblings, 0 replies; 10+ messages in thread
From: Wang, Haiyue @ 2019-08-13  4:37 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: dev

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Tuesday, August 13, 2019 11:25
> To: Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev@dpdk.org
> Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
> 
> On Tue, 13 Aug 2019 11:06:10 +0800
> Haiyue Wang <haiyue.wang@intel.com> wrote:
> 
> > Enhance the PMD to support retrieving trace information like
> > Rx/Tx burst selection etc.
> >
> > Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
> > ---
> >  lib/librte_ethdev/rte_ethdev.c      | 18 ++++++++++++++++++
> >  lib/librte_ethdev/rte_ethdev.h      |  9 +++++++++
> >  lib/librte_ethdev/rte_ethdev_core.h |  4 ++++
> >  3 files changed, 31 insertions(+)
> >
> > diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
> > index 17d183e..6098fad 100644
> > --- a/lib/librte_ethdev/rte_ethdev.c
> > +++ b/lib/librte_ethdev/rte_ethdev.c
> > @@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
> >  }
> >
> >  int
> > +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
> > +		       enum rte_eth_trace type, char *buf, int sz)
> > +{
> > +	struct rte_eth_dev *dev;
> > +
> > +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
> > +
> > +	if (buf == NULL)
> > +		return -EINVAL;
> > +
> > +	dev = &rte_eth_devices[port_id];
> > +
> > +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
> > +
> > +	return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);
> 
> What if queueid is out of bounds?

Some trace may not need queueid, so skip it check here, make it a little
flexible.

> 
> The bigger problem is that this information is like a log message
> and unstructured, which makes it device specific and useless for automation.
> 
> Why not just keep it in the log like it is now?

Yes, log is good now (but need run with extra options). This patch works like
run time debug tool, it identify the code running status. Not for automation
now. But if we want this kind of things, hook the code point, define a rule
to format the message.

> 
> >  int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
> >  	struct rte_eth_txq_info *qinfo);
> >
> > +int
> > +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
> > +	enum rte_eth_trace type, char *buf, int sz);
> > +
> 
> You didn't run checkpatch, otherwise you would have seen complaints
> about not listing API as experimental.
> 

./devtools/checkpatches.sh ?

3/3 valid patches


> Also the API would have to be in the map file as well.
> 
> Docbook comments are also missing.
> 
> 

This is rough draft, so show the code firstly. ;-)


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

* Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
  2019-08-13  3:24   ` Stephen Hemminger
  2019-08-13  4:37     ` Wang, Haiyue
@ 2019-08-13  9:57     ` David Marchand
  2019-08-13 11:21       ` Wang, Haiyue
  2019-08-13 12:51     ` Ray Kinsella
  2019-08-15  9:07     ` Ray Kinsella
  3 siblings, 1 reply; 10+ messages in thread
From: David Marchand @ 2019-08-13  9:57 UTC (permalink / raw)
  To: Stephen Hemminger, Haiyue Wang; +Cc: dev, Neil Horman

On Tue, Aug 13, 2019 at 5:24 AM Stephen Hemminger
<stephen@networkplumber.org> wrote:
>
> On Tue, 13 Aug 2019 11:06:10 +0800
> Haiyue Wang <haiyue.wang@intel.com> wrote:

> >  int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
> >       struct rte_eth_txq_info *qinfo);
> >
> > +int
> > +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
> > +     enum rte_eth_trace type, char *buf, int sz);
> > +
>
> You didn't run checkpatch, otherwise you would have seen complaints
> about not listing API as experimental.

The checks in checkpatches.sh won't catch this.
But trying to build dpdk as a shared library will.

Example: https://travis-ci.com/david-marchand/dpdk/jobs/224737320


-- 
David Marchand

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

* Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
  2019-08-13  9:57     ` David Marchand
@ 2019-08-13 11:21       ` Wang, Haiyue
  0 siblings, 0 replies; 10+ messages in thread
From: Wang, Haiyue @ 2019-08-13 11:21 UTC (permalink / raw)
  To: David Marchand, Stephen Hemminger; +Cc: dev, Neil Horman

> -----Original Message-----
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Tuesday, August 13, 2019 17:58
> To: Stephen Hemminger <stephen@networkplumber.org>; Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev <dev@dpdk.org>; Neil Horman <nhorman@tuxdriver.com>
> Subject: Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
> 
> On Tue, Aug 13, 2019 at 5:24 AM Stephen Hemminger
> <stephen@networkplumber.org> wrote:
> >
> > On Tue, 13 Aug 2019 11:06:10 +0800
> > Haiyue Wang <haiyue.wang@intel.com> wrote:
> 
> > >  int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
> > >       struct rte_eth_txq_info *qinfo);
> > >
> > > +int
> > > +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
> > > +     enum rte_eth_trace type, char *buf, int sz);
> > > +
> >
> > You didn't run checkpatch, otherwise you would have seen complaints
> > about not listing API as experimental.
> 
> The checks in checkpatches.sh won't catch this.
> But trying to build dpdk as a shared library will.
> 
> Example: https://travis-ci.com/david-marchand/dpdk/jobs/224737320
> 
> 

Got it, thanks for sharing, just for a quick RFC, missed something
in detail for making an API.

> --
> David Marchand

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

* Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
  2019-08-13  3:24   ` Stephen Hemminger
  2019-08-13  4:37     ` Wang, Haiyue
  2019-08-13  9:57     ` David Marchand
@ 2019-08-13 12:51     ` Ray Kinsella
  2019-08-15  9:07     ` Ray Kinsella
  3 siblings, 0 replies; 10+ messages in thread
From: Ray Kinsella @ 2019-08-13 12:51 UTC (permalink / raw)
  To: dev



On 13/08/2019 04:24, Stephen Hemminger wrote:
> On Tue, 13 Aug 2019 11:06:10 +0800
> Haiyue Wang <haiyue.wang@intel.com> wrote:
> 
>> Enhance the PMD to support retrieving trace information like
>> Rx/Tx burst selection etc.
>>
>> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
>> ---
>>  lib/librte_ethdev/rte_ethdev.c      | 18 ++++++++++++++++++
>>  lib/librte_ethdev/rte_ethdev.h      |  9 +++++++++
>>  lib/librte_ethdev/rte_ethdev_core.h |  4 ++++
>>  3 files changed, 31 insertions(+)
>>
>> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>> index 17d183e..6098fad 100644
>> --- a/lib/librte_ethdev/rte_ethdev.c
>> +++ b/lib/librte_ethdev/rte_ethdev.c
>> @@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
>>  }
>>  
>>  int
>> +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
>> +		       enum rte_eth_trace type, char *buf, int sz)
>> +{
>> +	struct rte_eth_dev *dev;
>> +
>> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>> +
>> +	if (buf == NULL)
>> +		return -EINVAL;
>> +
>> +	dev = &rte_eth_devices[port_id];
>> +
>> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
>> +
>> +	return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);
> 
> What if queueid is out of bounds?
> 
> The bigger problem is that this information is like a log message
> and unstructured, which makes it device specific and useless for automation.

IMHO - this is much better implemented as a capability bitfield, that
can be queried.

> 
> Why not just keep it in the log like it is now?
> 
>>  int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
>>  	struct rte_eth_txq_info *qinfo);
>>  
>> +int
>> +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
>> +	enum rte_eth_trace type, char *buf, int sz);
>> +
> 
> You didn't run checkpatch, otherwise you would have seen complaints
> about not listing API as experimental.
> 
> Also the API would have to be in the map file as well.
> 
> Docbook comments are also missing.
> 
> 
> 
> 

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

* Re: [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information
  2019-08-13  3:24   ` Stephen Hemminger
                       ` (2 preceding siblings ...)
  2019-08-13 12:51     ` Ray Kinsella
@ 2019-08-15  9:07     ` Ray Kinsella
  3 siblings, 0 replies; 10+ messages in thread
From: Ray Kinsella @ 2019-08-15  9:07 UTC (permalink / raw)
  To: dev



On 13/08/2019 04:24, Stephen Hemminger wrote:
> On Tue, 13 Aug 2019 11:06:10 +0800
> Haiyue Wang <haiyue.wang@intel.com> wrote:
> 
>> Enhance the PMD to support retrieving trace information like
>> Rx/Tx burst selection etc.
>>
>> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
>> ---
>>  lib/librte_ethdev/rte_ethdev.c      | 18 ++++++++++++++++++
>>  lib/librte_ethdev/rte_ethdev.h      |  9 +++++++++
>>  lib/librte_ethdev/rte_ethdev_core.h |  4 ++++
>>  3 files changed, 31 insertions(+)
>>
>> diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
>> index 17d183e..6098fad 100644
>> --- a/lib/librte_ethdev/rte_ethdev.c
>> +++ b/lib/librte_ethdev/rte_ethdev.c
>> @@ -4083,6 +4083,24 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
>>  }
>>  
>>  int
>> +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
>> +		       enum rte_eth_trace type, char *buf, int sz)
>> +{
>> +	struct rte_eth_dev *dev;
>> +
>> +	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
>> +
>> +	if (buf == NULL)
>> +		return -EINVAL;
>> +
>> +	dev = &rte_eth_devices[port_id];
>> +
>> +	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->trace_info_get, -ENOTSUP);
>> +
>> +	return dev->dev_ops->trace_info_get(dev, queue_id, type, buf, sz);
> 
> What if queueid is out of bounds?
> 
> The bigger problem is that this information is like a log message
> and unstructured, which makes it device specific and useless for automation.
> 
> Why not just keep it in the log like it is now?

I agree that strings are not the way to capture this kind of information.

The reason for doing this work, is that consuming software like FD.io
VPP find it useful to provide the user the ability to display debug
information (show hardware) - including what PMD is actually doing the
work under the covers, as different PMD configurations can yield
dramatically different performance.

> 
>>  int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,
>>  	struct rte_eth_txq_info *qinfo);
>>  
>> +int
>> +rte_eth_trace_info_get(uint16_t port_id, uint16_t queue_id,
>> +	enum rte_eth_trace type, char *buf, int sz);
>> +
> 
> You didn't run checkpatch, otherwise you would have seen complaints
> about not listing API as experimental.
> 
> Also the API would have to be in the map file as well.
> 
> Docbook comments are also missing.
> 
> 
> 
> 

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

end of thread, back to index

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-13  3:06 [dpdk-dev] [RFC v2 0/3] show the Rx/Tx burst description field Haiyue Wang
2019-08-13  3:06 ` [dpdk-dev] [RFC v2 1/3] ethdev: add the API for getting trace information Haiyue Wang
2019-08-13  3:24   ` Stephen Hemminger
2019-08-13  4:37     ` Wang, Haiyue
2019-08-13  9:57     ` David Marchand
2019-08-13 11:21       ` Wang, Haiyue
2019-08-13 12:51     ` Ray Kinsella
2019-08-15  9:07     ` Ray Kinsella
2019-08-13  3:06 ` [dpdk-dev] [RFC v2 2/3] testpmd: show the Rx/Tx burst description Haiyue Wang
2019-08-13  3:06 ` [dpdk-dev] [RFC v2 3/3] net/ice: support the Rx/Tx burst description trace Haiyue Wang

DPDK patches and discussions

Archives are clonable:
	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev


Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/ public-inbox