[v6,1/8] ether: refine debug build option

Message ID 20210331095254.2454439-2-qi.z.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series ether: refine debug build option |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Qi Zhang March 31, 2021, 9:52 a.m. UTC
  PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
data path debug code. As .config has been removed since the meson build,
It is not friendly for new DPDK users to notice those debug options.

The patch introduces below build options for data path debug, so PMD
can choose to reuse them to avoid maintain their own.

- RTE_ETHDEV_DEBUG_RX
- RTE_ETHDEV_DEBUG_TX

All the build options are documented at programming guide
"3.1 Driver Option", so users can easily find them.

The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
compatibility.

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
 lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
 2 files changed, 30 insertions(+), 8 deletions(-)
  

Comments

Ferruh Yigit April 1, 2021, 2:30 p.m. UTC | #1
On 3/31/2021 10:52 AM, Qi Zhang wrote:
> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
> data path debug code. As .config has been removed since the meson build,
> It is not friendly for new DPDK users to notice those debug options.
> 
> The patch introduces below build options for data path debug, so PMD
> can choose to reuse them to avoid maintain their own.
> 
> - RTE_ETHDEV_DEBUG_RX
> - RTE_ETHDEV_DEBUG_TX
> 
> All the build options are documented at programming guide
> "3.1 Driver Option", so users can easily find them.
> 
> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
> compatibility.
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> ---
>   doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
>   lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
>   2 files changed, 30 insertions(+), 8 deletions(-)
> 
> diff --git a/doc/guides/nics/build_and_test.rst b/doc/guides/nics/build_and_test.rst
> index e83dd4628c..e8b29c2277 100644
> --- a/doc/guides/nics/build_and_test.rst
> +++ b/doc/guides/nics/build_and_test.rst
> @@ -26,6 +26,22 @@ This will also build testpmd.
>   Detailed instructions are available
>   in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
>   
> +The ethdev layer supports below build options for debug purpose:
> +
> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
> +
> +  Build with debug code on Rx path.
> +
> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
> +
> +  Build with debug code on Tx path.
> +
> +.. Note::
> +
> +   The ethdev library use above options to wrap debug code to trace invalid parameters
> +   on data path APIs, so performance downgrade is expected when enabling those options.
> +   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.
> +

Following drivers are other users of the PMD specific compile flag for the Rx/Tx 
datapath debug logs [1], maintainers of those PMDs cc'ed, can you please plan 
switching to the RTE_ETHDEV_DEBUG_RX / RTE_ETHDEV_DEBUG_TX macros?

[1]:
- bnx2x:  RTE_LIBRTE_BNX2X_DEBUG_RX / RTE_LIBRTE_BNX2X_DEBUG_TX
- qede:   RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
- virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX / RTE_LIBRTE_VIRTIO_DEBUG_TX
- netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX / RTE_LIBRTE_NETVSC_DEBUG_TX
- avp:    RTE_LIBRTE_AVP_DEBUG_RX / RTE_LIBRTE_AVP_DEBUG_TX
- thunderx: RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX / 			
		RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX
- vmxnet3: RTE_LIBRTE_VMXNET3_DEBUG_RX / RTE_LIBRTE_VMXNET3_DEBUG_TX
- nfp:     RTE_LIBRTE_NFP_NET_DEBUG_RX / RTE_LIBRTE_NFP_NET_DEBUG_TX
- liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
- txgbe:   RTE_LIBRTE_TXGBE_DEBUG_RX / RTE_LIBRTE_TXGBE_DEBUG_TX
- ena:     RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX
  
