DPDK-dev Archive on lore.kernel.org
 help / color / Atom feed
* [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
@ 2019-08-12 14:15 Haiyue Wang
  2019-08-12 14:15 ` [dpdk-dev] [RFC v1 1/3] ethdev: add the Rx/Tx burst description field in queue information Haiyue Wang
                   ` (3 more replies)
  0 siblings, 4 replies; 13+ messages in thread
From: Haiyue Wang @ 2019-08-12 14:15 UTC (permalink / raw)
  To: dev; +Cc: Haiyue Wang

Since some PMDs have multi-path for Rx/Tx, FD.io VPP will tell you in
the Debug CLI what rx/tx function is being used:
	#show hardware-interface
	 
	 tx burst function: ice_xmit_pkts
	 rx burst function: ice_recv_scattered_pkts

But if the tx/rx is static, then 'dladdr' will return nil:

	 tx burst function: (nil) │······················
	 rx burst function: (nil) │······················

For making things consistent and gracefull, we introduce an new string
field to describe the Rx/Tx burst information. This is vendor-neutral,
it is used to identify the Rx/Tx burst selection if the PMD has more
than one.  

If a PMD supports this, then rxqinfo/txqinfo->burst_info[0] != '\0'.

This is for net/ice PMD result.

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

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

Haiyue Wang (3):
  ethdev: add the Rx/Tx burst description field in queue information
  testpmd: show the Rx/Tx burst description field in queue
  net/ice: support the Rx/Tx burst description field in queue
    information

 app/test-pmd/config.c          |  2 ++
 drivers/net/ice/ice_rxtx.c     | 49 ++++++++++++++++++++++++++++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h |  7 ++++++
 3 files changed, 58 insertions(+)

-- 
2.7.4


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

* [dpdk-dev] [RFC v1 1/3] ethdev: add the Rx/Tx burst description field in queue information
  2019-08-12 14:15 [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field Haiyue Wang
@ 2019-08-12 14:15 ` Haiyue Wang
  2019-08-12 15:37   ` Stephen Hemminger
  2019-08-12 14:15 ` [dpdk-dev] [RFC v1 2/3] testpmd: show the Rx/Tx burst description field in queue Haiyue Wang
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Haiyue Wang @ 2019-08-12 14:15 UTC (permalink / raw)
  To: dev; +Cc: Haiyue Wang

Since each PMD has different Rx/Tx burst capabilities such as Vector,
Scattered, Bulk etc, adding the Rx/Tx burst description field in queue
information to provide apps current configuration of PMD Rx/Tx burst.

This is a self-description for each PMD in its own format.

Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>
---
 lib/librte_ethdev/rte_ethdev.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index dc6596b..bc48c0c 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -1192,6 +1192,9 @@ struct rte_eth_dev_info {
 	struct rte_eth_switch_info switch_info;
 };
 
+/** Maximum information length to describe the PMD RX/TX functions */
+#define RTE_PMD_BURST_INFO_SIZE	128
+
 /**
  * Ethernet device RX queue information structure.
  * Used to retrieve information about configured queue.
@@ -1201,6 +1204,8 @@ struct rte_eth_rxq_info {
 	struct rte_eth_rxconf conf; /**< queue config parameters. */
 	uint8_t scattered_rx;       /**< scattered packets RX supported. */
 	uint16_t nb_desc;           /**< configured number of RXDs. */
+	char burst_info[RTE_PMD_BURST_INFO_SIZE];
+	/**< Description of PMD RX function, such as Vector, Scattered etc */
 } __rte_cache_min_aligned;
 
 /**
@@ -1210,6 +1215,8 @@ struct rte_eth_rxq_info {
 struct rte_eth_txq_info {
 	struct rte_eth_txconf conf; /**< queue config parameters. */
 	uint16_t nb_desc;           /**< configured number of TXDs. */
+	char burst_info[RTE_PMD_BURST_INFO_SIZE];
+	/**< Description of PMD TX function, such as Vector, Scattered etc */
 } __rte_cache_min_aligned;
 
 /** Maximum name length for extended statistics counters */
-- 
2.7.4


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

* [dpdk-dev] [RFC v1 2/3] testpmd: show the Rx/Tx burst description field in queue
  2019-08-12 14:15 [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field Haiyue Wang
  2019-08-12 14:15 ` [dpdk-dev] [RFC v1 1/3] ethdev: add the Rx/Tx burst description field in queue information Haiyue Wang
@ 2019-08-12 14:15 ` Haiyue Wang
  2019-08-12 14:15 ` [dpdk-dev] [RFC v1 3/3] net/ice: support the Rx/Tx burst description field in queue information Haiyue Wang
  2019-08-12 14:27 ` [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field David Marchand
  3 siblings, 0 replies; 13+ messages in thread
From: Haiyue Wang @ 2019-08-12 14:15 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 field in
queue information.

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

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 1a5a5c1..69607ba 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -354,6 +354,7 @@ 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);
+	printf("\nBurst description: %s\n", qinfo.burst_info);
 	printf("\n");
 }
 
@@ -383,6 +384,7 @@ 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);
+	printf("\nBurst description: %s\n", qinfo.burst_info);
 	printf("\n");
 }
 
-- 
2.7.4


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

* [dpdk-dev] [RFC v1 3/3] net/ice: support the Rx/Tx burst description field in queue information
  2019-08-12 14:15 [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field Haiyue Wang
  2019-08-12 14:15 ` [dpdk-dev] [RFC v1 1/3] ethdev: add the Rx/Tx burst description field in queue information Haiyue Wang
  2019-08-12 14:15 ` [dpdk-dev] [RFC v1 2/3] testpmd: show the Rx/Tx burst description field in queue Haiyue Wang
@ 2019-08-12 14:15 ` Haiyue Wang
  2019-08-12 14:27 ` [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field David Marchand
  3 siblings, 0 replies; 13+ messages in thread
From: Haiyue Wang @ 2019-08-12 14:15 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_rxtx.c | 49 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 49 insertions(+)

diff --git a/drivers/net/ice/ice_rxtx.c b/drivers/net/ice/ice_rxtx.c
index 0282b53..9e6b1f7 100644
--- a/drivers/net/ice/ice_rxtx.c
+++ b/drivers/net/ice/ice_rxtx.c
@@ -15,6 +15,16 @@
 
 #define ICE_RX_ERR_BITS 0x3f
 
+static uint16_t ice_recv_scattered_pkts(void *rx_queue,
+					struct rte_mbuf **rx_pkts,
+					uint16_t nb_pkts);
+static uint16_t ice_recv_pkts_bulk_alloc(void *rx_queue,
+					 struct rte_mbuf **rx_pkts,
+					 uint16_t nb_pkts);
+static uint16_t ice_xmit_pkts_simple(void *tx_queue,
+				     struct rte_mbuf **tx_pkts,
+				     uint16_t nb_pkts);
+
 static enum ice_status
 ice_program_hw_rx_queue(struct ice_rx_queue *rxq)
 {
@@ -935,6 +945,30 @@ ice_rxq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.rx_free_thresh = rxq->rx_free_thresh;
 	qinfo->conf.rx_drop_en = rxq->drop_en;
 	qinfo->conf.rx_deferred_start = rxq->rx_deferred_start;
+
+	if (dev->rx_pkt_burst == ice_recv_scattered_pkts)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Scattered Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts_bulk_alloc)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Bulk Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Normal Rx");
+#ifdef RTE_ARCH_X86
+	else if (dev->rx_pkt_burst == ice_recv_scattered_pkts_vec_avx2)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "AVX2 Vector Scattered Rx");
+	else if (dev->rx_pkt_burst == ice_recv_scattered_pkts_vec)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Vector Scattered Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts_vec_avx2)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "AVX2 Vector Rx");
+	else if (dev->rx_pkt_burst == ice_recv_pkts_vec)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Vector Rx");
+#endif
 }
 
 void
@@ -955,6 +989,21 @@ ice_txq_info_get(struct rte_eth_dev *dev, uint16_t queue_id,
 	qinfo->conf.tx_rs_thresh = txq->tx_rs_thresh;
 	qinfo->conf.offloads = txq->offloads;
 	qinfo->conf.tx_deferred_start = txq->tx_deferred_start;
+
+	if (dev->tx_pkt_burst == ice_xmit_pkts_simple)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Simple Tx");
+	else if (dev->tx_pkt_burst == ice_xmit_pkts)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Normal Tx");
+#ifdef RTE_ARCH_X86
+	else if (dev->tx_pkt_burst == ice_xmit_pkts_vec_avx2)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "AVX2 Vector Tx");
+	else if (dev->tx_pkt_burst == ice_xmit_pkts_vec)
+		snprintf(qinfo->burst_info, sizeof(qinfo->burst_info),
+			 "Vector Tx");
+#endif
 }
 
 uint32_t
-- 
2.7.4


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

* Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
  2019-08-12 14:15 [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field Haiyue Wang
                   ` (2 preceding siblings ...)
  2019-08-12 14:15 ` [dpdk-dev] [RFC v1 3/3] net/ice: support the Rx/Tx burst description field in queue information Haiyue Wang
@ 2019-08-12 14:27 ` David Marchand
  2019-08-12 15:38   ` Stephen Hemminger
  2019-08-12 15:39   ` Wang, Haiyue
  3 siblings, 2 replies; 13+ messages in thread
From: David Marchand @ 2019-08-12 14:27 UTC (permalink / raw)
  To: Haiyue Wang; +Cc: dev

On Mon, Aug 12, 2019 at 4:20 PM Haiyue Wang <haiyue.wang@intel.com> wrote:
>
> Since some PMDs have multi-path for Rx/Tx, FD.io VPP will tell you in
> the Debug CLI what rx/tx function is being used:
>         #show hardware-interface
>
>          tx burst function: ice_xmit_pkts
>          rx burst function: ice_recv_scattered_pkts
>
> But if the tx/rx is static, then 'dladdr' will return nil:
>
>          tx burst function: (nil) │······················
>          rx burst function: (nil) │······················
>
> For making things consistent and gracefull, we introduce an new string
> field to describe the Rx/Tx burst information. This is vendor-neutral,
> it is used to identify the Rx/Tx burst selection if the PMD has more
> than one.
>
> If a PMD supports this, then rxqinfo/txqinfo->burst_info[0] != '\0'.

The rx/tx handlers are the same for all queues of a ethdev port.
What is the added value to put this in a per queue api ?


-- 
David Marchand

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

* Re: [dpdk-dev] [RFC v1 1/3] ethdev: add the Rx/Tx burst description field in queue information
  2019-08-12 14:15 ` [dpdk-dev] [RFC v1 1/3] ethdev: add the Rx/Tx burst description field in queue information Haiyue Wang
@ 2019-08-12 15:37   ` Stephen Hemminger
  0 siblings, 0 replies; 13+ messages in thread
From: Stephen Hemminger @ 2019-08-12 15:37 UTC (permalink / raw)
  To: Haiyue Wang; +Cc: dev

On Mon, 12 Aug 2019 22:15:03 +0800
Haiyue Wang <haiyue.wang@intel.com> wrote:

> Since each PMD has different Rx/Tx burst capabilities such as Vector,
> Scattered, Bulk etc, adding the Rx/Tx burst description field in queue
> information to provide apps current configuration of PMD Rx/Tx burst.
> 
> This is a self-description for each PMD in its own format.
> 
> Signed-off-by: Haiyue Wang <haiyue.wang@intel.com>

I can see why it might help with diagnosing issues on VPP,
but it would have bigger impacts for other users of DPDK.

Think of a better way that doesn't break ABI.
This is not enough value to make the DPDK more unstable.

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

* Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
  2019-08-12 14:27 ` [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field David Marchand
@ 2019-08-12 15:38   ` Stephen Hemminger
  2019-08-12 15:42     ` Wang, Haiyue
  2019-08-12 15:39   ` Wang, Haiyue
  1 sibling, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2019-08-12 15:38 UTC (permalink / raw)
  To: David Marchand; +Cc: Haiyue Wang, dev

On Mon, 12 Aug 2019 16:27:11 +0200
David Marchand <david.marchand@redhat.com> wrote:

> On Mon, Aug 12, 2019 at 4:20 PM Haiyue Wang <haiyue.wang@intel.com> wrote:
> >
> > Since some PMDs have multi-path for Rx/Tx, FD.io VPP will tell you in
> > the Debug CLI what rx/tx function is being used:
> >         #show hardware-interface
> >
> >          tx burst function: ice_xmit_pkts
> >          rx burst function: ice_recv_scattered_pkts
> >
> > But if the tx/rx is static, then 'dladdr' will return nil:
> >
> >          tx burst function: (nil) │······················
> >          rx burst function: (nil) │······················
> >
> > For making things consistent and gracefull, we introduce an new string
> > field to describe the Rx/Tx burst information. This is vendor-neutral,
> > it is used to identify the Rx/Tx burst selection if the PMD has more
> > than one.
> >
> > If a PMD supports this, then rxqinfo/txqinfo->burst_info[0] != '\0'.  
> 
> The rx/tx handlers are the same for all queues of a ethdev port.
> What is the added value to put this in a per queue api ?

With some symbol table lookup tools it is possible to do introspection
to find the symbol from the function pointer. Without breaking API/ABI.

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

* Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
  2019-08-12 14:27 ` [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field David Marchand
  2019-08-12 15:38   ` Stephen Hemminger
@ 2019-08-12 15:39   ` Wang, Haiyue
  1 sibling, 0 replies; 13+ messages in thread
From: Wang, Haiyue @ 2019-08-12 15:39 UTC (permalink / raw)
  To: David Marchand; +Cc: dev

> -----Original Message-----
> From: David Marchand [mailto:david.marchand@redhat.com]
> Sent: Monday, August 12, 2019 22:27
> To: Wang, Haiyue <haiyue.wang@intel.com>
> Cc: dev <dev@dpdk.org>
> Subject: Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
> 
> On Mon, Aug 12, 2019 at 4:20 PM Haiyue Wang <haiyue.wang@intel.com> wrote:
> >
> > Since some PMDs have multi-path for Rx/Tx, FD.io VPP will tell you in
> > the Debug CLI what rx/tx function is being used:
> >         #show hardware-interface
> >
> >          tx burst function: ice_xmit_pkts
> >          rx burst function: ice_recv_scattered_pkts
> >
> > But if the tx/rx is static, then 'dladdr' will return nil:
> >
> >          tx burst function: (nil) │······················
> >          rx burst function: (nil) │······················
> >
> > For making things consistent and gracefull, we introduce an new string
> > field to describe the Rx/Tx burst information. This is vendor-neutral,
> > it is used to identify the Rx/Tx burst selection if the PMD has more
> > than one.
> >
> > If a PMD supports this, then rxqinfo/txqinfo->burst_info[0] != '\0'.
> 
> The rx/tx handlers are the same for all queues of a ethdev port.
> What is the added value to put this in a per queue api ?
> 

We will add support Receive Flex Descriptor per queue in 19.11:
drivers/net/ice/base/ice_lan_tx_rx.h --> enum ice_rxdid

Then the burst_info will be Vector (generic info) + RXDID info,
that's why we changed the design from const char * to char [].

> 
> --
> David Marchand

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

* Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
  2019-08-12 15:38   ` Stephen Hemminger
@ 2019-08-12 15:42     ` Wang, Haiyue
  2019-08-12 15:54       ` Stephen Hemminger
  0 siblings, 1 reply; 13+ messages in thread
From: Wang, Haiyue @ 2019-08-12 15:42 UTC (permalink / raw)
  To: Stephen Hemminger, David Marchand; +Cc: dev

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Monday, August 12, 2019 23:38
> To: David Marchand <david.marchand@redhat.com>
> Cc: Wang, Haiyue <haiyue.wang@intel.com>; dev <dev@dpdk.org>
> Subject: Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
> 
> On Mon, 12 Aug 2019 16:27:11 +0200
> David Marchand <david.marchand@redhat.com> wrote:
> 
> > On Mon, Aug 12, 2019 at 4:20 PM Haiyue Wang <haiyue.wang@intel.com> wrote:
> > >
> > > Since some PMDs have multi-path for Rx/Tx, FD.io VPP will tell you in
> > > the Debug CLI what rx/tx function is being used:
> > >         #show hardware-interface
> > >
> > >          tx burst function: ice_xmit_pkts
> > >          rx burst function: ice_recv_scattered_pkts
> > >
> > > But if the tx/rx is static, then 'dladdr' will return nil:
> > >
> > >          tx burst function: (nil) │······················
> > >          rx burst function: (nil) │······················
> > >
> > > For making things consistent and gracefull, we introduce an new string
> > > field to describe the Rx/Tx burst information. This is vendor-neutral,
> > > it is used to identify the Rx/Tx burst selection if the PMD has more
> > > than one.
> > >
> > > If a PMD supports this, then rxqinfo/txqinfo->burst_info[0] != '\0'.
> >
> > The rx/tx handlers are the same for all queues of a ethdev port.
> > What is the added value to put this in a per queue api ?
> 
> With some symbol table lookup tools it is possible to do introspection
> to find the symbol from the function pointer. Without breaking API/ABI.

Sounds cool, any link can be reached ?

VPP uses as below, but will fail for static function.

static const char *
ptr2sname (void *p)
{
  Dl_info info = { 0 };

  if (dladdr (p, &info) == 0)
    return 0;

  return info.dli_sname;
}

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

* Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
  2019-08-12 15:42     ` Wang, Haiyue
@ 2019-08-12 15:54       ` Stephen Hemminger
  2019-08-12 16:00         ` Wang, Haiyue
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2019-08-12 15:54 UTC (permalink / raw)
  To: Wang, Haiyue; +Cc: David Marchand, dev

On Mon, 12 Aug 2019 15:42:45 +0000
"Wang, Haiyue" <haiyue.wang@intel.com> wrote:

> > -----Original Message-----
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Monday, August 12, 2019 23:38
> > To: David Marchand <david.marchand@redhat.com>
> > Cc: Wang, Haiyue <haiyue.wang@intel.com>; dev <dev@dpdk.org>
> > Subject: Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
> > 
> > On Mon, 12 Aug 2019 16:27:11 +0200
> > David Marchand <david.marchand@redhat.com> wrote:
> >   
> > > On Mon, Aug 12, 2019 at 4:20 PM Haiyue Wang <haiyue.wang@intel.com> wrote:  
> > > >
> > > > Since some PMDs have multi-path for Rx/Tx, FD.io VPP will tell you in
> > > > the Debug CLI what rx/tx function is being used:
> > > >         #show hardware-interface
> > > >
> > > >          tx burst function: ice_xmit_pkts
> > > >          rx burst function: ice_recv_scattered_pkts
> > > >
> > > > But if the tx/rx is static, then 'dladdr' will return nil:
> > > >
> > > >          tx burst function: (nil) │······················
> > > >          rx burst function: (nil) │······················
> > > >
> > > > For making things consistent and gracefull, we introduce an new string
> > > > field to describe the Rx/Tx burst information. This is vendor-neutral,
> > > > it is used to identify the Rx/Tx burst selection if the PMD has more
> > > > than one.
> > > >
> > > > If a PMD supports this, then rxqinfo/txqinfo->burst_info[0] != '\0'.  
> > >
> > > The rx/tx handlers are the same for all queues of a ethdev port.
> > > What is the added value to put this in a per queue api ?  
> > 
> > With some symbol table lookup tools it is possible to do introspection
> > to find the symbol from the function pointer. Without breaking API/ABI.  
> 
> Sounds cool, any link can be reached ?
> 
> VPP uses as below, but will fail for static function.
> 
> static const char *
> ptr2sname (void *p)
> {
>   Dl_info info = { 0 };
> 
>   if (dladdr (p, &info) == 0)
>     return 0;
> 
>   return info.dli_sname;
> }

You need to link with -g and not strip the binary.

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

* Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
  2019-08-12 15:54       ` Stephen Hemminger
@ 2019-08-12 16:00         ` Wang, Haiyue
  2019-08-12 17:28           ` Stephen Hemminger
  0 siblings, 1 reply; 13+ messages in thread
From: Wang, Haiyue @ 2019-08-12 16:00 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Marchand, dev

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Monday, August 12, 2019 23:54
> To: Wang, Haiyue <haiyue.wang@intel.com>
> Cc: David Marchand <david.marchand@redhat.com>; dev <dev@dpdk.org>
> Subject: Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
> 
> On Mon, 12 Aug 2019 15:42:45 +0000
> "Wang, Haiyue" <haiyue.wang@intel.com> wrote:
> 
> > > -----Original Message-----
> > > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > > Sent: Monday, August 12, 2019 23:38
> > > To: David Marchand <david.marchand@redhat.com>
> > > Cc: Wang, Haiyue <haiyue.wang@intel.com>; dev <dev@dpdk.org>
> > > Subject: Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
> > >
> > > On Mon, 12 Aug 2019 16:27:11 +0200
> > > David Marchand <david.marchand@redhat.com> wrote:
> > >
> > > > On Mon, Aug 12, 2019 at 4:20 PM Haiyue Wang <haiyue.wang@intel.com> wrote:
> > > > >
> > > > > Since some PMDs have multi-path for Rx/Tx, FD.io VPP will tell you in
> > > > > the Debug CLI what rx/tx function is being used:
> > > > >         #show hardware-interface
> > > > >
> > > > >          tx burst function: ice_xmit_pkts
> > > > >          rx burst function: ice_recv_scattered_pkts
> > > > >
> > > > > But if the tx/rx is static, then 'dladdr' will return nil:
> > > > >
> > > > >          tx burst function: (nil) │······················
> > > > >          rx burst function: (nil) │······················
> > > > >
> > > > > For making things consistent and gracefull, we introduce an new string
> > > > > field to describe the Rx/Tx burst information. This is vendor-neutral,
> > > > > it is used to identify the Rx/Tx burst selection if the PMD has more
> > > > > than one.
> > > > >
> > > > > If a PMD supports this, then rxqinfo/txqinfo->burst_info[0] != '\0'.
> > > >
> > > > The rx/tx handlers are the same for all queues of a ethdev port.
> > > > What is the added value to put this in a per queue api ?
> > >
> > > With some symbol table lookup tools it is possible to do introspection
> > > to find the symbol from the function pointer. Without breaking API/ABI.
> >
> > Sounds cool, any link can be reached ?
> >
> > VPP uses as below, but will fail for static function.
> >
> > static const char *
> > ptr2sname (void *p)
> > {
> >   Dl_info info = { 0 };
> >
> >   if (dladdr (p, &info) == 0)
> >     return 0;
> >
> >   return info.dli_sname;
> > }
> 
> You need to link with -g and not strip the binary.

You mean gdb debug mode, I guess they will not accept this also. ;-)

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

* Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
  2019-08-12 16:00         ` Wang, Haiyue
@ 2019-08-12 17:28           ` Stephen Hemminger
  2019-08-12 17:36             ` Wang, Haiyue
  0 siblings, 1 reply; 13+ messages in thread
From: Stephen Hemminger @ 2019-08-12 17:28 UTC (permalink / raw)
  To: Wang, Haiyue; +Cc: David Marchand, dev

On Mon, 12 Aug 2019 16:00:27 +0000
"Wang, Haiyue" <haiyue.wang@intel.com> wrote:

> > -----Original Message-----
> > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > Sent: Monday, August 12, 2019 23:54
> > To: Wang, Haiyue <haiyue.wang@intel.com>
> > Cc: David Marchand <david.marchand@redhat.com>; dev <dev@dpdk.org>
> > Subject: Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
> > 
> > On Mon, 12 Aug 2019 15:42:45 +0000
> > "Wang, Haiyue" <haiyue.wang@intel.com> wrote:
> >   
> > > > -----Original Message-----
> > > > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > > > Sent: Monday, August 12, 2019 23:38
> > > > To: David Marchand <david.marchand@redhat.com>
> > > > Cc: Wang, Haiyue <haiyue.wang@intel.com>; dev <dev@dpdk.org>
> > > > Subject: Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
> > > >
> > > > On Mon, 12 Aug 2019 16:27:11 +0200
> > > > David Marchand <david.marchand@redhat.com> wrote:
> > > >  
> > > > > On Mon, Aug 12, 2019 at 4:20 PM Haiyue Wang <haiyue.wang@intel.com> wrote:  
> > > > > >
> > > > > > Since some PMDs have multi-path for Rx/Tx, FD.io VPP will tell you in
> > > > > > the Debug CLI what rx/tx function is being used:
> > > > > >         #show hardware-interface
> > > > > >
> > > > > >          tx burst function: ice_xmit_pkts
> > > > > >          rx burst function: ice_recv_scattered_pkts
> > > > > >
> > > > > > But if the tx/rx is static, then 'dladdr' will return nil:
> > > > > >
> > > > > >          tx burst function: (nil) │······················
> > > > > >          rx burst function: (nil) │······················
> > > > > >
> > > > > > For making things consistent and gracefull, we introduce an new string
> > > > > > field to describe the Rx/Tx burst information. This is vendor-neutral,
> > > > > > it is used to identify the Rx/Tx burst selection if the PMD has more
> > > > > > than one.
> > > > > >
> > > > > > If a PMD supports this, then rxqinfo/txqinfo->burst_info[0] != '\0'.  
> > > > >
> > > > > The rx/tx handlers are the same for all queues of a ethdev port.
> > > > > What is the added value to put this in a per queue api ?  
> > > >
> > > > With some symbol table lookup tools it is possible to do introspection
> > > > to find the symbol from the function pointer. Without breaking API/ABI.  
> > >
> > > Sounds cool, any link can be reached ?
> > >
> > > VPP uses as below, but will fail for static function.
> > >
> > > static const char *
> > > ptr2sname (void *p)
> > > {
> > >   Dl_info info = { 0 };
> > >
> > >   if (dladdr (p, &info) == 0)
> > >     return 0;
> > >
> > >   return info.dli_sname;
> > > }  
> > 
> > You need to link with -g and not strip the binary.  
> 
> You mean gdb debug mode, I guess they will not accept this also. ;-)

There other ways to mark symbol as non-debug but -g is easiest.
One way is to not mark the function as static.
Other ways are to achieve the same think like __attribute((visibility())
and linker scripts etc.

Remember this is VPP you are talking about and it doesn't use standard
DPDK make and flags.



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

* Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
  2019-08-12 17:28           ` Stephen Hemminger
@ 2019-08-12 17:36             ` Wang, Haiyue
  0 siblings, 0 replies; 13+ messages in thread
From: Wang, Haiyue @ 2019-08-12 17:36 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David Marchand, dev

> -----Original Message-----
> From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> Sent: Tuesday, August 13, 2019 01:29
> To: Wang, Haiyue <haiyue.wang@intel.com>
> Cc: David Marchand <david.marchand@redhat.com>; dev <dev@dpdk.org>
> Subject: Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
> 
> On Mon, 12 Aug 2019 16:00:27 +0000
> "Wang, Haiyue" <haiyue.wang@intel.com> wrote:
> 
> > > -----Original Message-----
> > > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > > Sent: Monday, August 12, 2019 23:54
> > > To: Wang, Haiyue <haiyue.wang@intel.com>
> > > Cc: David Marchand <david.marchand@redhat.com>; dev <dev@dpdk.org>
> > > Subject: Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
> > >
> > > On Mon, 12 Aug 2019 15:42:45 +0000
> > > "Wang, Haiyue" <haiyue.wang@intel.com> wrote:
> > >
> > > > > -----Original Message-----
> > > > > From: Stephen Hemminger [mailto:stephen@networkplumber.org]
> > > > > Sent: Monday, August 12, 2019 23:38
> > > > > To: David Marchand <david.marchand@redhat.com>
> > > > > Cc: Wang, Haiyue <haiyue.wang@intel.com>; dev <dev@dpdk.org>
> > > > > Subject: Re: [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field
> > > > >
> > > > > On Mon, 12 Aug 2019 16:27:11 +0200
> > > > > David Marchand <david.marchand@redhat.com> wrote:
> > > > >
> > > > > > On Mon, Aug 12, 2019 at 4:20 PM Haiyue Wang <haiyue.wang@intel.com> wrote:
> > > > > > >
> > > > > > > Since some PMDs have multi-path for Rx/Tx, FD.io VPP will tell you in
> > > > > > > the Debug CLI what rx/tx function is being used:
> > > > > > >         #show hardware-interface
> > > > > > >
> > > > > > >          tx burst function: ice_xmit_pkts
> > > > > > >          rx burst function: ice_recv_scattered_pkts
> > > > > > >
> > > > > > > But if the tx/rx is static, then 'dladdr' will return nil:
> > > > > > >
> > > > > > >          tx burst function: (nil) │······················
> > > > > > >          rx burst function: (nil) │······················
> > > > > > >
> > > > > > > For making things consistent and gracefull, we introduce an new string
> > > > > > > field to describe the Rx/Tx burst information. This is vendor-neutral,
> > > > > > > it is used to identify the Rx/Tx burst selection if the PMD has more
> > > > > > > than one.
> > > > > > >
> > > > > > > If a PMD supports this, then rxqinfo/txqinfo->burst_info[0] != '\0'.
> > > > > >
> > > > > > The rx/tx handlers are the same for all queues of a ethdev port.
> > > > > > What is the added value to put this in a per queue api ?
> > > > >
> > > > > With some symbol table lookup tools it is possible to do introspection
> > > > > to find the symbol from the function pointer. Without breaking API/ABI.
> > > >
> > > > Sounds cool, any link can be reached ?
> > > >
> > > > VPP uses as below, but will fail for static function.
> > > >
> > > > static const char *
> > > > ptr2sname (void *p)
> > > > {
> > > >   Dl_info info = { 0 };
> > > >
> > > >   if (dladdr (p, &info) == 0)
> > > >     return 0;
> > > >
> > > >   return info.dli_sname;
> > > > }
> > >
> > > You need to link with -g and not strip the binary.
> >
> > You mean gdb debug mode, I guess they will not accept this also. ;-)
> 
> There other ways to mark symbol as non-debug but -g is easiest.
> One way is to not mark the function as static.
> Other ways are to achieve the same think like __attribute((visibility())
> and linker scripts etc.
> 
> Remember this is VPP you are talking about and it doesn't use standard
> DPDK make and flags.
> 

Yes, this calling is a little geek style, so we are trying to scratch
some code to make thing graceful, at least, this makes sense if multiple
rx /tx paths are provided.

Thanks for your quick feedback, we will try to find other possible design.

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

end of thread, back to index

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-12 14:15 [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field Haiyue Wang
2019-08-12 14:15 ` [dpdk-dev] [RFC v1 1/3] ethdev: add the Rx/Tx burst description field in queue information Haiyue Wang
2019-08-12 15:37   ` Stephen Hemminger
2019-08-12 14:15 ` [dpdk-dev] [RFC v1 2/3] testpmd: show the Rx/Tx burst description field in queue Haiyue Wang
2019-08-12 14:15 ` [dpdk-dev] [RFC v1 3/3] net/ice: support the Rx/Tx burst description field in queue information Haiyue Wang
2019-08-12 14:27 ` [dpdk-dev] [RFC v1 0/3] show the Rx/Tx burst description field David Marchand
2019-08-12 15:38   ` Stephen Hemminger
2019-08-12 15:42     ` Wang, Haiyue
2019-08-12 15:54       ` Stephen Hemminger
2019-08-12 16:00         ` Wang, Haiyue
2019-08-12 17:28           ` Stephen Hemminger
2019-08-12 17:36             ` Wang, Haiyue
2019-08-12 15:39   ` Wang, Haiyue

DPDK-dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dpdk-dev/0 dpdk-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 dpdk-dev dpdk-dev/ https://lore.kernel.org/dpdk-dev \
		dev@dpdk.org
	public-inbox-index dpdk-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.dpdk.dev


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