mbox series

[RFC,v1,0/3] show the Rx/Tx burst description field

Message ID 1565619305-17116-1-git-send-email-haiyue.wang@intel.com (mailing list archive)
Headers
Series show the Rx/Tx burst description field |

Message

Wang, Haiyue Aug. 12, 2019, 2:15 p.m. UTC
  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(+)
  

Comments

David Marchand Aug. 12, 2019, 2:27 p.m. UTC | #1
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 ?
  
Stephen Hemminger Aug. 12, 2019, 3:38 p.m. UTC | #2
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.
  
Wang, Haiyue Aug. 12, 2019, 3:39 p.m. UTC | #3
> -----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
  
Wang, Haiyue Aug. 12, 2019, 3:42 p.m. UTC | #4
> -----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;
}
  
Stephen Hemminger Aug. 12, 2019, 3:54 p.m. UTC | #5
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.
  
Wang, Haiyue Aug. 12, 2019, 4 p.m. UTC | #6
> -----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. ;-)
  
Stephen Hemminger Aug. 12, 2019, 5:28 p.m. UTC | #7
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.
  
Wang, Haiyue Aug. 12, 2019, 5:36 p.m. UTC | #8
> -----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.