Ferruh Yigit May 5, 2021, 11:45 a.m. UTC | #2
On 4/1/2021 3:30 PM, Ferruh Yigit wrote:
> On 3/31/2021 10:52 AM, Qi Zhang wrote:
>> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
>> data path debug code. As .config has been removed since the meson build,
>> It is not friendly for new DPDK users to notice those debug options.
>>
>> The patch introduces below build options for data path debug, so PMD
>> can choose to reuse them to avoid maintain their own.
>>
>> - RTE_ETHDEV_DEBUG_RX
>> - RTE_ETHDEV_DEBUG_TX
>>
>> All the build options are documented at programming guide
>> "3.1 Driver Option", so users can easily find them.
>>
>> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
>> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
>> compatibility.
>>
>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>> ---
>>   doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
>>   lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
>>   2 files changed, 30 insertions(+), 8 deletions(-)
>>
>> diff --git a/doc/guides/nics/build_and_test.rst
>> b/doc/guides/nics/build_and_test.rst
>> index e83dd4628c..e8b29c2277 100644
>> --- a/doc/guides/nics/build_and_test.rst
>> +++ b/doc/guides/nics/build_and_test.rst
>> @@ -26,6 +26,22 @@ This will also build testpmd.
>>   Detailed instructions are available
>>   in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
>>   +The ethdev layer supports below build options for debug purpose:
>> +
>> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
>> +
>> +  Build with debug code on Rx path.
>> +
>> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
>> +
>> +  Build with debug code on Tx path.
>> +
>> +.. Note::
>> +
>> +   The ethdev library use above options to wrap debug code to trace invalid
>> parameters
>> +   on data path APIs, so performance downgrade is expected when enabling
>> those options.
>> +   Each PMD can decide to reuse them to wrap their own debug code in the
>> Rx/Tx path.
>> +
> 
> Following drivers are other users of the PMD specific compile flag for the Rx/Tx
> datapath debug logs [1], maintainers of those PMDs cc'ed, can you please plan
> switching to the RTE_ETHDEV_DEBUG_RX / RTE_ETHDEV_DEBUG_TX macros?
> 
> [1]:
> - bnx2x:  RTE_LIBRTE_BNX2X_DEBUG_RX / RTE_LIBRTE_BNX2X_DEBUG_TX
> - qede:   RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
> - virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX / RTE_LIBRTE_VIRTIO_DEBUG_TX
> - netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX / RTE_LIBRTE_NETVSC_DEBUG_TX
> - avp:    RTE_LIBRTE_AVP_DEBUG_RX / RTE_LIBRTE_AVP_DEBUG_TX
> - thunderx: RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX /            
>         RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX
> - vmxnet3: RTE_LIBRTE_VMXNET3_DEBUG_RX / RTE_LIBRTE_VMXNET3_DEBUG_TX
> - nfp:     RTE_LIBRTE_NFP_NET_DEBUG_RX / RTE_LIBRTE_NFP_NET_DEBUG_TX
> - liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
> - txgbe:   RTE_LIBRTE_TXGBE_DEBUG_RX / RTE_LIBRTE_TXGBE_DEBUG_TX
> - ena:     RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX
> 
> 
Reminder of this one.

Can it be possible to schedule this task for v20.08?
  
Michal Krawczyk May 5, 2021, 12:21 p.m. UTC | #3
śr., 5 maj 2021 o 13:45 Ferruh Yigit <ferruh.yigit@intel.com> napisał(a):
>
> On 4/1/2021 3:30 PM, Ferruh Yigit wrote:
> > On 3/31/2021 10:52 AM, Qi Zhang wrote:
> >> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
> >> data path debug code. As .config has been removed since the meson build,
> >> It is not friendly for new DPDK users to notice those debug options.
> >>
> >> The patch introduces below build options for data path debug, so PMD
> >> can choose to reuse them to avoid maintain their own.
> >>
> >> - RTE_ETHDEV_DEBUG_RX
> >> - RTE_ETHDEV_DEBUG_TX
> >>
> >> All the build options are documented at programming guide
> >> "3.1 Driver Option", so users can easily find them.
> >>
> >> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
> >> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
> >> compatibility.
> >>
> >> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> >> ---
> >>   doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
> >>   lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
> >>   2 files changed, 30 insertions(+), 8 deletions(-)
> >>
> >> diff --git a/doc/guides/nics/build_and_test.rst
> >> b/doc/guides/nics/build_and_test.rst
> >> index e83dd4628c..e8b29c2277 100644
> >> --- a/doc/guides/nics/build_and_test.rst
> >> +++ b/doc/guides/nics/build_and_test.rst
> >> @@ -26,6 +26,22 @@ This will also build testpmd.
> >>   Detailed instructions are available
> >>   in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
> >>   +The ethdev layer supports below build options for debug purpose:
> >> +
> >> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
> >> +
> >> +  Build with debug code on Rx path.
> >> +
> >> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
> >> +
> >> +  Build with debug code on Tx path.
> >> +
> >> +.. Note::
> >> +
> >> +   The ethdev library use above options to wrap debug code to trace invalid
> >> parameters
> >> +   on data path APIs, so performance downgrade is expected when enabling
> >> those options.
> >> +   Each PMD can decide to reuse them to wrap their own debug code in the
> >> Rx/Tx path.
> >> +
> >
> > Following drivers are other users of the PMD specific compile flag for the Rx/Tx
> > datapath debug logs [1], maintainers of those PMDs cc'ed, can you please plan
> > switching to the RTE_ETHDEV_DEBUG_RX / RTE_ETHDEV_DEBUG_TX macros?
> >
> > [1]:
> > - bnx2x:  RTE_LIBRTE_BNX2X_DEBUG_RX / RTE_LIBRTE_BNX2X_DEBUG_TX
> > - qede:   RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
> > - virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX / RTE_LIBRTE_VIRTIO_DEBUG_TX
> > - netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX / RTE_LIBRTE_NETVSC_DEBUG_TX
> > - avp:    RTE_LIBRTE_AVP_DEBUG_RX / RTE_LIBRTE_AVP_DEBUG_TX
> > - thunderx: RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX /
> >         RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX
> > - vmxnet3: RTE_LIBRTE_VMXNET3_DEBUG_RX / RTE_LIBRTE_VMXNET3_DEBUG_TX
> > - nfp:     RTE_LIBRTE_NFP_NET_DEBUG_RX / RTE_LIBRTE_NFP_NET_DEBUG_TX
> > - liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
> > - txgbe:   RTE_LIBRTE_TXGBE_DEBUG_RX / RTE_LIBRTE_TXGBE_DEBUG_TX
> > - ena:     RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX
> >
> >
> Reminder of this one.
>
> Can it be possible to schedule this task for v20.08?

Hi Ferruh,

we'll schedule this task for v20.08 for the ENA PMD.

Thanks,
Michal
  
Ferruh Yigit May 5, 2021, 2:38 p.m. UTC | #4
On 5/5/2021 1:21 PM, Michał Krawczyk wrote:
> śr., 5 maj 2021 o 13:45 Ferruh Yigit <ferruh.yigit@intel.com> napisał(a):
>>
>> On 4/1/2021 3:30 PM, Ferruh Yigit wrote:
>>> On 3/31/2021 10:52 AM, Qi Zhang wrote:
>>>> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option to wrap
>>>> data path debug code. As .config has been removed since the meson build,
>>>> It is not friendly for new DPDK users to notice those debug options.
>>>>
>>>> The patch introduces below build options for data path debug, so PMD
>>>> can choose to reuse them to avoid maintain their own.
>>>>
>>>> - RTE_ETHDEV_DEBUG_RX
>>>> - RTE_ETHDEV_DEBUG_TX
>>>>
>>>> All the build options are documented at programming guide
>>>> "3.1 Driver Option", so users can easily find them.
>>>>
>>>> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
>>>> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for backward
>>>> compatibility.
>>>>
>>>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>>>> ---
>>>>   doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
>>>>   lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
>>>>   2 files changed, 30 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/doc/guides/nics/build_and_test.rst
>>>> b/doc/guides/nics/build_and_test.rst
>>>> index e83dd4628c..e8b29c2277 100644
>>>> --- a/doc/guides/nics/build_and_test.rst
>>>> +++ b/doc/guides/nics/build_and_test.rst
>>>> @@ -26,6 +26,22 @@ This will also build testpmd.
>>>>   Detailed instructions are available
>>>>   in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
>>>>   +The ethdev layer supports below build options for debug purpose:
>>>> +
>>>> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
>>>> +
>>>> +  Build with debug code on Rx path.
>>>> +
>>>> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
>>>> +
>>>> +  Build with debug code on Tx path.
>>>> +
>>>> +.. Note::
>>>> +
>>>> +   The ethdev library use above options to wrap debug code to trace invalid
>>>> parameters
>>>> +   on data path APIs, so performance downgrade is expected when enabling
>>>> those options.
>>>> +   Each PMD can decide to reuse them to wrap their own debug code in the
>>>> Rx/Tx path.
>>>> +
>>>
>>> Following drivers are other users of the PMD specific compile flag for the Rx/Tx
>>> datapath debug logs [1], maintainers of those PMDs cc'ed, can you please plan
>>> switching to the RTE_ETHDEV_DEBUG_RX / RTE_ETHDEV_DEBUG_TX macros?
>>>
>>> [1]:
>>> - bnx2x:  RTE_LIBRTE_BNX2X_DEBUG_RX / RTE_LIBRTE_BNX2X_DEBUG_TX
>>> - qede:   RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
>>> - virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX / RTE_LIBRTE_VIRTIO_DEBUG_TX
>>> - netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX / RTE_LIBRTE_NETVSC_DEBUG_TX
>>> - avp:    RTE_LIBRTE_AVP_DEBUG_RX / RTE_LIBRTE_AVP_DEBUG_TX
>>> - thunderx: RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX /
>>>         RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX
>>> - vmxnet3: RTE_LIBRTE_VMXNET3_DEBUG_RX / RTE_LIBRTE_VMXNET3_DEBUG_TX
>>> - nfp:     RTE_LIBRTE_NFP_NET_DEBUG_RX / RTE_LIBRTE_NFP_NET_DEBUG_TX
>>> - liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
>>> - txgbe:   RTE_LIBRTE_TXGBE_DEBUG_RX / RTE_LIBRTE_TXGBE_DEBUG_TX
>>> - ena:     RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX
>>>
>>>
>> Reminder of this one.
>>
>> Can it be possible to schedule this task for v20.08?
> 
> Hi Ferruh,
> 
> we'll schedule this task for v20.08 for the ENA PMD.
> 

Oops, I mean v21.08 obviously.
  
Rasesh Mody May 6, 2021, 11:09 a.m. UTC | #5
> From: dev <dev-bounces@dpdk.org> On Behalf Of Ferruh Yigit
> Sent: Wednesday, May 5, 2021 8:09 PM
> 
> On 5/5/2021 1:21 PM, Michał Krawczyk wrote:
> > śr., 5 maj 2021 o 13:45 Ferruh Yigit <ferruh.yigit@intel.com> napisał(a):
> >>
> >> On 4/1/2021 3:30 PM, Ferruh Yigit wrote:
> >>> On 3/31/2021 10:52 AM, Qi Zhang wrote:
> >>>> PMDs use RTE_LIBRTE_<PMD_NAME>_DEBUG_RX|TX as build option
> to wrap
> >>>> data path debug code. As .config has been removed since the meson
> >>>> build, It is not friendly for new DPDK users to notice those debug
> options.
> >>>>
> >>>> The patch introduces below build options for data path debug, so
> >>>> PMD can choose to reuse them to avoid maintain their own.
> >>>>
> >>>> - RTE_ETHDEV_DEBUG_RX
> >>>> - RTE_ETHDEV_DEBUG_TX
> >>>>
> >>>> All the build options are documented at programming guide
> >>>> "3.1 Driver Option", so users can easily find them.
> >>>>
> >>>> The original undocumented RTE_LIBRTE_ETHDEV_DEBUG will alias to
> >>>> both RTE_ETHDEV_DEBUG_RX and RTE_ETHDEV_DEBUG_TX for
> backward
> >>>> compatibility.
> >>>>
> >>>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
> >>>> ---
> >>>>   doc/guides/nics/build_and_test.rst | 16 ++++++++++++++++
> >>>>   lib/librte_ethdev/rte_ethdev.h     | 22 ++++++++++++++--------
> >>>>   2 files changed, 30 insertions(+), 8 deletions(-)
> >>>>
> >>>> diff --git a/doc/guides/nics/build_and_test.rst
> >>>> b/doc/guides/nics/build_and_test.rst
> >>>> index e83dd4628c..e8b29c2277 100644
> >>>> --- a/doc/guides/nics/build_and_test.rst
> >>>> +++ b/doc/guides/nics/build_and_test.rst
> >>>> @@ -26,6 +26,22 @@ This will also build testpmd.
> >>>>   Detailed instructions are available
> >>>>   in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
> >>>>   +The ethdev layer supports below build options for debug purpose:
> >>>> +
> >>>> +- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
> >>>> +
> >>>> +  Build with debug code on Rx path.
> >>>> +
> >>>> +- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
> >>>> +
> >>>> +  Build with debug code on Tx path.
> >>>> +
> >>>> +.. Note::
> >>>> +
> >>>> +   The ethdev library use above options to wrap debug code to
> >>>> + trace invalid
> >>>> parameters
> >>>> +   on data path APIs, so performance downgrade is expected when
> >>>> + enabling
> >>>> those options.
> >>>> +   Each PMD can decide to reuse them to wrap their own debug code
> >>>> + in the
> >>>> Rx/Tx path.
> >>>> +
> >>>
> >>> Following drivers are other users of the PMD specific compile flag
> >>> for the Rx/Tx datapath debug logs [1], maintainers of those PMDs
> >>> cc'ed, can you please plan switching to the RTE_ETHDEV_DEBUG_RX /
> RTE_ETHDEV_DEBUG_TX macros?
> >>>
> >>> [1]:
> >>> - bnx2x:  RTE_LIBRTE_BNX2X_DEBUG_RX /
> RTE_LIBRTE_BNX2X_DEBUG_TX
> >>> - qede:   RTE_LIBRTE_QEDE_DEBUG_RX / RTE_LIBRTE_QEDE_DEBUG_TX
> >>> - virtio: RTE_LIBRTE_VIRTIO_DEBUG_RX /
> RTE_LIBRTE_VIRTIO_DEBUG_TX
> >>> - netvsc: RTE_LIBRTE_NETVSC_DEBUG_RX /
> RTE_LIBRTE_NETVSC_DEBUG_TX
> >>> - avp:    RTE_LIBRTE_AVP_DEBUG_RX / RTE_LIBRTE_AVP_DEBUG_TX
> >>> - thunderx: RTE_LIBRTE_THUNDERX_NICVF_DEBUG_RX /
> >>>         RTE_LIBRTE_THUNDERX_NICVF_DEBUG_TX
> >>> - vmxnet3: RTE_LIBRTE_VMXNET3_DEBUG_RX /
> RTE_LIBRTE_VMXNET3_DEBUG_TX
> >>> - nfp:     RTE_LIBRTE_NFP_NET_DEBUG_RX /
> RTE_LIBRTE_NFP_NET_DEBUG_TX
> >>> - liquidio: RTE_LIBRTE_LIO_DEBUG_RX / RTE_LIBRTE_LIO_DEBUG_TX
> >>> - txgbe:   RTE_LIBRTE_TXGBE_DEBUG_RX /
> RTE_LIBRTE_TXGBE_DEBUG_TX
> >>> - ena:     RTE_LIBRTE_ENA_DEBUG_RX / RTE_LIBRTE_ENA_DEBUG_TX
> >>>
> >>>
> >> Reminder of this one.
> >>
> >> Can it be possible to schedule this task for v20.08?
> >
> > Hi Ferruh,
> >
> > we'll schedule this task for v20.08 for the ENA PMD.
> >
> 
> Oops, I mean v21.08 obviously.
>

Hi Ferruh,
For bnx2x and qede PMD, we can schedule this for v21.08.
Thanks,
Rasesh
  

Patch

diff --git a/doc/guides/nics/build_and_test.rst b/doc/guides/nics/build_and_test.rst
index e83dd4628c..e8b29c2277 100644
--- a/doc/guides/nics/build_and_test.rst
+++ b/doc/guides/nics/build_and_test.rst
@@ -26,6 +26,22 @@  This will also build testpmd.
 Detailed instructions are available
 in the :doc:`meson build guide <../prog_guide/build-sdk-meson>`.
 
+The ethdev layer supports below build options for debug purpose:
+
+- ``RTE_ETHDEV_DEBUG_RX`` (default **disabled**)
+
+  Build with debug code on Rx path.
+
+- ``RTE_ETHDEV_DEBUG_TX`` (default **disabled**)
+
+  Build with debug code on Tx path.
+
+.. Note::
+
+   The ethdev library use above options to wrap debug code to trace invalid parameters
+   on data path APIs, so performance downgrade is expected when enabling those options.
+   Each PMD can decide to reuse them to wrap their own debug code in the Rx/Tx path.
+
 Running testpmd in Linux
 ------------------------
 
diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
index efda3137f7..6c7c72890f 100644
--- a/lib/librte_ethdev/rte_ethdev.h
+++ b/lib/librte_ethdev/rte_ethdev.h
@@ -148,6 +148,12 @@  extern "C" {
 /* Use this macro to check if LRO API is supported */
 #define RTE_ETHDEV_HAS_LRO_SUPPORT
 
+/* Alias RTE_LIBRTE_ETHDEV_DEBUG for backward compatibility. */
+#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#define RTE_ETHDEV_DEBUG_RX
+#define RTE_ETHDEV_DEBUG_TX
+#endif
+
 #include <rte_compat.h>
 #include <rte_log.h>
 #include <rte_interrupts.h>
@@ -4941,7 +4947,7 @@  rte_eth_rx_burst(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 	uint16_t nb_rx;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_RX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->rx_pkt_burst, 0);
 
@@ -5075,11 +5081,11 @@  rte_eth_rx_descriptor_status(uint16_t port_id, uint16_t queue_id,
 	struct rte_eth_dev *dev;
 	void *rxq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_RX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_RX
 	if (queue_id >= dev->data->nb_rx_queues)
 		return -ENODEV;
 #endif
@@ -5132,11 +5138,11 @@  static inline int rte_eth_tx_descriptor_status(uint16_t port_id,
 	struct rte_eth_dev *dev;
 	void *txq;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
 #endif
 	dev = &rte_eth_devices[port_id];
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	if (queue_id >= dev->data->nb_tx_queues)
 		return -ENODEV;
 #endif
@@ -5218,7 +5224,7 @@  rte_eth_tx_burst(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, 0);
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->tx_pkt_burst, 0);
 
@@ -5316,7 +5322,7 @@  rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 {
 	struct rte_eth_dev *dev;
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	if (!rte_eth_dev_is_valid_port(port_id)) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX port_id=%u\n", port_id);
 		rte_errno = ENODEV;
@@ -5326,7 +5332,7 @@  rte_eth_tx_prepare(uint16_t port_id, uint16_t queue_id,
 
 	dev = &rte_eth_devices[port_id];
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 	if (queue_id >= dev->data->nb_tx_queues) {
 		RTE_ETHDEV_LOG(ERR, "Invalid TX queue_id=%u\n", queue_id);
 		rte_errno = EINVAL;