Skip to contentSkip to conversation

net/ark: fix meson build

PATCH In review Ed Czeck 3 participants 27 messages Aug 19, 2020 – Sep 9, 2020

Subsystems (2)
lore
Share & tools
lore

Ed Czeck

author
#0 lore raw

PATCH 1/1 net/ark: fix meson build

* Set RTE_LIBRTE_ARK_PAD_TX in local meson.build to match the CONFIG_RTE_LIBRTE_ARK_PAD_TX setting used in make.
* Install header file needed for dynamic library.

---
 drivers/net/ark/meson.build | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ark/meson.build +3 -0
index 99151bba1..6840bc622 100644
@@ -11,3 +11,6 @@ sources = files('ark_ddm.c',
 	'ark_pktgen.c',
 	'ark_rqp.c',
 	'ark_udm.c')
+
+install_headers('ark_ext.h')
+cflags += '-DRTE_LIBRTE_ARK_PAD_TX'
Signature · 1 line
2.17.1
#1 lore raw
Quoted 15 lines · Ed Czeck

* Set RTE_LIBRTE_ARK_PAD_TX in local meson.build to match the CONFIG_RTE_LIBRTE_ARK_PAD_TX setting used in make.
* Install header file needed for dynamic library.

---
 drivers/net/ark/meson.build | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/ark/meson.build +0 -0
index 99151bba1..6840bc622 100644

drivers/net/ark/meson.build sources = files('ark_ddm.c', · line 16

Quoted 6 lines
drivers/net/ark/meson.build +3 -0
@@ -11,3 +11,6 @@ sources = files('ark_ddm.c',
 	'ark_pktgen.c',
 	'ark_rqp.c',
 	'ark_udm.c')
+
+install_headers('ark_ext.h')
+cflags += '-DRTE_LIBRTE_ARK_PAD_TX'

Hi Ed,

Why not remove the 'RTE_LIBRTE_ARK_PAD_TX' completely, this is a good opportunity for it. In meson it is not really a config option as it is.

This can be default option or can be converted into runtime config. For runtime config it can be a devarg, but since it is in Tx data path, if you don't want additional condition perhaps defining this as an alternative Tx burst function can work.

author
#2 lore raw

PATCH 1/1 net/ark: fix meson build

In reply to Ed Czeck

* Rename net/ark specific CONFIG_RTE macros to local macros.
* Change condition of ARK_PAD_TX to match behavior of meson build to makefile build.
* Install header file needed for dynamic library.
* Update doc as required.

---
 doc/guides/nics/ark.rst     | 24 ++++++++++++++----------
 drivers/net/ark/ark_logs.h  | 16 +++++++---------
 drivers/net/ark/meson.build |  2 ++
 3 files changed, 23 insertions(+), 19 deletions(-)
doc/guides/nics/ark.rst +14 -10
index 06e8c3374..4d8920cd0 100644
@@ -124,27 +124,31 @@ Configuration Information
 
 **DPDK Configuration Parameters**
 
-  The following configuration options are available for the ARK PMD:
+  The following compile-time configuration options are available for the ARK PMD:
 
-   * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
-     of the ARK PMD driver in the DPDK compilation.
+   * **ARK_NOPAD_TX**:  When enabled TX
+     packets are not padded to 60 bytes to support downstream MACS.
 
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
+   * **ARK_DEBUG_RX**: Enables debug
      logging and internal checking of RX ingress logic within the ARK PMD driver.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
+   * **ARK_DEBUG_TX**: Enables debug
      logging and internal checking of TX egress logic within the ARK PMD driver.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
+   * **ARK_DEBUG_STATS**: Enables debug
      logging of detailed packet and performance statistics gathered in
      the PMD and FPGA.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
+   * **ARK_DEBUG_TRACE**: Enables debug
      logging of detailed PMD events and status.
 
+Note that enabling debugging options may affect system performance.
+These options may be set by specifying them in CFLAG
+environment before the meson build set.   E.g.::
+
+    export CFLAGS="-DARK_DEBUG_TRACE"
+    meson build
+
 
 Building DPDK
 -------------
drivers/net/ark/ark_logs.h +7 -9
index 44aac6102..125583475 100644
@@ -6,14 +6,12 @@
 #define _ARK_DEBUG_H_
 
 #include <inttypes.h>
-#include <rte_log.h>
-
 
 /* Configuration option to pad TX packets to 60 bytes */
-#ifdef RTE_LIBRTE_ARK_PAD_TX
-#define ARK_TX_PAD_TO_60   1
-#else
+#ifdef ARK_NOPAD_TX
 #define ARK_TX_PAD_TO_60   0
+#else
+#define ARK_TX_PAD_TO_60   1
 #endif
 
 /* system camel case definition changed to upper case */
@@ -55,7 +53,7 @@ extern int ark_logtype;
 
 
 /* Debug macro for tracing full behavior, function tracing and messages*/
-#ifdef RTE_LIBRTE_ARK_DEBUG_TRACE
+#ifdef ARK_DEBUG_TRACE
 #define PMD_FUNC_LOG(level, fmt, ...) ARK_FUNC_ON(level, fmt, ##__VA_ARGS__)
 #define PMD_DEBUG_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
 #else
@@ -65,7 +63,7 @@ extern int ark_logtype;
 
 
 /* Debug macro for reporting FPGA statistics */
-#ifdef RTE_LIBRTE_ARK_DEBUG_STATS
+#ifdef ARK_DEBUG_STATS
 #define PMD_STATS_LOG(level, fmt, ...) ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
 #else
 #define PMD_STATS_LOG(level, fmt, ...)  ARK_TRACE_OFF(level, fmt, ##__VA_ARGS__)
@@ -73,7 +71,7 @@ extern int ark_logtype;
 
 
 /* Debug macro for RX path */
-#ifdef RTE_LIBRTE_ARK_DEBUG_RX
+#ifdef ARK_DEBUG_RX
 #define ARK_RX_DEBUG 1
 #define PMD_RX_LOG(level, fmt, ...)  ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
 #else
@@ -82,7 +80,7 @@ extern int ark_logtype;
 #endif
 
 /* Debug macro for TX path */
-#ifdef RTE_LIBRTE_ARK_DEBUG_TX
+#ifdef ARK_DEBUG_TX
 #define ARK_TX_DEBUG       1
 #define PMD_TX_LOG(level, fmt, ...)  ARK_TRACE_ON(level, fmt, ##__VA_ARGS__)
 #else
drivers/net/ark/meson.build +2 -0
index 99151bba1..fbbc085bb 100644
@@ -11,3 +11,5 @@ sources = files('ark_ddm.c',
 	'ark_pktgen.c',
 	'ark_rqp.c',
 	'ark_udm.c')
+
+install_headers('ark_ext.h')
Signature · 1 line
2.17.1
#3 lore raw
Quoted 38 lines · Ed Czeck

* Rename net/ark specific CONFIG_RTE macros to local macros.
* Change condition of ARK_PAD_TX to match behavior of meson build to makefile build.
* Install header file needed for dynamic library.
* Update doc as required.

---
 doc/guides/nics/ark.rst     | 24 ++++++++++++++----------
 drivers/net/ark/ark_logs.h  | 16 +++++++---------
 drivers/net/ark/meson.build |  2 ++
 3 files changed, 23 insertions(+), 19 deletions(-)
doc/guides/nics/ark.rst +5 -8
index 06e8c3374..4d8920cd0 100644
@@ -124,27 +124,31 @@ Configuration Information
 
 **DPDK Configuration Parameters**
 
-  The following configuration options are available for the ARK PMD:
+  The following compile-time configuration options are available for the ARK PMD:
 
-   * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
-     of the ARK PMD driver in the DPDK compilation.
+   * **ARK_NOPAD_TX**:  When enabled TX
+     packets are not padded to 60 bytes to support downstream MACS.
 
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
+   * **ARK_DEBUG_RX**: Enables debug
      logging and internal checking of RX ingress logic within the ARK PMD driver.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
+   * **ARK_DEBUG_TX**: Enables debug

doc/guides/nics/ark.rst Configuration Information · line 143

Quoted 10 lines
doc/guides/nics/ark.rst +2 -2
      logging and internal checking of TX egress logic within the ARK PMD driver.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
+   * **ARK_DEBUG_STATS**: Enables debug
      logging of detailed packet and performance statistics gathered in
      the PMD and FPGA.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
+   * **ARK_DEBUG_TRACE**: Enables debug
      logging of detailed PMD events and status.

Logging can be controlled in runtime, that is what we should use. In data path, we use compile time flags because of the performance issues. So OK to have 'CONFIG_RTE_LIBRTE_ARK_DEBUG_RX' & 'CONFIG_RTE_LIBRTE_ARK_DEBUG_TX' as compile time flag, but why having compile time flag for rest?

doc/guides/nics/ark.rst Configuration Information · line 151

Quoted 8 lines
doc/guides/nics/ark.rst +7 -0
+Note that enabling debugging options may affect system performance.
+These options may be set by specifying them in CFLAG
+environment before the meson build set.   E.g.::
+
+    export CFLAGS="-DARK_DEBUG_TRACE"
+    meson build
+

When you passed the flag as above, it is still global to all components in the DPDK, this is not just for ark. What is the motivation to remove the "RET_LIBRTE_" prefix?

Quoted 13 lines
doc/guides/nics/ark.rst +0 -0
 Building DPDK
 -------------
drivers/net/ark/ark_logs.h +0 -2
index 44aac6102..125583475 100644
@@ -6,14 +6,12 @@
 #define _ARK_DEBUG_H_
 
 #include <inttypes.h>
-#include <rte_log.h>
-

drivers/net/ark/ark_logs.h line 15

Quoted 10 lines
drivers/net/ark/ark_logs.h +3 -3
 
 /* Configuration option to pad TX packets to 60 bytes */
-#ifdef RTE_LIBRTE_ARK_PAD_TX
-#define ARK_TX_PAD_TO_60   1
-#else
+#ifdef ARK_NOPAD_TX
 #define ARK_TX_PAD_TO_60   0
+#else
+#define ARK_TX_PAD_TO_60   1
 #endif

So you don't want to convert this to runtime configuration.

The point we are reducing compile time flags:
1) It forks the code paths and by time it leave not tested, even not compiled code paths which may cause rotten code by time.

2) Multiple code paths will lead deployment problems. When you deploy an application, you won't able to change the compile time configuration in customer environment and need to re-compile (most probably re-test) and re-deploy it. Also there is not easy way to figure out from binary in customer environment that with which compile time flags it has been built.

Switching to CFLAGS="..." doesn't make above concerns go away and indeed it makes (1) worst since hides the config options within the driver. Previously it was possible to trigger each config option and do testing using scripts, now since config options are hidden in driver we can't do even that.

Can you please detail why "ARK_TX_PAD_TO_60" is needed exactly? And can you please justify why it has to be compile time config option?

<...>

drivers/net/ark/ark_logs.h sources = files('ark_ddm.c', · line 15

Quoted 7 lines
drivers/net/ark/ark_logs.h +2 -0
@@ -11,3 +11,5 @@ sources = files('ark_ddm.c',
 	'ark_pktgen.c',
 	'ark_rqp.c',
 	'ark_udm.c')
+
+install_headers('ark_ext.h')

Installing PMD header file is not required but this has an unique usage.

Ark PMD is wrapper to the external shared library which should implement the functions that has prototypes in the 'ark_ext.h'.

Since this header is not needed by users of the dpdk library, but needed by extension developers for the ark PMD, I think the header should not be installed.

author
#4 lore raw
Quoted 1 line · Ferruh Yigit

...

Quoted 5 lines

Logging can be controlled in runtime, that is what we should use. In data path, we use compile time flags because of the performance issues. So OK to have 'CONFIG_RTE_LIBRTE_ARK_DEBUG_RX' & 'CONFIG_RTE_LIBRTE_ARK_DEBUG_TX' as compile time flag, but why having compile time flag for rest?

Agreed. We'll remove most of these macro in the next commit pushing the behavior
into run-time log control.

Quoted 12 lines

doc/guides/nics/ark.rst Configuration Information · line 151

Quoted 8 lines
doc/guides/nics/ark.rst +7 -0
+Note that enabling debugging options may affect system performance.
+These options may be set by specifying them in CFLAG
+environment before the meson build set.   E.g.::
+
+    export CFLAGS="-DARK_DEBUG_TRACE"
+    meson build
+

When you passed the flag as above, it is still global to all components in the DPDK, this is not just for ark. What is the motivation to remove the "RET_LIBRTE_" prefix?

There are 2 issues here.
1) With the makefile flow, users could add other configurations with the documented
and recommended sed commands. I.e.,
sed -ri 's/(CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE)=n/\1=y/' build/.config The makefiles took care of everything from there. This no longer works with the meson build flow. The solution is to set that macro passing it in the CFLAG environment.
We're open to other recommendations.
2) Is there an advantage of promoting a PMD macro to a global macro? It seems to add to the noise of dpdk configuration and there are many PMD specific macros throughout the code base.

Quoted 37 lines
Quoted 14 lines

Building DPDK
-------------

drivers/net/ark/ark_logs.h +0 -2
index 44aac6102..125583475 100644
@@ -6,14 +6,12 @@
 #define _ARK_DEBUG_H_
 
 #include <inttypes.h>
-#include <rte_log.h>
-

drivers/net/ark/ark_logs.h line 15

Quoted 10 lines
drivers/net/ark/ark_logs.h +3 -3
 
 /* Configuration option to pad TX packets to 60 bytes */
-#ifdef RTE_LIBRTE_ARK_PAD_TX
-#define ARK_TX_PAD_TO_60   1
-#else
+#ifdef ARK_NOPAD_TX
 #define ARK_TX_PAD_TO_60   0
+#else
+#define ARK_TX_PAD_TO_60   1
 #endif

So you don't want to convert this to runtime configuration.

The point we are reducing compile time flags:
1) It forks the code paths and by time it leave not tested, even not compiled code paths which may cause rotten code by time.

2) Multiple code paths will lead deployment problems. When you deploy an application, you won't able to change the compile time configuration in customer environment and need to re-compile (most probably re-test) and re-deploy it. Also there is not easy way to figure out from binary in customer environment that with which compile time flags it has been built.

Quoted 8 lines

Switching to CFLAGS="..." doesn't make above concerns go away and indeed it makes (1) worst since hides the config options within the driver. Previously it was possible to trigger each config option and do testing using scripts, now since config options are hidden in driver we can't do even that.

Can you please detail why "ARK_TX_PAD_TO_60" is needed exactly? And can you please justify why it has to be compile time config option?

The need to pad packets is dependent on the underlying FPGA hardware implementation which lies outside the control of our deliverables. Thus we leave control up to our customer and how they deliver and deploy DPDK. This needs to be a compile-time macro since the code executes within the per-packet processing under rte_eth_tx_burst().

We can change the macro to ARK_MIN_TX_PKTLEN, which should have zero overhead when set to 0. (I'm assuming that compiles will remove if (unsigned < 0) blocks.) Should this be an RTE_LIBRTE macro? How does a user change this during compile?

Quoted 12 lines

<...>

drivers/net/ark/ark_logs.h sources = files('ark_ddm.c', · line 15

Quoted 7 lines
drivers/net/ark/ark_logs.h +2 -0
@@ -11,3 +11,5 @@ sources = files('ark_ddm.c',
      'ark_pktgen.c',
      'ark_rqp.c',
      'ark_udm.c')
+
+install_headers('ark_ext.h')

Installing PMD header file is not required but this has an unique usage.

Quoted 5 lines

Ark PMD is wrapper to the external shared library which should implement the functions that has prototypes in the 'ark_ext.h'.

Since this header is not needed by users of the dpdk library, but needed by extension developers for the ark PMD, I think the header should not be installed.

So is your recommendation that anyone developing an ark pmd extension must have access to DPDK source, in addition to the installed code? It seems like one include location is better than two.

Many thanks,
Ed.

#5 lore raw
Quoted 26 lines · Ed Czeck
Quoted 1 line · Ferruh Yigit

...

Quoted 5 lines

Logging can be controlled in runtime, that is what we should use. In data path, we use compile time flags because of the performance issues. So OK to have 'CONFIG_RTE_LIBRTE_ARK_DEBUG_RX' & 'CONFIG_RTE_LIBRTE_ARK_DEBUG_TX' as compile time flag, but why having compile time flag for rest?

Agreed. We'll remove most of these macro in the next commit pushing the behavior
into run-time log control.

Quoted 12 lines

doc/guides/nics/ark.rst Configuration Information · line 151

Quoted 8 lines
doc/guides/nics/ark.rst +7 -0
+Note that enabling debugging options may affect system performance.
+These options may be set by specifying them in CFLAG
+environment before the meson build set.   E.g.::
+
+    export CFLAGS="-DARK_DEBUG_TRACE"
+    meson build
+

When you passed the flag as above, it is still global to all components in the DPDK, this is not just for ark. What is the motivation to remove the "RET_LIBRTE_" prefix?

Quoted 9 lines

There are 2 issues here.
1) With the makefile flow, users could add other configurations with the documented
and recommended sed commands. I.e.,
sed -ri 's/(CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE)=n/\1=y/' build/.config The makefiles took care of everything from there. This no longer works with the meson build flow. The solution is to set that macro passing it in the CFLAG environment.
We're open to other recommendations.

Yes compile time flags are harder to use with meson build system, and this is kind of intentional because of above mentioned reasons.

It is possible to add compile time option as meson config option if we must, but that is not suggested, the intention is get rid of compile time flags as much as we can, and we were already very picky to accept new compile time flags to make build for some time.

Quoted 3 lines

2) Is there an advantage of promoting a PMD macro to a global macro? It seems to add to the noise of dpdk configuration and there are many PMD specific macros throughout the code base.

If CFLAG used to pass macros to multiple components, or if there is a bigger build environment that builds both application and DPDK, CFLAGS is common flag and I think better to keep the DPDK namespace for DPDK macros. At least let me say the way that I don't see the motivation to remove the DPDK namespace from macros.

Quoted 43 lines
Quoted 43 lines
Quoted 15 lines

Building DPDK
-------------

drivers/net/ark/ark_logs.h +0 -2
index 44aac6102..125583475 100644
@@ -6,14 +6,12 @@
 #define _ARK_DEBUG_H_
 
 #include <inttypes.h>
-#include <rte_log.h>
-

drivers/net/ark/ark_logs.h line 15

Quoted 10 lines
drivers/net/ark/ark_logs.h +3 -3
 
 /* Configuration option to pad TX packets to 60 bytes */
-#ifdef RTE_LIBRTE_ARK_PAD_TX
-#define ARK_TX_PAD_TO_60   1
-#else
+#ifdef ARK_NOPAD_TX
 #define ARK_TX_PAD_TO_60   0
+#else
+#define ARK_TX_PAD_TO_60   1
 #endif

So you don't want to convert this to runtime configuration.

The point we are reducing compile time flags:
1) It forks the code paths and by time it leave not tested, even not compiled code paths which may cause rotten code by time.

2) Multiple code paths will lead deployment problems. When you deploy an application, you won't able to change the compile time configuration in customer environment and need to re-compile (most probably re-test) and re-deploy it. Also there is not easy way to figure out from binary in customer environment that with which compile time flags it has been built.

Switching to CFLAGS="..." doesn't make above concerns go away and indeed it makes (1) worst since hides the config options within the driver. Previously it was possible to trigger each config option and do testing using scripts, now since config options are hidden in driver we can't do even that.

Quoted 8 lines
Quoted 3 lines

Can you please detail why "ARK_TX_PAD_TO_60" is needed exactly? And can you please justify why it has to be compile time config option?

The need to pad packets is dependent on the underlying FPGA hardware implementation which lies outside the control of our deliverables. Thus we leave control up to our customer and how they deliver and deploy DPDK. This needs to be a compile-time macro since the code executes within the per-packet processing under rte_eth_tx_burst().

It is still possible to use runtime config by having two burst functions, one with padding and without padding support, which is selected based on provided runtime flag. Runtime parameter can provide the padding size.
But agree that adds more complexity.

Quoted 21 lines

We can change the macro to ARK_MIN_TX_PKTLEN, which should have zero overhead when set to 0. (I'm assuming that compiles will remove if (unsigned < 0) blocks.) Should this be an RTE_LIBRTE macro? How does a user change this during compile?

Quoted 15 lines

<...>

drivers/net/ark/ark_logs.h sources = files('ark_ddm.c', · line 15

Quoted 7 lines
drivers/net/ark/ark_logs.h +2 -0
@@ -11,3 +11,5 @@ sources = files('ark_ddm.c',
      'ark_pktgen.c',
      'ark_rqp.c',
      'ark_udm.c')
+
+install_headers('ark_ext.h')

Installing PMD header file is not required but this has an unique usage.

Ark PMD is wrapper to the external shared library which should implement the functions that has prototypes in the 'ark_ext.h'.

Quoted 7 lines
Quoted 2 lines

Since this header is not needed by users of the dpdk library, but needed by extension developers for the ark PMD, I think the header should not be installed.

So is your recommendation that anyone developing an ark pmd extension must have access to DPDK source, in addition to the installed code? It seems like one include location is better than two.

Yes.
I understand it makes PMD extension developer's life easy to have 'ark_ext.h' installed in system folders but I think it doesn't fit there.

DPDK public headers are for application developers to use the DPDK APIs. 'ark_ext.h' is used by PMD developer to build PMD extension which is indeed can be taken as developing DPDK internal component.

And if I understand correctly the a PMD extension is required per a bitstream for a Arkville device, so not really many developers affected from it.

(Also the name prefix and the namespace of the symbols in the header is not suitable to be a public header, but this is something else.)

author
#6 lore raw

PATCH 1/2 net/ark: remove compile time log macros in favor of run time log control

In reply to Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

---
 doc/guides/nics/ark.rst         | 13 ------
 drivers/net/ark/ark_ddm.c       | 12 ++---
 drivers/net/ark/ark_ethdev.c    | 77 +++++++++++++++------------------
 drivers/net/ark/ark_ethdev_rx.c | 46 ++++++++++----------
 drivers/net/ark/ark_ethdev_tx.c | 10 ++---
 drivers/net/ark/ark_logs.h      | 63 +++------------------------
 drivers/net/ark/ark_mpu.c       | 32 ++++----------
 drivers/net/ark/ark_pktchkr.c   | 36 +++++++--------
 drivers/net/ark/ark_pktdir.c    |  2 +-
 drivers/net/ark/ark_pktgen.c    | 22 +++++-----
 drivers/net/ark/ark_rqp.c       |  4 +-
 drivers/net/ark/ark_udm.c       | 18 ++++----
 12 files changed, 125 insertions(+), 210 deletions(-)
doc/guides/nics/ark.rst +0 -13
index 06e8c3374..c3ffcbbc2 100644
@@ -132,19 +132,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
      packets are padded to 60 bytes to support downstream MACS.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
-     logging and internal checking of RX ingress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
-     logging and internal checking of TX egress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
-     logging of detailed packet and performance statistics gathered in
-     the PMD and FPGA.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
-     logging of detailed PMD events and status.
-
 
 Building DPDK
 -------------
drivers/net/ark/ark_ddm.c +6 -6
index 57026f8d1..91d1179d8 100644
@@ -13,19 +13,19 @@ ark_ddm_verify(struct ark_ddm_t *ddm)
 {
 	uint32_t hw_const;
 	if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
-		PMD_DRV_LOG(ERR, "ARK: DDM structure looks incorrect %d vs %zd\n",
+		ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
 			    ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
 		return -1;
 	}
 
 	hw_const = ddm->cfg.const0;
 	if (hw_const == ARK_DDM_CONST1) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: DDM module is version 1, "
 			    "PMD expects version 2\n");
 		return -1;
 	} else if (hw_const != ARK_DDM_CONST2) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: DDM module not found as expected 0x%08x\n",
 			    ddm->cfg.const0);
 		return -1;
@@ -63,7 +63,7 @@ ark_ddm_reset(struct ark_ddm_t *ddm)
 	status = ark_ddm_stop(ddm, 1);
 
 	if (status != 0) {
-		PMD_DEBUG_LOG(INFO, "%s  stop failed  doing forced reset\n",
+		ARK_PMD_LOG(NOTICE, "%s  stop failed  doing forced reset\n",
 			      __func__);
 		ddm->cfg.command = 4;
 		usleep(10);
@@ -87,7 +87,7 @@ ark_ddm_stats_reset(struct ark_ddm_t *ddm)
 void
 ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
 {
-	PMD_FUNC_LOG(DEBUG, "%s Stopped: %d\n", msg,
+	ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
 		     ark_ddm_is_stopped(ddm)
 		     );
 }
@@ -97,7 +97,7 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
 {
 	struct ark_ddm_stats_t *stats = &ddm->stats;
 
-	PMD_STATS_LOG(INFO, "DDM Stats: %s"
+	ARK_PMD_LOG(INFO, "DDM Stats: %s"
 		      ARK_SU64 ARK_SU64 ARK_SU64
 		      "\n", msg,
 		      "Bytes:", stats->tx_byte_count,
drivers/net/ark/ark_ethdev.c +36 -41

285 lines not on this page · raw message

drivers/net/ark/ark_ethdev_rx.c +23 -23

152 lines not on this page · raw message

drivers/net/ark/ark_ethdev_tx.c +5 -5
index 289668774..72624deb3 100644
@@ -143,8 +143,8 @@ eth_ark_xmit_pkts(void *vtxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		}
 	}
 
-	if (ARK_TX_DEBUG && (nb != nb_pkts)) {
-		PMD_TX_LOG(DEBUG, "TX: Failure to send:"
+	if (ARK_DEBUG_CORE && nb != nb_pkts) {
+		ARK_PMD_LOG(DEBUG, "TX: Failure to send:"
 			   " req: %" PRIU32
 			   " sent: %" PRIU32
 			   " prod: %" PRIU32
@@ -214,7 +214,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 	int qidx = queue_idx;
 
 	if (!rte_is_power_of_2(nb_desc)) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "DPDK Arkville configuration queue size"
 			    " must be power of two %u (%s)\n",
 			    nb_desc, __func__);
@@ -227,7 +227,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 				   64,
 				   socket_id);
 	if (queue == 0) {
-		PMD_DRV_LOG(ERR, "Failed to allocate tx "
+		ARK_PMD_LOG(ERR, "Failed to allocate tx "
 			    "queue memory in %s\n",
 			    __func__);
 		return -ENOMEM;
@@ -252,7 +252,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 				   socket_id);
 
 	if (queue->meta_q == 0 || queue->bufs == 0) {
-		PMD_DRV_LOG(ERR, "Failed to allocate "
+		ARK_PMD_LOG(ERR, "Failed to allocate "
 			    "queue memory in %s\n", __func__);
 		rte_free(queue->meta_q);
 		rte_free(queue->bufs);
drivers/net/ark/ark_logs.h +6 -57

72 lines not on this page · raw message

drivers/net/ark/ark_mpu.c +8 -24
index 21f840f3c..8160c1de7 100644
@@ -28,7 +28,7 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
 	if ((mpu->id.idnum != 0x2055504d) ||
 	    (mpu->hw.obj_size != obj_size) ||
 	    (version != 0x00003100)) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "   MPU module not found as expected %08x"
 			    " \"%c%c%c%c %c%c%c%c\"\n",
 			    mpu->id.idnum,
@@ -36,7 +36,7 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
 			    mpu->id.id[2], mpu->id.id[3],
 			    mpu->id.ver[0], mpu->id.ver[1],
 			    mpu->id.ver[2], mpu->id.ver[3]);
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "   MPU HW num_queues: %u hw_depth %u,"
 			    " obj_size: %u, obj_per_mrr: %u"
 			    " Expected size %u\n",
@@ -95,7 +95,7 @@ ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
 	ark_mpu_reset(mpu);
 
 	if (!rte_is_power_of_2(ring_size)) {
-		PMD_DRV_LOG(ERR, "ARK: Invalid ring size for MPU %d\n",
+		ARK_PMD_LOG(ERR, "Invalid ring size for MPU %d\n",
 			    ring_size);
 		return -1;
 	}
@@ -114,37 +114,21 @@ void
 ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
 {
 	/* DUMP to see that we have started */
-	PMD_DEBUG_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
+	ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
 		      code, qid,
 		      mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
-	PMD_DEBUG_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
-		      " data 0x%08x_%08x 0x%08x_%08x\n",
+	ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
+		      "\n",
 		      code,
 		      mpu->debug.state, mpu->debug.count,
-		      mpu->debug.reserved,
-		      mpu->debug.peek[1],
-		      mpu->debug.peek[0],
-		      mpu->debug.peek[3],
-		      mpu->debug.peek[2]
-		      );
-	PMD_STATS_LOG(INFO, "MPU: %s Q: %3u"
-		      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64
-		      ARK_SU64 ARK_SU64 ARK_SU64 "\n",
-		      code, qid,
-		      "PCI Request:", mpu->stats.pci_request,
-		      "Queue_empty", mpu->stats.q_empty,
-		      "Queue_q1", mpu->stats.q_q1,
-		      "Queue_q2", mpu->stats.q_q2,
-		      "Queue_q3", mpu->stats.q_q3,
-		      "Queue_q4", mpu->stats.q_q4,
-		      "Queue_full", mpu->stats.q_full
+		      mpu->debug.reserved
 		      );
 }
 
 void
 ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t q_id)
 {
-	PMD_DEBUG_LOG(DEBUG, "MPU Setup Q: %u"
+	ARK_PMD_LOG(DEBUG, "MPU Setup Q: %u"
 		      ARK_SU64X "\n",
 		      q_id,
 		      "ring_base", mpu->cfg.ring_base
drivers/net/ark/ark_pktchkr.c +18 -18
index ef861eea3..b8fb69497 100644
@@ -85,7 +85,7 @@ ark_pktchkr_init(void *addr, int ord, int l2_mode)
 		rte_malloc("ark_pkt_chkr_inst",
 			   sizeof(struct ark_pkt_chkr_inst), 0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
 		return inst;
 	}
 	inst->sregs = (struct ark_pkt_chkr_stat_regs *)addr;
@@ -130,10 +130,10 @@ ark_pktchkr_stop(ark_pkt_chkr_t handle)
 	while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
+		ARK_PMD_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
 			      inst->ordinal);
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
 }
 
 int
@@ -189,7 +189,7 @@ ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
 	struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
 
 	if (ark_pktchkr_is_gen_forever(handle)) {
-		PMD_DEBUG_LOG(ERR, "Pktchk wait_done will not terminate"
+		ARK_PMD_LOG(NOTICE, "Pktchk wait_done will not terminate"
 			      " because gen_forever=1\n");
 		return -1;
 	}
@@ -198,10 +198,10 @@ ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
 	while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG, "Waiting for packet checker %d's"
+		ARK_PMD_LOG(DEBUG, "Waiting for packet checker %d's"
 			      " internal pktgen to finish sending...\n",
 			      inst->ordinal);
-		PMD_DEBUG_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
+		ARK_PMD_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
 			      inst->ordinal);
 	}
 	return 0;
@@ -296,25 +296,25 @@ ark_pktchkr_dump_stats(ark_pkt_chkr_t handle)
 {
 	struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
 
-	PMD_STATS_LOG(INFO, "pkts_rcvd      = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_rcvd      = (%'u)\n",
 		      inst->sregs->pkts_rcvd);
-	PMD_STATS_LOG(INFO, "bytes_rcvd     = (%'" PRIU64 ")\n",
+	ARK_PMD_LOG(INFO, "bytes_rcvd     = (%'" PRIU64 ")\n",
 		      inst->sregs->bytes_rcvd);
-	PMD_STATS_LOG(INFO, "pkts_ok        = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_ok        = (%'u)\n",
 		      inst->sregs->pkts_ok);
-	PMD_STATS_LOG(INFO, "pkts_mismatch  = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_mismatch  = (%'u)\n",
 		      inst->sregs->pkts_mismatch);
-	PMD_STATS_LOG(INFO, "pkts_err       = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_err       = (%'u)\n",
 		      inst->sregs->pkts_err);
-	PMD_STATS_LOG(INFO, "first_mismatch = (%'u)\n",
+	ARK_PMD_LOG(INFO, "first_mismatch = (%'u)\n",
 		      inst->sregs->first_mismatch);
-	PMD_STATS_LOG(INFO, "resync_events  = (%'u)\n",
+	ARK_PMD_LOG(INFO, "resync_events  = (%'u)\n",
 		      inst->sregs->resync_events);
-	PMD_STATS_LOG(INFO, "pkts_missing   = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_missing   = (%'u)\n",
 		      inst->sregs->pkts_missing);
-	PMD_STATS_LOG(INFO, "min_latency    = (%'u)\n",
+	ARK_PMD_LOG(INFO, "min_latency    = (%'u)\n",
 		      inst->sregs->min_latency);
-	PMD_STATS_LOG(INFO, "max_latency    = (%'u)\n",
+	ARK_PMD_LOG(INFO, "max_latency    = (%'u)\n",
 		      inst->sregs->max_latency);
 }
 
@@ -327,7 +327,7 @@ options(const char *id)
 		if (strcmp(id, toptions[i].opt) == 0)
 			return &toptions[i];
 	}
-	PMD_DRV_LOG(ERR,
+	ARK_PMD_LOG(ERR,
 		    "pktchkr: Could not find requested option!, option = %s\n",
 		    id);
 	return NULL;
@@ -443,7 +443,7 @@ ark_pktchkr_setup(ark_pkt_chkr_t handle)
 		ark_pktchkr_stop(handle);
 
 	if (options("run")->v.BOOL) {
-		PMD_DEBUG_LOG(DEBUG, "Starting packet checker on port %d\n",
+		ARK_PMD_LOG(DEBUG, "Starting packet checker on port %d\n",
 			      options("port")->v.INT);
 		ark_pktchkr_run(handle);
 	}
drivers/net/ark/ark_pktdir.c +1 -1
index 1f2c8182a..25e121831 100644
@@ -18,7 +18,7 @@ ark_pktdir_init(void *base)
 			   sizeof(struct ark_pkt_dir_inst),
 			   0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
 		return inst;
 	}
 	inst->regs = (struct ark_pkt_dir_regs *)base;
drivers/net/ark/ark_pktgen.c +11 -11
index 2cae252d6..4a02662a4 100644
@@ -83,7 +83,7 @@ ark_pktgen_init(void *adr, int ord, int l2_mode)
 		rte_malloc("ark_pkt_gen_inst_pmd",
 			   sizeof(struct ark_pkt_gen_inst), 0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
 		return inst;
 	}
 	inst->regs = (struct ark_pkt_gen_regs *)adr;
@@ -126,12 +126,12 @@ ark_pktgen_pause(ark_pkt_gen_t handle)
 	while (!ark_pktgen_paused(handle)) {
 		usleep(1000);
 		if (cnt++ > 100) {
-			PMD_DRV_LOG(ERR, "Pktgen %d failed to pause.\n",
+			ARK_PMD_LOG(NOTICE, "Pktgen %d failed to pause.\n",
 				    inst->ordinal);
 			break;
 		}
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
 }
 
 void
@@ -141,7 +141,7 @@ ark_pktgen_reset(ark_pkt_gen_t handle)
 
 	if (!ark_pktgen_is_running(handle) &&
 	    !ark_pktgen_paused(handle)) {
-		PMD_DEBUG_LOG(DEBUG, "Pktgen %d is not running"
+		ARK_PMD_LOG(DEBUG, "Pktgen %d is not running"
 			      " and is not paused. No need to reset.\n",
 			      inst->ordinal);
 		return;
@@ -149,13 +149,13 @@ ark_pktgen_reset(ark_pkt_gen_t handle)
 
 	if (ark_pktgen_is_running(handle) &&
 	    !ark_pktgen_paused(handle)) {
-		PMD_DEBUG_LOG(DEBUG,
+		ARK_PMD_LOG(DEBUG,
 			      "Pktgen %d is not paused. Pausing first.\n",
 			      inst->ordinal);
 		ark_pktgen_pause(handle);
 	}
 
-	PMD_DEBUG_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
 	inst->regs->pkt_start_stop = (1 << 8);
 }
 
@@ -193,17 +193,17 @@ ark_pktgen_wait_done(ark_pkt_gen_t handle)
 	int wait_cycle = 10;
 
 	if (ark_pktgen_is_gen_forever(handle))
-		PMD_DRV_LOG(ERR, "Pktgen wait_done will not terminate"
+		ARK_PMD_LOG(NOTICE, "Pktgen wait_done will not terminate"
 			    " because gen_forever=1\n");
 
 	while (!ark_pktgen_tx_done(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG,
+		ARK_PMD_LOG(DEBUG,
 			      "Waiting for pktgen %d to finish sending...\n",
 			      inst->ordinal);
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
 }
 
 uint32_t
@@ -306,7 +306,7 @@ options(const char *id)
 			return &toptions[i];
 	}
 
-	PMD_DRV_LOG(ERR,
+	ARK_PMD_LOG(ERR,
 		    "Pktgen: Could not find requested option!, "
 		    "option = %s\n",
 		    id
@@ -465,7 +465,7 @@ ark_pktgen_setup(ark_pkt_gen_t handle)
 	if (options("reset")->v.BOOL)
 		ark_pktgen_reset(handle);
 	if (options("run")->v.BOOL) {
-		PMD_DEBUG_LOG(DEBUG, "Starting packet generator on port %d\n",
+		ARK_PMD_LOG(DEBUG, "Starting packet generator on port %d\n",
 				options("port")->v.INT);
 		ark_pktgen_run(handle);
 	}
drivers/net/ark/ark_rqp.c +2 -2
index bf1af4d61..ef9ccd070 100644
@@ -23,7 +23,7 @@ void
 ark_rqp_dump(struct ark_rqpace_t *rqp)
 {
 	if (rqp->err_count_other != 0)
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
 			    ARK_SU32
 			    ARK_SU32 "\n",
@@ -31,7 +31,7 @@ ark_rqp_dump(struct ark_rqpace_t *rqp)
 			    "Error Count", rqp->err_cnt,
 			    "Error General", rqp->err_count_other);
 
-	PMD_STATS_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
+	ARK_PMD_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
 		      ARK_SU32
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
drivers/net/ark/ark_udm.c +9 -9
index 03f1922c6..a740d36d4 100644
@@ -11,14 +11,14 @@ int
 ark_udm_verify(struct ark_udm_t *udm)
 {
 	if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: UDM structure looks incorrect %d vs %zd\n",
 			    ARK_UDM_EXPECT_SIZE, sizeof(struct ark_udm_t));
 		return -1;
 	}
 
 	if (udm->setup.const0 != ARK_UDM_CONST) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: UDM module not found as expected 0x%08x\n",
 			    udm->setup.const0);
 		return -1;
@@ -49,13 +49,13 @@ ark_udm_reset(struct ark_udm_t *udm)
 
 	status = ark_udm_stop(udm, 1);
 	if (status != 0) {
-		PMD_DEBUG_LOG(INFO, "%s  stop failed  doing forced reset\n",
+		ARK_PMD_LOG(NOTICE, "%s  stop failed  doing forced reset\n",
 			      __func__);
 		udm->cfg.command = 4;
 		usleep(10);
 		udm->cfg.command = 3;
 		status = ark_udm_stop(udm, 0);
-		PMD_DEBUG_LOG(INFO, "%s  stop status %d post failure"
+		ARK_PMD_LOG(INFO, "%s  stop status %d post failure"
 			      " and forced reset\n",
 			      __func__, status);
 	} else {
@@ -125,7 +125,7 @@ ark_udm_packets(struct ark_udm_t *udm)
 void
 ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
 {
-	PMD_STATS_LOG(INFO, "UDM Stats: %s"
+	ARK_PMD_LOG(INFO, "UDM Stats: %s"
 		      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
 		      msg,
 		      "Pkts Received", udm->stats.rx_packet_count,
@@ -138,7 +138,7 @@ ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
 void
 ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
 {
-	PMD_STATS_LOG(INFO, "UDM Queue %3u Stats: %s"
+	ARK_PMD_LOG(INFO, "UDM Queue %3u Stats: %s"
 		      ARK_SU64 ARK_SU64
 		      ARK_SU64 ARK_SU64
 		      ARK_SU64 "\n",
@@ -153,14 +153,14 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
 void
 ark_udm_dump(struct ark_udm_t *udm, const char *msg)
 {
-	PMD_DEBUG_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
+	ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
 		      udm->cfg.stop_flushed);
 }
 
 void
 ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
 {
-	PMD_DEBUG_LOG(DEBUG, "UDM Setup Q: %u"
+	ARK_PMD_LOG(DEBUG, "UDM Setup Q: %u"
 		      ARK_SU64X ARK_SU32 "\n",
 		      q_id,
 		      "hw_prod_addr", udm->rt_cfg.hw_prod_addr,
@@ -172,7 +172,7 @@ ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
 {
 	struct ark_udm_pcibp_t *bp = &udm->pcibp;
 
-	PMD_STATS_LOG(INFO, "UDM Performance %s"
+	ARK_PMD_LOG(INFO, "UDM Performance %s"
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
 		      "\n",
 		      msg,
Signature · 1 line
2.17.1
author
#7 lore raw

PATCH 2/2 net/ark remove ARK_TX_PAD_TO_60 configuration macro

Update documenation as needed.

---
 doc/guides/nics/ark.rst         |  3 ---
 drivers/net/ark/ark_ethdev_tx.c | 42 ++++++++++++++++++---------------
 drivers/net/ark/ark_logs.h      |  8 -------
 3 files changed, 23 insertions(+), 30 deletions(-)
doc/guides/nics/ark.rst +0 -3
index c3ffcbbc2..0f96ebd2c 100644
@@ -129,9 +129,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
      of the ARK PMD driver in the DPDK compilation.
 
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
-
 
 Building DPDK
 -------------
drivers/net/ark/ark_ethdev_tx.c +23 -19

62 lines not on this page · raw message

drivers/net/ark/ark_logs.h +0 -8
index c3d7e7d39..ca46d86c9 100644
@@ -8,14 +8,6 @@
 #include <inttypes.h>
 #include <rte_log.h>
 
-
-/* Configuration option to pad TX packets to 60 bytes */
-#ifdef RTE_LIBRTE_ARK_PAD_TX
-#define ARK_TX_PAD_TO_60   1
-#else
-#define ARK_TX_PAD_TO_60   0
-#endif
-
 /* system camel case definition changed to upper case */
 #define PRIU32 PRIu32
 #define PRIU64 PRIu64
Signature · 1 line
2.17.1
#8 lore raw

Re: [dpdk-dev] [PATCH 2/2] net/ark remove ARK_TX_PAD_TO_60 configuration macro

Quoted 14 lines · Ed Czeck

Update documenation as needed.

---
 doc/guides/nics/ark.rst         |  3 ---
 drivers/net/ark/ark_ethdev_tx.c | 42 ++++++++++++++++++---------------
 drivers/net/ark/ark_logs.h      |  8 -------
 3 files changed, 23 insertions(+), 30 deletions(-)
doc/guides/nics/ark.rst +0 -0
index c3ffcbbc2..0f96ebd2c 100644

doc/guides/nics/ark.rst Configuration Information · line 134

Quoted 6 lines
doc/guides/nics/ark.rst +0 -3
@@ -129,9 +129,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
      of the ARK PMD driver in the DPDK compilation.
 
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
-

It may be useful to document what replaced it and how to use it:

    export CFLAGS="-DARK_MIN_TX_PKTLEN=60"
    meson build

And as mention in reply to prev version, I think better to keep 'RTE_LIBRTE_', as 'RTE_LIBRTE_ARK_MIN_TX_PKTLEN'

author
#9 lore raw

PATCH 1/2 net/ark: remove compile time log macros in favor of run time log control

In reply to Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

---
 doc/guides/nics/ark.rst         | 13 ------
 drivers/net/ark/ark_ddm.c       | 12 ++---
 drivers/net/ark/ark_ethdev.c    | 77 +++++++++++++++------------------
 drivers/net/ark/ark_ethdev_rx.c | 46 ++++++++++----------
 drivers/net/ark/ark_ethdev_tx.c | 10 ++---
 drivers/net/ark/ark_logs.h      | 63 +++------------------------
 drivers/net/ark/ark_mpu.c       | 32 ++++----------
 drivers/net/ark/ark_pktchkr.c   | 36 +++++++--------
 drivers/net/ark/ark_pktdir.c    |  2 +-
 drivers/net/ark/ark_pktgen.c    | 22 +++++-----
 drivers/net/ark/ark_rqp.c       |  4 +-
 drivers/net/ark/ark_udm.c       | 18 ++++----
 12 files changed, 125 insertions(+), 210 deletions(-)
doc/guides/nics/ark.rst +0 -13
index 06e8c3374..c3ffcbbc2 100644
@@ -132,19 +132,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
      packets are padded to 60 bytes to support downstream MACS.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
-     logging and internal checking of RX ingress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
-     logging and internal checking of TX egress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
-     logging of detailed packet and performance statistics gathered in
-     the PMD and FPGA.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
-     logging of detailed PMD events and status.
-
 
 Building DPDK
 -------------
drivers/net/ark/ark_ddm.c +6 -6
index 57026f8d1..91d1179d8 100644
@@ -13,19 +13,19 @@ ark_ddm_verify(struct ark_ddm_t *ddm)
 {
 	uint32_t hw_const;
 	if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
-		PMD_DRV_LOG(ERR, "ARK: DDM structure looks incorrect %d vs %zd\n",
+		ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
 			    ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
 		return -1;
 	}
 
 	hw_const = ddm->cfg.const0;
 	if (hw_const == ARK_DDM_CONST1) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: DDM module is version 1, "
 			    "PMD expects version 2\n");
 		return -1;
 	} else if (hw_const != ARK_DDM_CONST2) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: DDM module not found as expected 0x%08x\n",
 			    ddm->cfg.const0);
 		return -1;
@@ -63,7 +63,7 @@ ark_ddm_reset(struct ark_ddm_t *ddm)
 	status = ark_ddm_stop(ddm, 1);
 
 	if (status != 0) {
-		PMD_DEBUG_LOG(INFO, "%s  stop failed  doing forced reset\n",
+		ARK_PMD_LOG(NOTICE, "%s  stop failed  doing forced reset\n",
 			      __func__);
 		ddm->cfg.command = 4;
 		usleep(10);
@@ -87,7 +87,7 @@ ark_ddm_stats_reset(struct ark_ddm_t *ddm)
 void
 ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
 {
-	PMD_FUNC_LOG(DEBUG, "%s Stopped: %d\n", msg,
+	ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
 		     ark_ddm_is_stopped(ddm)
 		     );
 }
@@ -97,7 +97,7 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
 {
 	struct ark_ddm_stats_t *stats = &ddm->stats;
 
-	PMD_STATS_LOG(INFO, "DDM Stats: %s"
+	ARK_PMD_LOG(INFO, "DDM Stats: %s"
 		      ARK_SU64 ARK_SU64 ARK_SU64
 		      "\n", msg,
 		      "Bytes:", stats->tx_byte_count,
drivers/net/ark/ark_ethdev.c +36 -41

285 lines not on this page · raw message

drivers/net/ark/ark_ethdev_rx.c +23 -23

152 lines not on this page · raw message

drivers/net/ark/ark_ethdev_tx.c +5 -5
index 289668774..72624deb3 100644
@@ -143,8 +143,8 @@ eth_ark_xmit_pkts(void *vtxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		}
 	}
 
-	if (ARK_TX_DEBUG && (nb != nb_pkts)) {
-		PMD_TX_LOG(DEBUG, "TX: Failure to send:"
+	if (ARK_DEBUG_CORE && nb != nb_pkts) {
+		ARK_PMD_LOG(DEBUG, "TX: Failure to send:"
 			   " req: %" PRIU32
 			   " sent: %" PRIU32
 			   " prod: %" PRIU32
@@ -214,7 +214,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 	int qidx = queue_idx;
 
 	if (!rte_is_power_of_2(nb_desc)) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "DPDK Arkville configuration queue size"
 			    " must be power of two %u (%s)\n",
 			    nb_desc, __func__);
@@ -227,7 +227,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 				   64,
 				   socket_id);
 	if (queue == 0) {
-		PMD_DRV_LOG(ERR, "Failed to allocate tx "
+		ARK_PMD_LOG(ERR, "Failed to allocate tx "
 			    "queue memory in %s\n",
 			    __func__);
 		return -ENOMEM;
@@ -252,7 +252,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 				   socket_id);
 
 	if (queue->meta_q == 0 || queue->bufs == 0) {
-		PMD_DRV_LOG(ERR, "Failed to allocate "
+		ARK_PMD_LOG(ERR, "Failed to allocate "
 			    "queue memory in %s\n", __func__);
 		rte_free(queue->meta_q);
 		rte_free(queue->bufs);
drivers/net/ark/ark_logs.h +6 -57

72 lines not on this page · raw message

drivers/net/ark/ark_mpu.c +8 -24
index 21f840f3c..8160c1de7 100644
@@ -28,7 +28,7 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
 	if ((mpu->id.idnum != 0x2055504d) ||
 	    (mpu->hw.obj_size != obj_size) ||
 	    (version != 0x00003100)) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "   MPU module not found as expected %08x"
 			    " \"%c%c%c%c %c%c%c%c\"\n",
 			    mpu->id.idnum,
@@ -36,7 +36,7 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
 			    mpu->id.id[2], mpu->id.id[3],
 			    mpu->id.ver[0], mpu->id.ver[1],
 			    mpu->id.ver[2], mpu->id.ver[3]);
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "   MPU HW num_queues: %u hw_depth %u,"
 			    " obj_size: %u, obj_per_mrr: %u"
 			    " Expected size %u\n",
@@ -95,7 +95,7 @@ ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
 	ark_mpu_reset(mpu);
 
 	if (!rte_is_power_of_2(ring_size)) {
-		PMD_DRV_LOG(ERR, "ARK: Invalid ring size for MPU %d\n",
+		ARK_PMD_LOG(ERR, "Invalid ring size for MPU %d\n",
 			    ring_size);
 		return -1;
 	}
@@ -114,37 +114,21 @@ void
 ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
 {
 	/* DUMP to see that we have started */
-	PMD_DEBUG_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
+	ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
 		      code, qid,
 		      mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
-	PMD_DEBUG_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
-		      " data 0x%08x_%08x 0x%08x_%08x\n",
+	ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
+		      "\n",
 		      code,
 		      mpu->debug.state, mpu->debug.count,
-		      mpu->debug.reserved,
-		      mpu->debug.peek[1],
-		      mpu->debug.peek[0],
-		      mpu->debug.peek[3],
-		      mpu->debug.peek[2]
-		      );
-	PMD_STATS_LOG(INFO, "MPU: %s Q: %3u"
-		      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64
-		      ARK_SU64 ARK_SU64 ARK_SU64 "\n",
-		      code, qid,
-		      "PCI Request:", mpu->stats.pci_request,
-		      "Queue_empty", mpu->stats.q_empty,
-		      "Queue_q1", mpu->stats.q_q1,
-		      "Queue_q2", mpu->stats.q_q2,
-		      "Queue_q3", mpu->stats.q_q3,
-		      "Queue_q4", mpu->stats.q_q4,
-		      "Queue_full", mpu->stats.q_full
+		      mpu->debug.reserved
 		      );
 }
 
 void
 ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t q_id)
 {
-	PMD_DEBUG_LOG(DEBUG, "MPU Setup Q: %u"
+	ARK_PMD_LOG(DEBUG, "MPU Setup Q: %u"
 		      ARK_SU64X "\n",
 		      q_id,
 		      "ring_base", mpu->cfg.ring_base
drivers/net/ark/ark_pktchkr.c +18 -18
index ef861eea3..b8fb69497 100644
@@ -85,7 +85,7 @@ ark_pktchkr_init(void *addr, int ord, int l2_mode)
 		rte_malloc("ark_pkt_chkr_inst",
 			   sizeof(struct ark_pkt_chkr_inst), 0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
 		return inst;
 	}
 	inst->sregs = (struct ark_pkt_chkr_stat_regs *)addr;
@@ -130,10 +130,10 @@ ark_pktchkr_stop(ark_pkt_chkr_t handle)
 	while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
+		ARK_PMD_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
 			      inst->ordinal);
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
 }
 
 int
@@ -189,7 +189,7 @@ ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
 	struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
 
 	if (ark_pktchkr_is_gen_forever(handle)) {
-		PMD_DEBUG_LOG(ERR, "Pktchk wait_done will not terminate"
+		ARK_PMD_LOG(NOTICE, "Pktchk wait_done will not terminate"
 			      " because gen_forever=1\n");
 		return -1;
 	}
@@ -198,10 +198,10 @@ ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
 	while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG, "Waiting for packet checker %d's"
+		ARK_PMD_LOG(DEBUG, "Waiting for packet checker %d's"
 			      " internal pktgen to finish sending...\n",
 			      inst->ordinal);
-		PMD_DEBUG_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
+		ARK_PMD_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
 			      inst->ordinal);
 	}
 	return 0;
@@ -296,25 +296,25 @@ ark_pktchkr_dump_stats(ark_pkt_chkr_t handle)
 {
 	struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
 
-	PMD_STATS_LOG(INFO, "pkts_rcvd      = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_rcvd      = (%'u)\n",
 		      inst->sregs->pkts_rcvd);
-	PMD_STATS_LOG(INFO, "bytes_rcvd     = (%'" PRIU64 ")\n",
+	ARK_PMD_LOG(INFO, "bytes_rcvd     = (%'" PRIU64 ")\n",
 		      inst->sregs->bytes_rcvd);
-	PMD_STATS_LOG(INFO, "pkts_ok        = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_ok        = (%'u)\n",
 		      inst->sregs->pkts_ok);
-	PMD_STATS_LOG(INFO, "pkts_mismatch  = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_mismatch  = (%'u)\n",
 		      inst->sregs->pkts_mismatch);
-	PMD_STATS_LOG(INFO, "pkts_err       = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_err       = (%'u)\n",
 		      inst->sregs->pkts_err);
-	PMD_STATS_LOG(INFO, "first_mismatch = (%'u)\n",
+	ARK_PMD_LOG(INFO, "first_mismatch = (%'u)\n",
 		      inst->sregs->first_mismatch);
-	PMD_STATS_LOG(INFO, "resync_events  = (%'u)\n",
+	ARK_PMD_LOG(INFO, "resync_events  = (%'u)\n",
 		      inst->sregs->resync_events);
-	PMD_STATS_LOG(INFO, "pkts_missing   = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_missing   = (%'u)\n",
 		      inst->sregs->pkts_missing);
-	PMD_STATS_LOG(INFO, "min_latency    = (%'u)\n",
+	ARK_PMD_LOG(INFO, "min_latency    = (%'u)\n",
 		      inst->sregs->min_latency);
-	PMD_STATS_LOG(INFO, "max_latency    = (%'u)\n",
+	ARK_PMD_LOG(INFO, "max_latency    = (%'u)\n",
 		      inst->sregs->max_latency);
 }
 
@@ -327,7 +327,7 @@ options(const char *id)
 		if (strcmp(id, toptions[i].opt) == 0)
 			return &toptions[i];
 	}
-	PMD_DRV_LOG(ERR,
+	ARK_PMD_LOG(ERR,
 		    "pktchkr: Could not find requested option!, option = %s\n",
 		    id);
 	return NULL;
@@ -443,7 +443,7 @@ ark_pktchkr_setup(ark_pkt_chkr_t handle)
 		ark_pktchkr_stop(handle);
 
 	if (options("run")->v.BOOL) {
-		PMD_DEBUG_LOG(DEBUG, "Starting packet checker on port %d\n",
+		ARK_PMD_LOG(DEBUG, "Starting packet checker on port %d\n",
 			      options("port")->v.INT);
 		ark_pktchkr_run(handle);
 	}
drivers/net/ark/ark_pktdir.c +1 -1
index 1f2c8182a..25e121831 100644
@@ -18,7 +18,7 @@ ark_pktdir_init(void *base)
 			   sizeof(struct ark_pkt_dir_inst),
 			   0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
 		return inst;
 	}
 	inst->regs = (struct ark_pkt_dir_regs *)base;
drivers/net/ark/ark_pktgen.c +11 -11
index 2cae252d6..4a02662a4 100644
@@ -83,7 +83,7 @@ ark_pktgen_init(void *adr, int ord, int l2_mode)
 		rte_malloc("ark_pkt_gen_inst_pmd",
 			   sizeof(struct ark_pkt_gen_inst), 0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
 		return inst;
 	}
 	inst->regs = (struct ark_pkt_gen_regs *)adr;
@@ -126,12 +126,12 @@ ark_pktgen_pause(ark_pkt_gen_t handle)
 	while (!ark_pktgen_paused(handle)) {
 		usleep(1000);
 		if (cnt++ > 100) {
-			PMD_DRV_LOG(ERR, "Pktgen %d failed to pause.\n",
+			ARK_PMD_LOG(NOTICE, "Pktgen %d failed to pause.\n",
 				    inst->ordinal);
 			break;
 		}
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
 }
 
 void
@@ -141,7 +141,7 @@ ark_pktgen_reset(ark_pkt_gen_t handle)
 
 	if (!ark_pktgen_is_running(handle) &&
 	    !ark_pktgen_paused(handle)) {
-		PMD_DEBUG_LOG(DEBUG, "Pktgen %d is not running"
+		ARK_PMD_LOG(DEBUG, "Pktgen %d is not running"
 			      " and is not paused. No need to reset.\n",
 			      inst->ordinal);
 		return;
@@ -149,13 +149,13 @@ ark_pktgen_reset(ark_pkt_gen_t handle)
 
 	if (ark_pktgen_is_running(handle) &&
 	    !ark_pktgen_paused(handle)) {
-		PMD_DEBUG_LOG(DEBUG,
+		ARK_PMD_LOG(DEBUG,
 			      "Pktgen %d is not paused. Pausing first.\n",
 			      inst->ordinal);
 		ark_pktgen_pause(handle);
 	}
 
-	PMD_DEBUG_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
 	inst->regs->pkt_start_stop = (1 << 8);
 }
 
@@ -193,17 +193,17 @@ ark_pktgen_wait_done(ark_pkt_gen_t handle)
 	int wait_cycle = 10;
 
 	if (ark_pktgen_is_gen_forever(handle))
-		PMD_DRV_LOG(ERR, "Pktgen wait_done will not terminate"
+		ARK_PMD_LOG(NOTICE, "Pktgen wait_done will not terminate"
 			    " because gen_forever=1\n");
 
 	while (!ark_pktgen_tx_done(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG,
+		ARK_PMD_LOG(DEBUG,
 			      "Waiting for pktgen %d to finish sending...\n",
 			      inst->ordinal);
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
 }
 
 uint32_t
@@ -306,7 +306,7 @@ options(const char *id)
 			return &toptions[i];
 	}
 
-	PMD_DRV_LOG(ERR,
+	ARK_PMD_LOG(ERR,
 		    "Pktgen: Could not find requested option!, "
 		    "option = %s\n",
 		    id
@@ -465,7 +465,7 @@ ark_pktgen_setup(ark_pkt_gen_t handle)
 	if (options("reset")->v.BOOL)
 		ark_pktgen_reset(handle);
 	if (options("run")->v.BOOL) {
-		PMD_DEBUG_LOG(DEBUG, "Starting packet generator on port %d\n",
+		ARK_PMD_LOG(DEBUG, "Starting packet generator on port %d\n",
 				options("port")->v.INT);
 		ark_pktgen_run(handle);
 	}
drivers/net/ark/ark_rqp.c +2 -2
index bf1af4d61..ef9ccd070 100644
@@ -23,7 +23,7 @@ void
 ark_rqp_dump(struct ark_rqpace_t *rqp)
 {
 	if (rqp->err_count_other != 0)
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
 			    ARK_SU32
 			    ARK_SU32 "\n",
@@ -31,7 +31,7 @@ ark_rqp_dump(struct ark_rqpace_t *rqp)
 			    "Error Count", rqp->err_cnt,
 			    "Error General", rqp->err_count_other);
 
-	PMD_STATS_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
+	ARK_PMD_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
 		      ARK_SU32
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
drivers/net/ark/ark_udm.c +9 -9
index 03f1922c6..a740d36d4 100644
@@ -11,14 +11,14 @@ int
 ark_udm_verify(struct ark_udm_t *udm)
 {
 	if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: UDM structure looks incorrect %d vs %zd\n",
 			    ARK_UDM_EXPECT_SIZE, sizeof(struct ark_udm_t));
 		return -1;
 	}
 
 	if (udm->setup.const0 != ARK_UDM_CONST) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: UDM module not found as expected 0x%08x\n",
 			    udm->setup.const0);
 		return -1;
@@ -49,13 +49,13 @@ ark_udm_reset(struct ark_udm_t *udm)
 
 	status = ark_udm_stop(udm, 1);
 	if (status != 0) {
-		PMD_DEBUG_LOG(INFO, "%s  stop failed  doing forced reset\n",
+		ARK_PMD_LOG(NOTICE, "%s  stop failed  doing forced reset\n",
 			      __func__);
 		udm->cfg.command = 4;
 		usleep(10);
 		udm->cfg.command = 3;
 		status = ark_udm_stop(udm, 0);
-		PMD_DEBUG_LOG(INFO, "%s  stop status %d post failure"
+		ARK_PMD_LOG(INFO, "%s  stop status %d post failure"
 			      " and forced reset\n",
 			      __func__, status);
 	} else {
@@ -125,7 +125,7 @@ ark_udm_packets(struct ark_udm_t *udm)
 void
 ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
 {
-	PMD_STATS_LOG(INFO, "UDM Stats: %s"
+	ARK_PMD_LOG(INFO, "UDM Stats: %s"
 		      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
 		      msg,
 		      "Pkts Received", udm->stats.rx_packet_count,
@@ -138,7 +138,7 @@ ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
 void
 ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
 {
-	PMD_STATS_LOG(INFO, "UDM Queue %3u Stats: %s"
+	ARK_PMD_LOG(INFO, "UDM Queue %3u Stats: %s"
 		      ARK_SU64 ARK_SU64
 		      ARK_SU64 ARK_SU64
 		      ARK_SU64 "\n",
@@ -153,14 +153,14 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
 void
 ark_udm_dump(struct ark_udm_t *udm, const char *msg)
 {
-	PMD_DEBUG_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
+	ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
 		      udm->cfg.stop_flushed);
 }
 
 void
 ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
 {
-	PMD_DEBUG_LOG(DEBUG, "UDM Setup Q: %u"
+	ARK_PMD_LOG(DEBUG, "UDM Setup Q: %u"
 		      ARK_SU64X ARK_SU32 "\n",
 		      q_id,
 		      "hw_prod_addr", udm->rt_cfg.hw_prod_addr,
@@ -172,7 +172,7 @@ ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
 {
 	struct ark_udm_pcibp_t *bp = &udm->pcibp;
 
-	PMD_STATS_LOG(INFO, "UDM Performance %s"
+	ARK_PMD_LOG(INFO, "UDM Performance %s"
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
 		      "\n",
 		      msg,
Signature · 1 line
2.17.1
author
#10 lore raw

PATCH 2/2 net/ark: remove RTE_LIBRTE_ARK_PAD_TX configuration macro

Replace behavior with RTE_LIBRTE_ARK_MIN_TX_PKTLEN with a default value of 0.
Update documentation as needed.

---
 doc/guides/nics/ark.rst         | 13 ++++++++--
 drivers/net/ark/ark_ethdev_tx.c | 44 +++++++++++++++++++--------------
 drivers/net/ark/ark_logs.h      |  8 ------
 3 files changed, 36 insertions(+), 29 deletions(-)
doc/guides/nics/ark.rst +11 -2
index c3ffcbbc2..f4d4539e5 100644
@@ -129,8 +129,10 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
      of the ARK PMD driver in the DPDK compilation.
 
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
+  * **CONFIG_RTE_LIBRTE_ARK_MIN_TX_PKTLEN** (default 0): Sets the minimum
+    packet length for tx packets to the FPGA.  Packets less than this
+    length are padded to meet the requirement. This allows padding to
+    be offloaded or remain in host software.
 
 
 Building DPDK
@@ -144,6 +146,13 @@ By default the ARK PMD library will be built into the DPDK library.
 For configuring and using UIO and VFIO frameworks, please also refer :ref:`the
 documentation that comes with DPDK suite <linux_gsg>`.
 
+To build with a non-zero minimum tx packet length, set the above macro in your
+CFLAGS environment prior to the meson build step. I.e.,
+
+    export CFLAGS="-DRTE_LIBRTE_ARK_MIN_TX_PKTLEN=60"
+    meson build
+
+
 Supported ARK RTL PCIe Instances
 --------------------------------
 
drivers/net/ark/ark_ethdev_tx.c +25 -19

64 lines not on this page · raw message

drivers/net/ark/ark_logs.h +0 -8
index c3d7e7d39..ca46d86c9 100644
@@ -8,14 +8,6 @@
 #include <inttypes.h>
 #include <rte_log.h>
 
-
-/* Configuration option to pad TX packets to 60 bytes */
-#ifdef RTE_LIBRTE_ARK_PAD_TX
-#define ARK_TX_PAD_TO_60   1
-#else
-#define ARK_TX_PAD_TO_60   0
-#endif
-
 /* system camel case definition changed to upper case */
 #define PRIU32 PRIu32
 #define PRIU64 PRIu64
Signature · 1 line
2.17.1
#11 lore raw

Re: [dpdk-dev] [PATCH 2/2] net/ark: remove RTE_LIBRTE_ARK_PAD_TX configuration macro

Quoted 16 lines · Ed Czeck

Replace behavior with RTE_LIBRTE_ARK_MIN_TX_PKTLEN with a default value of 0.
Update documentation as needed.

---
 doc/guides/nics/ark.rst         | 13 ++++++++--
 drivers/net/ark/ark_ethdev_tx.c | 44 +++++++++++++++++++--------------
 drivers/net/ark/ark_logs.h      |  8 ------
 3 files changed, 36 insertions(+), 29 deletions(-)
doc/guides/nics/ark.rst +0 -0
index c3ffcbbc2..f4d4539e5 100644

doc/guides/nics/ark.rst Configuration Information · line 136

Quoted 10 lines
doc/guides/nics/ark.rst +4 -2
@@ -129,8 +129,10 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
      of the ARK PMD driver in the DPDK compilation.
 
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
+  * **CONFIG_RTE_LIBRTE_ARK_MIN_TX_PKTLEN** (default 0): Sets the minimum
+    packet length for tx packets to the FPGA.  Packets less than this
+    length are padded to meet the requirement. This allows padding to
+    be offloaded or remain in host software.
 

There is no 'CONFIG_RTE_LIBRTE_ARK_MIN_TX_PKTLEN' option, I think it is confusing to add it to documentation. There is already some documentation in below for 'RTE_LIBRTE_ARK_MIN_TX_PKTLEN', what do you think removing this part?

And can you please remove 'CONFIG_RTE_LIBRTE_ARK_PAD_TX' form 'config/common_base'?

Another option is, do you think does it help your users to keep the config name same, like keep the 'CONFIG_RTE_LIBRTE_ARK_PAD_TX' as 'RTE_LIBRTE_ARK_PAD_TX' for the meson CFLAGs, instead of renaming it to 'RTE_LIBRTE_ARK_MIN_TX_PKTLEN'?

author
#12 lore raw

Re: [dpdk-dev] [PATCH 2/2] net/ark: remove RTE_LIBRTE_ARK_PAD_TX configuration macro

Quoted 21 lines · Ferruh Yigit
Quoted 19 lines · Ed Czeck

Replace behavior with RTE_LIBRTE_ARK_MIN_TX_PKTLEN with a default value of 0.
Update documentation as needed.

---
 doc/guides/nics/ark.rst         | 13 ++++++++--
 drivers/net/ark/ark_ethdev_tx.c | 44 +++++++++++++++++++--------------
 drivers/net/ark/ark_logs.h      |  8 ------
 3 files changed, 36 insertions(+), 29 deletions(-)
doc/guides/nics/ark.rst +0 -0
index c3ffcbbc2..f4d4539e5 100644
@@ -129,8 +129,10 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
      of the ARK PMD driver in the DPDK compilation.
 
Quoted 12 lines

doc/guides/nics/ark.rst Configuration Information · line 136

Quoted 7 lines
doc/guides/nics/ark.rst +4 -2
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
+  * **CONFIG_RTE_LIBRTE_ARK_MIN_TX_PKTLEN** (default 0): Sets the minimum
+    packet length for tx packets to the FPGA.  Packets less than this
+    length are padded to meet the requirement. This allows padding to
+    be offloaded or remain in host software.
 

There is no 'CONFIG_RTE_LIBRTE_ARK_MIN_TX_PKTLEN' option, I think it is confusing to add it to documentation. There is already some documentation in below for 'RTE_LIBRTE_ARK_MIN_TX_PKTLEN', what do you think removing this part?

Should I remove the all references to the CONFIG_RTE_LIBRTE_ARK from the net/ark section of the guide? It appears that CONFIG_.* will be removed along with the makefile build system.

Quoted 2 lines

And can you please remove 'CONFIG_RTE_LIBRTE_ARK_PAD_TX' form 'config/common_base'?

I am hesitant to modify config/common_base, since it is slated for removal and edits will cause merge conflicts. Are you OK with this?

Quoted 3 lines

Another option is, do you think does it help your users to keep the config name same, like keep the 'CONFIG_RTE_LIBRTE_ARK_PAD_TX' as 'RTE_LIBRTE_ARK_PAD_TX' for the meson CFLAGs, instead of renaming it to 'RTE_LIBRTE_ARK_MIN_TX_PKTLEN'?

I will drop the CONFIG names and leave the compiler marco documented in my next patch.

Thx,

#13 lore raw

Re: [dpdk-dev] [PATCH 2/2] net/ark: remove RTE_LIBRTE_ARK_PAD_TX configuration macro

Quoted 34 lines · Ed Czeck
Quoted 21 lines · Ferruh Yigit
Quoted 19 lines · Ed Czeck

Replace behavior with RTE_LIBRTE_ARK_MIN_TX_PKTLEN with a default value of 0.
Update documentation as needed.

---
 doc/guides/nics/ark.rst         | 13 ++++++++--
 drivers/net/ark/ark_ethdev_tx.c | 44 +++++++++++++++++++--------------
 drivers/net/ark/ark_logs.h      |  8 ------
 3 files changed, 36 insertions(+), 29 deletions(-)
doc/guides/nics/ark.rst +0 -0
index c3ffcbbc2..f4d4539e5 100644
@@ -129,8 +129,10 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
      of the ARK PMD driver in the DPDK compilation.
 
Quoted 12 lines

doc/guides/nics/ark.rst Configuration Information · line 136

Quoted 7 lines
doc/guides/nics/ark.rst +4 -2
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
+  * **CONFIG_RTE_LIBRTE_ARK_MIN_TX_PKTLEN** (default 0): Sets the minimum
+    packet length for tx packets to the FPGA.  Packets less than this
+    length are padded to meet the requirement. This allows padding to
+    be offloaded or remain in host software.
 

There is no 'CONFIG_RTE_LIBRTE_ARK_MIN_TX_PKTLEN' option, I think it is confusing to add it to documentation. There is already some documentation in below for 'RTE_LIBRTE_ARK_MIN_TX_PKTLEN', what do you think removing this part?

Quoted 3 lines

Should I remove the all references to the CONFIG_RTE_LIBRTE_ARK from the net/ark section of the guide? It appears that CONFIG_.* will be removed along with the makefile build system.

As you said it is removed by Ciara's patch, no need to touch it in this patch.

Quoted 5 lines
Quoted 3 lines

And can you please remove 'CONFIG_RTE_LIBRTE_ARK_PAD_TX' form 'config/common_base'?

I am hesitant to modify config/common_base, since it is slated for removal and edits will cause merge conflicts. Are you OK with this?

OK.

Quoted 7 lines
Quoted 4 lines

Another option is, do you think does it help your users to keep the config name same, like keep the 'CONFIG_RTE_LIBRTE_ARK_PAD_TX' as 'RTE_LIBRTE_ARK_PAD_TX' for the meson CFLAGs, instead of renaming it to 'RTE_LIBRTE_ARK_MIN_TX_PKTLEN'?

I will drop the CONFIG names and leave the compiler marco documented in my next patch.

OK, thanks.

#14 lore raw

Re: [dpdk-dev] [PATCH 1/2] net/ark: remove compile time log macros in favor of run time log control

In reply to Ed Czeck
Quoted 31 lines · Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

---
 doc/guides/nics/ark.rst         | 13 ------
 drivers/net/ark/ark_ddm.c       | 12 ++---
 drivers/net/ark/ark_ethdev.c    | 77 +++++++++++++++------------------
 drivers/net/ark/ark_ethdev_rx.c | 46 ++++++++++----------
 drivers/net/ark/ark_ethdev_tx.c | 10 ++---
 drivers/net/ark/ark_logs.h      | 63 +++------------------------
 drivers/net/ark/ark_mpu.c       | 32 ++++----------
 drivers/net/ark/ark_pktchkr.c   | 36 +++++++--------
 drivers/net/ark/ark_pktdir.c    |  2 +-
 drivers/net/ark/ark_pktgen.c    | 22 +++++-----
 drivers/net/ark/ark_rqp.c       |  4 +-
 drivers/net/ark/ark_udm.c       | 18 ++++----
 12 files changed, 125 insertions(+), 210 deletions(-)
doc/guides/nics/ark.rst +0 -3
index 06e8c3374..c3ffcbbc2 100644
@@ -132,19 +132,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
      packets are padded to 60 bytes to support downstream MACS.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
-     logging and internal checking of RX ingress logic within the ARK PMD driver.
-

doc/guides/nics/ark.rst Configuration Information · line 147

Quoted 10 lines
doc/guides/nics/ark.rst +0 -10
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
-     logging and internal checking of TX egress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
-     logging of detailed packet and performance statistics gathered in
-     the PMD and FPGA.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
-     logging of detailed PMD events and status.
-

Can you please remove these config option from 'config/common_base'?

#15 lore raw

Re: [dpdk-dev] [PATCH 1/2] net/ark: remove compile time log macros in favor of run time log control

Quoted 29 lines · Ferruh Yigit
Quoted 28 lines · Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

---
 doc/guides/nics/ark.rst         | 13 ------
 drivers/net/ark/ark_ddm.c       | 12 ++---
 drivers/net/ark/ark_ethdev.c    | 77 +++++++++++++++------------------
 drivers/net/ark/ark_ethdev_rx.c | 46 ++++++++++----------
 drivers/net/ark/ark_ethdev_tx.c | 10 ++---
 drivers/net/ark/ark_logs.h      | 63 +++------------------------
 drivers/net/ark/ark_mpu.c       | 32 ++++----------
 drivers/net/ark/ark_pktchkr.c   | 36 +++++++--------
 drivers/net/ark/ark_pktdir.c    |  2 +-
 drivers/net/ark/ark_pktgen.c    | 22 +++++-----
 drivers/net/ark/ark_rqp.c       |  4 +-
 drivers/net/ark/ark_udm.c       | 18 ++++----
 12 files changed, 125 insertions(+), 210 deletions(-)
doc/guides/nics/ark.rst +0 -0
index 06e8c3374..c3ffcbbc2 100644
@@ -132,19 +132,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
      packets are padded to 60 bytes to support downstream MACS.
 
Quoted 16 lines

doc/guides/nics/ark.rst Configuration Information · line 147

Quoted 13 lines
doc/guides/nics/ark.rst +0 -13
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
-     logging and internal checking of RX ingress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
-     logging and internal checking of TX egress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
-     logging of detailed packet and performance statistics gathered in
-     the PMD and FPGA.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
-     logging of detailed PMD events and status.
-

Can you please remove these config option from 'config/common_base'?

Given that the file is scheduled for deletion fairly soon, not sure if that is worthwhile doing.

#16 lore raw

Re: [dpdk-dev] [PATCH 1/2] net/ark: remove compile time log macros in favor of run time log control

Quoted 46 lines · Bruce Richardson
Quoted 29 lines · Ferruh Yigit
Quoted 28 lines · Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

---
 doc/guides/nics/ark.rst         | 13 ------
 drivers/net/ark/ark_ddm.c       | 12 ++---
 drivers/net/ark/ark_ethdev.c    | 77 +++++++++++++++------------------
 drivers/net/ark/ark_ethdev_rx.c | 46 ++++++++++----------
 drivers/net/ark/ark_ethdev_tx.c | 10 ++---
 drivers/net/ark/ark_logs.h      | 63 +++------------------------
 drivers/net/ark/ark_mpu.c       | 32 ++++----------
 drivers/net/ark/ark_pktchkr.c   | 36 +++++++--------
 drivers/net/ark/ark_pktdir.c    |  2 +-
 drivers/net/ark/ark_pktgen.c    | 22 +++++-----
 drivers/net/ark/ark_rqp.c       |  4 +-
 drivers/net/ark/ark_udm.c       | 18 ++++----
 12 files changed, 125 insertions(+), 210 deletions(-)
doc/guides/nics/ark.rst +0 -0
index 06e8c3374..c3ffcbbc2 100644
@@ -132,19 +132,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
      packets are padded to 60 bytes to support downstream MACS.
 
Quoted 16 lines

doc/guides/nics/ark.rst Configuration Information · line 147

Quoted 13 lines
doc/guides/nics/ark.rst +0 -13
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
-     logging and internal checking of RX ingress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
-     logging and internal checking of TX egress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
-     logging of detailed packet and performance statistics gathered in
-     the PMD and FPGA.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
-     logging of detailed PMD events and status.
-

Can you please remove these config option from 'config/common_base'?

Quoted 3 lines

Given that the file is scheduled for deletion fairly soon, not sure if that is worthwhile doing.

Since there is possible new version already because of comment in 2/2, I think better to update 'config/common_base' for the sake of completeness.

But if there won't be a new version, this can be skipped pragmatically.

author
#17 lore raw

Re: [dpdk-dev] [PATCH 1/2] net/ark: remove compile time log macros in favor of run time log control

Quoted 48 lines · Ferruh Yigit
Quoted 46 lines · Bruce Richardson
Quoted 45 lines · Ferruh Yigit
Quoted 31 lines · Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

---
 doc/guides/nics/ark.rst         | 13 ------
 drivers/net/ark/ark_ddm.c       | 12 ++---
 drivers/net/ark/ark_ethdev.c    | 77 +++++++++++++++------------------
 drivers/net/ark/ark_ethdev_rx.c | 46 ++++++++++----------
 drivers/net/ark/ark_ethdev_tx.c | 10 ++---
 drivers/net/ark/ark_logs.h      | 63 +++------------------------
 drivers/net/ark/ark_mpu.c       | 32 ++++----------
 drivers/net/ark/ark_pktchkr.c   | 36 +++++++--------
 drivers/net/ark/ark_pktdir.c    |  2 +-
 drivers/net/ark/ark_pktgen.c    | 22 +++++-----
 drivers/net/ark/ark_rqp.c       |  4 +-
 drivers/net/ark/ark_udm.c       | 18 ++++----
 12 files changed, 125 insertions(+), 210 deletions(-)
doc/guides/nics/ark.rst +0 -3
index 06e8c3374..c3ffcbbc2 100644
@@ -132,19 +132,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
      packets are padded to 60 bytes to support downstream MACS.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
-     logging and internal checking of RX ingress logic within the ARK PMD driver.
-

doc/guides/nics/ark.rst Configuration Information · line 147

Quoted 10 lines
doc/guides/nics/ark.rst +0 -10
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
-     logging and internal checking of TX egress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
-     logging of detailed packet and performance statistics gathered in
-     the PMD and FPGA.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
-     logging of detailed PMD events and status.
-

Can you please remove these config option from 'config/common_base'?

Quoted 8 lines
Quoted 3 lines

Given that the file is scheduled for deletion fairly soon, not sure if that is worthwhile doing.

Since there is possible new version already because of comment in 2/2, I think better to update 'config/common_base' for the sake of completeness.

But if there won't be a new version, this can be skipped pragmatically.

I will avoid the update of config/common_base as changes there will cause merge conflict.

#18 lore raw

Re: [dpdk-dev] [PATCH 1/2] net/ark: remove compile time log macros in favor of run time log control

Quoted 53 lines · Ed Czeck
Quoted 52 lines · Ferruh Yigit
Quoted 49 lines · Bruce Richardson
Quoted 29 lines · Ferruh Yigit
Quoted 28 lines · Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

---
 doc/guides/nics/ark.rst         | 13 ------
 drivers/net/ark/ark_ddm.c       | 12 ++---
 drivers/net/ark/ark_ethdev.c    | 77 +++++++++++++++------------------
 drivers/net/ark/ark_ethdev_rx.c | 46 ++++++++++----------
 drivers/net/ark/ark_ethdev_tx.c | 10 ++---
 drivers/net/ark/ark_logs.h      | 63 +++------------------------
 drivers/net/ark/ark_mpu.c       | 32 ++++----------
 drivers/net/ark/ark_pktchkr.c   | 36 +++++++--------
 drivers/net/ark/ark_pktdir.c    |  2 +-
 drivers/net/ark/ark_pktgen.c    | 22 +++++-----
 drivers/net/ark/ark_rqp.c       |  4 +-
 drivers/net/ark/ark_udm.c       | 18 ++++----
 12 files changed, 125 insertions(+), 210 deletions(-)
doc/guides/nics/ark.rst +0 -0
index 06e8c3374..c3ffcbbc2 100644
@@ -132,19 +132,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
      packets are padded to 60 bytes to support downstream MACS.
 
Quoted 16 lines

doc/guides/nics/ark.rst Configuration Information · line 147

Quoted 13 lines
doc/guides/nics/ark.rst +0 -13
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
-     logging and internal checking of RX ingress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
-     logging and internal checking of TX egress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
-     logging of detailed packet and performance statistics gathered in
-     the PMD and FPGA.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
-     logging of detailed PMD events and status.
-

Can you please remove these config option from 'config/common_base'?

Given that the file is scheduled for deletion fairly soon, not sure if that is worthwhile doing.

Quoted 8 lines
Quoted 4 lines

Since there is possible new version already because of comment in 2/2, I think better to update 'config/common_base' for the sake of completeness.

But if there won't be a new version, this can be skipped pragmatically.

I will avoid the update of config/common_base as changes there will cause merge conflict.

OK

author
#19 lore raw

PATCH 1/2 net/ark: remove compile time log macros in favor of run time log control

In reply to Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

---
 doc/guides/nics/ark.rst         | 13 ------
 drivers/net/ark/ark_ddm.c       | 12 ++---
 drivers/net/ark/ark_ethdev.c    | 77 +++++++++++++++------------------
 drivers/net/ark/ark_ethdev_rx.c | 46 ++++++++++----------
 drivers/net/ark/ark_ethdev_tx.c | 10 ++---
 drivers/net/ark/ark_logs.h      | 63 +++------------------------
 drivers/net/ark/ark_mpu.c       | 32 ++++----------
 drivers/net/ark/ark_pktchkr.c   | 36 +++++++--------
 drivers/net/ark/ark_pktdir.c    |  2 +-
 drivers/net/ark/ark_pktgen.c    | 22 +++++-----
 drivers/net/ark/ark_rqp.c       |  4 +-
 drivers/net/ark/ark_udm.c       | 18 ++++----
 12 files changed, 125 insertions(+), 210 deletions(-)
doc/guides/nics/ark.rst +0 -13
index 06e8c3374..c3ffcbbc2 100644
@@ -132,19 +132,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
      packets are padded to 60 bytes to support downstream MACS.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
-     logging and internal checking of RX ingress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
-     logging and internal checking of TX egress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
-     logging of detailed packet and performance statistics gathered in
-     the PMD and FPGA.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
-     logging of detailed PMD events and status.
-
 
 Building DPDK
 -------------
drivers/net/ark/ark_ddm.c +6 -6
index 57026f8d1..91d1179d8 100644
@@ -13,19 +13,19 @@ ark_ddm_verify(struct ark_ddm_t *ddm)
 {
 	uint32_t hw_const;
 	if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
-		PMD_DRV_LOG(ERR, "ARK: DDM structure looks incorrect %d vs %zd\n",
+		ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
 			    ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
 		return -1;
 	}
 
 	hw_const = ddm->cfg.const0;
 	if (hw_const == ARK_DDM_CONST1) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: DDM module is version 1, "
 			    "PMD expects version 2\n");
 		return -1;
 	} else if (hw_const != ARK_DDM_CONST2) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: DDM module not found as expected 0x%08x\n",
 			    ddm->cfg.const0);
 		return -1;
@@ -63,7 +63,7 @@ ark_ddm_reset(struct ark_ddm_t *ddm)
 	status = ark_ddm_stop(ddm, 1);
 
 	if (status != 0) {
-		PMD_DEBUG_LOG(INFO, "%s  stop failed  doing forced reset\n",
+		ARK_PMD_LOG(NOTICE, "%s  stop failed  doing forced reset\n",
 			      __func__);
 		ddm->cfg.command = 4;
 		usleep(10);
@@ -87,7 +87,7 @@ ark_ddm_stats_reset(struct ark_ddm_t *ddm)
 void
 ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
 {
-	PMD_FUNC_LOG(DEBUG, "%s Stopped: %d\n", msg,
+	ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
 		     ark_ddm_is_stopped(ddm)
 		     );
 }
@@ -97,7 +97,7 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
 {
 	struct ark_ddm_stats_t *stats = &ddm->stats;
 
-	PMD_STATS_LOG(INFO, "DDM Stats: %s"
+	ARK_PMD_LOG(INFO, "DDM Stats: %s"
 		      ARK_SU64 ARK_SU64 ARK_SU64
 		      "\n", msg,
 		      "Bytes:", stats->tx_byte_count,
drivers/net/ark/ark_ethdev.c +36 -41

285 lines not on this page · raw message

drivers/net/ark/ark_ethdev_rx.c +23 -23

152 lines not on this page · raw message

drivers/net/ark/ark_ethdev_tx.c +5 -5
index 289668774..72624deb3 100644
@@ -143,8 +143,8 @@ eth_ark_xmit_pkts(void *vtxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		}
 	}
 
-	if (ARK_TX_DEBUG && (nb != nb_pkts)) {
-		PMD_TX_LOG(DEBUG, "TX: Failure to send:"
+	if (ARK_DEBUG_CORE && nb != nb_pkts) {
+		ARK_PMD_LOG(DEBUG, "TX: Failure to send:"
 			   " req: %" PRIU32
 			   " sent: %" PRIU32
 			   " prod: %" PRIU32
@@ -214,7 +214,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 	int qidx = queue_idx;
 
 	if (!rte_is_power_of_2(nb_desc)) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "DPDK Arkville configuration queue size"
 			    " must be power of two %u (%s)\n",
 			    nb_desc, __func__);
@@ -227,7 +227,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 				   64,
 				   socket_id);
 	if (queue == 0) {
-		PMD_DRV_LOG(ERR, "Failed to allocate tx "
+		ARK_PMD_LOG(ERR, "Failed to allocate tx "
 			    "queue memory in %s\n",
 			    __func__);
 		return -ENOMEM;
@@ -252,7 +252,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 				   socket_id);
 
 	if (queue->meta_q == 0 || queue->bufs == 0) {
-		PMD_DRV_LOG(ERR, "Failed to allocate "
+		ARK_PMD_LOG(ERR, "Failed to allocate "
 			    "queue memory in %s\n", __func__);
 		rte_free(queue->meta_q);
 		rte_free(queue->bufs);
drivers/net/ark/ark_logs.h +6 -57

72 lines not on this page · raw message

drivers/net/ark/ark_mpu.c +8 -24
index 21f840f3c..8160c1de7 100644
@@ -28,7 +28,7 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
 	if ((mpu->id.idnum != 0x2055504d) ||
 	    (mpu->hw.obj_size != obj_size) ||
 	    (version != 0x00003100)) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "   MPU module not found as expected %08x"
 			    " \"%c%c%c%c %c%c%c%c\"\n",
 			    mpu->id.idnum,
@@ -36,7 +36,7 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
 			    mpu->id.id[2], mpu->id.id[3],
 			    mpu->id.ver[0], mpu->id.ver[1],
 			    mpu->id.ver[2], mpu->id.ver[3]);
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "   MPU HW num_queues: %u hw_depth %u,"
 			    " obj_size: %u, obj_per_mrr: %u"
 			    " Expected size %u\n",
@@ -95,7 +95,7 @@ ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
 	ark_mpu_reset(mpu);
 
 	if (!rte_is_power_of_2(ring_size)) {
-		PMD_DRV_LOG(ERR, "ARK: Invalid ring size for MPU %d\n",
+		ARK_PMD_LOG(ERR, "Invalid ring size for MPU %d\n",
 			    ring_size);
 		return -1;
 	}
@@ -114,37 +114,21 @@ void
 ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
 {
 	/* DUMP to see that we have started */
-	PMD_DEBUG_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
+	ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
 		      code, qid,
 		      mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
-	PMD_DEBUG_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
-		      " data 0x%08x_%08x 0x%08x_%08x\n",
+	ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
+		      "\n",
 		      code,
 		      mpu->debug.state, mpu->debug.count,
-		      mpu->debug.reserved,
-		      mpu->debug.peek[1],
-		      mpu->debug.peek[0],
-		      mpu->debug.peek[3],
-		      mpu->debug.peek[2]
-		      );
-	PMD_STATS_LOG(INFO, "MPU: %s Q: %3u"
-		      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64
-		      ARK_SU64 ARK_SU64 ARK_SU64 "\n",
-		      code, qid,
-		      "PCI Request:", mpu->stats.pci_request,
-		      "Queue_empty", mpu->stats.q_empty,
-		      "Queue_q1", mpu->stats.q_q1,
-		      "Queue_q2", mpu->stats.q_q2,
-		      "Queue_q3", mpu->stats.q_q3,
-		      "Queue_q4", mpu->stats.q_q4,
-		      "Queue_full", mpu->stats.q_full
+		      mpu->debug.reserved
 		      );
 }
 
 void
 ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t q_id)
 {
-	PMD_DEBUG_LOG(DEBUG, "MPU Setup Q: %u"
+	ARK_PMD_LOG(DEBUG, "MPU Setup Q: %u"
 		      ARK_SU64X "\n",
 		      q_id,
 		      "ring_base", mpu->cfg.ring_base
drivers/net/ark/ark_pktchkr.c +18 -18
index ef861eea3..b8fb69497 100644
@@ -85,7 +85,7 @@ ark_pktchkr_init(void *addr, int ord, int l2_mode)
 		rte_malloc("ark_pkt_chkr_inst",
 			   sizeof(struct ark_pkt_chkr_inst), 0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
 		return inst;
 	}
 	inst->sregs = (struct ark_pkt_chkr_stat_regs *)addr;
@@ -130,10 +130,10 @@ ark_pktchkr_stop(ark_pkt_chkr_t handle)
 	while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
+		ARK_PMD_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
 			      inst->ordinal);
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
 }
 
 int
@@ -189,7 +189,7 @@ ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
 	struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
 
 	if (ark_pktchkr_is_gen_forever(handle)) {
-		PMD_DEBUG_LOG(ERR, "Pktchk wait_done will not terminate"
+		ARK_PMD_LOG(NOTICE, "Pktchk wait_done will not terminate"
 			      " because gen_forever=1\n");
 		return -1;
 	}
@@ -198,10 +198,10 @@ ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
 	while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG, "Waiting for packet checker %d's"
+		ARK_PMD_LOG(DEBUG, "Waiting for packet checker %d's"
 			      " internal pktgen to finish sending...\n",
 			      inst->ordinal);
-		PMD_DEBUG_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
+		ARK_PMD_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
 			      inst->ordinal);
 	}
 	return 0;
@@ -296,25 +296,25 @@ ark_pktchkr_dump_stats(ark_pkt_chkr_t handle)
 {
 	struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
 
-	PMD_STATS_LOG(INFO, "pkts_rcvd      = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_rcvd      = (%'u)\n",
 		      inst->sregs->pkts_rcvd);
-	PMD_STATS_LOG(INFO, "bytes_rcvd     = (%'" PRIU64 ")\n",
+	ARK_PMD_LOG(INFO, "bytes_rcvd     = (%'" PRIU64 ")\n",
 		      inst->sregs->bytes_rcvd);
-	PMD_STATS_LOG(INFO, "pkts_ok        = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_ok        = (%'u)\n",
 		      inst->sregs->pkts_ok);
-	PMD_STATS_LOG(INFO, "pkts_mismatch  = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_mismatch  = (%'u)\n",
 		      inst->sregs->pkts_mismatch);
-	PMD_STATS_LOG(INFO, "pkts_err       = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_err       = (%'u)\n",
 		      inst->sregs->pkts_err);
-	PMD_STATS_LOG(INFO, "first_mismatch = (%'u)\n",
+	ARK_PMD_LOG(INFO, "first_mismatch = (%'u)\n",
 		      inst->sregs->first_mismatch);
-	PMD_STATS_LOG(INFO, "resync_events  = (%'u)\n",
+	ARK_PMD_LOG(INFO, "resync_events  = (%'u)\n",
 		      inst->sregs->resync_events);
-	PMD_STATS_LOG(INFO, "pkts_missing   = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_missing   = (%'u)\n",
 		      inst->sregs->pkts_missing);
-	PMD_STATS_LOG(INFO, "min_latency    = (%'u)\n",
+	ARK_PMD_LOG(INFO, "min_latency    = (%'u)\n",
 		      inst->sregs->min_latency);
-	PMD_STATS_LOG(INFO, "max_latency    = (%'u)\n",
+	ARK_PMD_LOG(INFO, "max_latency    = (%'u)\n",
 		      inst->sregs->max_latency);
 }
 
@@ -327,7 +327,7 @@ options(const char *id)
 		if (strcmp(id, toptions[i].opt) == 0)
 			return &toptions[i];
 	}
-	PMD_DRV_LOG(ERR,
+	ARK_PMD_LOG(ERR,
 		    "pktchkr: Could not find requested option!, option = %s\n",
 		    id);
 	return NULL;
@@ -443,7 +443,7 @@ ark_pktchkr_setup(ark_pkt_chkr_t handle)
 		ark_pktchkr_stop(handle);
 
 	if (options("run")->v.BOOL) {
-		PMD_DEBUG_LOG(DEBUG, "Starting packet checker on port %d\n",
+		ARK_PMD_LOG(DEBUG, "Starting packet checker on port %d\n",
 			      options("port")->v.INT);
 		ark_pktchkr_run(handle);
 	}
drivers/net/ark/ark_pktdir.c +1 -1
index 1f2c8182a..25e121831 100644
@@ -18,7 +18,7 @@ ark_pktdir_init(void *base)
 			   sizeof(struct ark_pkt_dir_inst),
 			   0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
 		return inst;
 	}
 	inst->regs = (struct ark_pkt_dir_regs *)base;
drivers/net/ark/ark_pktgen.c +11 -11
index 2cae252d6..4a02662a4 100644
@@ -83,7 +83,7 @@ ark_pktgen_init(void *adr, int ord, int l2_mode)
 		rte_malloc("ark_pkt_gen_inst_pmd",
 			   sizeof(struct ark_pkt_gen_inst), 0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
 		return inst;
 	}
 	inst->regs = (struct ark_pkt_gen_regs *)adr;
@@ -126,12 +126,12 @@ ark_pktgen_pause(ark_pkt_gen_t handle)
 	while (!ark_pktgen_paused(handle)) {
 		usleep(1000);
 		if (cnt++ > 100) {
-			PMD_DRV_LOG(ERR, "Pktgen %d failed to pause.\n",
+			ARK_PMD_LOG(NOTICE, "Pktgen %d failed to pause.\n",
 				    inst->ordinal);
 			break;
 		}
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
 }
 
 void
@@ -141,7 +141,7 @@ ark_pktgen_reset(ark_pkt_gen_t handle)
 
 	if (!ark_pktgen_is_running(handle) &&
 	    !ark_pktgen_paused(handle)) {
-		PMD_DEBUG_LOG(DEBUG, "Pktgen %d is not running"
+		ARK_PMD_LOG(DEBUG, "Pktgen %d is not running"
 			      " and is not paused. No need to reset.\n",
 			      inst->ordinal);
 		return;
@@ -149,13 +149,13 @@ ark_pktgen_reset(ark_pkt_gen_t handle)
 
 	if (ark_pktgen_is_running(handle) &&
 	    !ark_pktgen_paused(handle)) {
-		PMD_DEBUG_LOG(DEBUG,
+		ARK_PMD_LOG(DEBUG,
 			      "Pktgen %d is not paused. Pausing first.\n",
 			      inst->ordinal);
 		ark_pktgen_pause(handle);
 	}
 
-	PMD_DEBUG_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
 	inst->regs->pkt_start_stop = (1 << 8);
 }
 
@@ -193,17 +193,17 @@ ark_pktgen_wait_done(ark_pkt_gen_t handle)
 	int wait_cycle = 10;
 
 	if (ark_pktgen_is_gen_forever(handle))
-		PMD_DRV_LOG(ERR, "Pktgen wait_done will not terminate"
+		ARK_PMD_LOG(NOTICE, "Pktgen wait_done will not terminate"
 			    " because gen_forever=1\n");
 
 	while (!ark_pktgen_tx_done(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG,
+		ARK_PMD_LOG(DEBUG,
 			      "Waiting for pktgen %d to finish sending...\n",
 			      inst->ordinal);
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
 }
 
 uint32_t
@@ -306,7 +306,7 @@ options(const char *id)
 			return &toptions[i];
 	}
 
-	PMD_DRV_LOG(ERR,
+	ARK_PMD_LOG(ERR,
 		    "Pktgen: Could not find requested option!, "
 		    "option = %s\n",
 		    id
@@ -465,7 +465,7 @@ ark_pktgen_setup(ark_pkt_gen_t handle)
 	if (options("reset")->v.BOOL)
 		ark_pktgen_reset(handle);
 	if (options("run")->v.BOOL) {
-		PMD_DEBUG_LOG(DEBUG, "Starting packet generator on port %d\n",
+		ARK_PMD_LOG(DEBUG, "Starting packet generator on port %d\n",
 				options("port")->v.INT);
 		ark_pktgen_run(handle);
 	}
drivers/net/ark/ark_rqp.c +2 -2
index bf1af4d61..ef9ccd070 100644
@@ -23,7 +23,7 @@ void
 ark_rqp_dump(struct ark_rqpace_t *rqp)
 {
 	if (rqp->err_count_other != 0)
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
 			    ARK_SU32
 			    ARK_SU32 "\n",
@@ -31,7 +31,7 @@ ark_rqp_dump(struct ark_rqpace_t *rqp)
 			    "Error Count", rqp->err_cnt,
 			    "Error General", rqp->err_count_other);
 
-	PMD_STATS_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
+	ARK_PMD_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
 		      ARK_SU32
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
drivers/net/ark/ark_udm.c +9 -9
index 03f1922c6..a740d36d4 100644
@@ -11,14 +11,14 @@ int
 ark_udm_verify(struct ark_udm_t *udm)
 {
 	if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: UDM structure looks incorrect %d vs %zd\n",
 			    ARK_UDM_EXPECT_SIZE, sizeof(struct ark_udm_t));
 		return -1;
 	}
 
 	if (udm->setup.const0 != ARK_UDM_CONST) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: UDM module not found as expected 0x%08x\n",
 			    udm->setup.const0);
 		return -1;
@@ -49,13 +49,13 @@ ark_udm_reset(struct ark_udm_t *udm)
 
 	status = ark_udm_stop(udm, 1);
 	if (status != 0) {
-		PMD_DEBUG_LOG(INFO, "%s  stop failed  doing forced reset\n",
+		ARK_PMD_LOG(NOTICE, "%s  stop failed  doing forced reset\n",
 			      __func__);
 		udm->cfg.command = 4;
 		usleep(10);
 		udm->cfg.command = 3;
 		status = ark_udm_stop(udm, 0);
-		PMD_DEBUG_LOG(INFO, "%s  stop status %d post failure"
+		ARK_PMD_LOG(INFO, "%s  stop status %d post failure"
 			      " and forced reset\n",
 			      __func__, status);
 	} else {
@@ -125,7 +125,7 @@ ark_udm_packets(struct ark_udm_t *udm)
 void
 ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
 {
-	PMD_STATS_LOG(INFO, "UDM Stats: %s"
+	ARK_PMD_LOG(INFO, "UDM Stats: %s"
 		      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
 		      msg,
 		      "Pkts Received", udm->stats.rx_packet_count,
@@ -138,7 +138,7 @@ ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
 void
 ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
 {
-	PMD_STATS_LOG(INFO, "UDM Queue %3u Stats: %s"
+	ARK_PMD_LOG(INFO, "UDM Queue %3u Stats: %s"
 		      ARK_SU64 ARK_SU64
 		      ARK_SU64 ARK_SU64
 		      ARK_SU64 "\n",
@@ -153,14 +153,14 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
 void
 ark_udm_dump(struct ark_udm_t *udm, const char *msg)
 {
-	PMD_DEBUG_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
+	ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
 		      udm->cfg.stop_flushed);
 }
 
 void
 ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
 {
-	PMD_DEBUG_LOG(DEBUG, "UDM Setup Q: %u"
+	ARK_PMD_LOG(DEBUG, "UDM Setup Q: %u"
 		      ARK_SU64X ARK_SU32 "\n",
 		      q_id,
 		      "hw_prod_addr", udm->rt_cfg.hw_prod_addr,
@@ -172,7 +172,7 @@ ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
 {
 	struct ark_udm_pcibp_t *bp = &udm->pcibp;
 
-	PMD_STATS_LOG(INFO, "UDM Performance %s"
+	ARK_PMD_LOG(INFO, "UDM Performance %s"
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
 		      "\n",
 		      msg,
Signature · 1 line
2.17.1
author
#20 lore raw

PATCH 2/2 net/ark: remove RTE_LIBRTE_ARK_PAD_TX configuration macro

Replace behavior with RTE_LIBRTE_ARK_MIN_TX_PKTLEN with a default value of 0.
Update documentation as needed.

---
 doc/guides/nics/ark.rst         | 16 ++++++++----
 drivers/net/ark/ark_ethdev_tx.c | 44 +++++++++++++++++++--------------
 drivers/net/ark/ark_logs.h      |  8 ------
 3 files changed, 36 insertions(+), 32 deletions(-)
doc/guides/nics/ark.rst +11 -5
index c3ffcbbc2..c7ed4095f 100644
@@ -126,11 +126,10 @@ Configuration Information
 
   The following configuration options are available for the ARK PMD:
 
-   * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
-     of the ARK PMD driver in the DPDK compilation.
-
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
+   * **RTE_LIBRTE_ARK_MIN_TX_PKTLEN** (default 0): Sets the minimum
+     packet length for tx packets to the FPGA.  Packets less than this
+     length are padded to meet the requirement. This allows padding to
+     be offloaded or remain in host software.
 
 
 Building DPDK
@@ -144,6 +143,13 @@ By default the ARK PMD library will be built into the DPDK library.
 For configuring and using UIO and VFIO frameworks, please also refer :ref:`the
 documentation that comes with DPDK suite <linux_gsg>`.
 
+To build with a non-zero minimum tx packet length, set the above macro in your
+CFLAGS environment prior to the meson build step. I.e.,
+
+    export CFLAGS="-DRTE_LIBRTE_ARK_MIN_TX_PKTLEN=60"
+    meson build
+
+
 Supported ARK RTL PCIe Instances
 --------------------------------
 
drivers/net/ark/ark_ethdev_tx.c +25 -19

64 lines not on this page · raw message

drivers/net/ark/ark_logs.h +0 -8
index c3d7e7d39..ca46d86c9 100644
@@ -8,14 +8,6 @@
 #include <inttypes.h>
 #include <rte_log.h>
 
-
-/* Configuration option to pad TX packets to 60 bytes */
-#ifdef RTE_LIBRTE_ARK_PAD_TX
-#define ARK_TX_PAD_TO_60   1
-#else
-#define ARK_TX_PAD_TO_60   0
-#endif
-
 /* system camel case definition changed to upper case */
 #define PRIU32 PRIu32
 #define PRIU64 PRIu64
Signature · 1 line
2.17.1
author
#21 lore raw

PATCH 1/2 net/ark: remove compile time log macros in favor of run time log control

In reply to Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

---
 doc/guides/nics/ark.rst         | 13 ------
 drivers/net/ark/ark_ddm.c       | 12 ++---
 drivers/net/ark/ark_ethdev.c    | 77 +++++++++++++++------------------
 drivers/net/ark/ark_ethdev_rx.c | 46 ++++++++++----------
 drivers/net/ark/ark_ethdev_tx.c | 10 ++---
 drivers/net/ark/ark_logs.h      | 63 +++------------------------
 drivers/net/ark/ark_mpu.c       | 32 ++++----------
 drivers/net/ark/ark_pktchkr.c   | 36 +++++++--------
 drivers/net/ark/ark_pktdir.c    |  2 +-
 drivers/net/ark/ark_pktgen.c    | 22 +++++-----
 drivers/net/ark/ark_rqp.c       |  4 +-
 drivers/net/ark/ark_udm.c       | 18 ++++----
 12 files changed, 125 insertions(+), 210 deletions(-)
doc/guides/nics/ark.rst +0 -13
index 06e8c3374..c3ffcbbc2 100644
@@ -132,19 +132,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
      packets are padded to 60 bytes to support downstream MACS.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
-     logging and internal checking of RX ingress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
-     logging and internal checking of TX egress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
-     logging of detailed packet and performance statistics gathered in
-     the PMD and FPGA.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
-     logging of detailed PMD events and status.
-
 
 Building DPDK
 -------------
drivers/net/ark/ark_ddm.c +6 -6
index 57026f8d1..91d1179d8 100644
@@ -13,19 +13,19 @@ ark_ddm_verify(struct ark_ddm_t *ddm)
 {
 	uint32_t hw_const;
 	if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
-		PMD_DRV_LOG(ERR, "ARK: DDM structure looks incorrect %d vs %zd\n",
+		ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
 			    ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
 		return -1;
 	}
 
 	hw_const = ddm->cfg.const0;
 	if (hw_const == ARK_DDM_CONST1) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: DDM module is version 1, "
 			    "PMD expects version 2\n");
 		return -1;
 	} else if (hw_const != ARK_DDM_CONST2) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: DDM module not found as expected 0x%08x\n",
 			    ddm->cfg.const0);
 		return -1;
@@ -63,7 +63,7 @@ ark_ddm_reset(struct ark_ddm_t *ddm)
 	status = ark_ddm_stop(ddm, 1);
 
 	if (status != 0) {
-		PMD_DEBUG_LOG(INFO, "%s  stop failed  doing forced reset\n",
+		ARK_PMD_LOG(NOTICE, "%s  stop failed  doing forced reset\n",
 			      __func__);
 		ddm->cfg.command = 4;
 		usleep(10);
@@ -87,7 +87,7 @@ ark_ddm_stats_reset(struct ark_ddm_t *ddm)
 void
 ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
 {
-	PMD_FUNC_LOG(DEBUG, "%s Stopped: %d\n", msg,
+	ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
 		     ark_ddm_is_stopped(ddm)
 		     );
 }
@@ -97,7 +97,7 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
 {
 	struct ark_ddm_stats_t *stats = &ddm->stats;
 
-	PMD_STATS_LOG(INFO, "DDM Stats: %s"
+	ARK_PMD_LOG(INFO, "DDM Stats: %s"
 		      ARK_SU64 ARK_SU64 ARK_SU64
 		      "\n", msg,
 		      "Bytes:", stats->tx_byte_count,
drivers/net/ark/ark_ethdev.c +36 -41

285 lines not on this page · raw message

drivers/net/ark/ark_ethdev_rx.c +23 -23

152 lines not on this page · raw message

drivers/net/ark/ark_ethdev_tx.c +5 -5
index 289668774..72624deb3 100644
@@ -143,8 +143,8 @@ eth_ark_xmit_pkts(void *vtxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		}
 	}
 
-	if (ARK_TX_DEBUG && (nb != nb_pkts)) {
-		PMD_TX_LOG(DEBUG, "TX: Failure to send:"
+	if (ARK_DEBUG_CORE && nb != nb_pkts) {
+		ARK_PMD_LOG(DEBUG, "TX: Failure to send:"
 			   " req: %" PRIU32
 			   " sent: %" PRIU32
 			   " prod: %" PRIU32
@@ -214,7 +214,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 	int qidx = queue_idx;
 
 	if (!rte_is_power_of_2(nb_desc)) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "DPDK Arkville configuration queue size"
 			    " must be power of two %u (%s)\n",
 			    nb_desc, __func__);
@@ -227,7 +227,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 				   64,
 				   socket_id);
 	if (queue == 0) {
-		PMD_DRV_LOG(ERR, "Failed to allocate tx "
+		ARK_PMD_LOG(ERR, "Failed to allocate tx "
 			    "queue memory in %s\n",
 			    __func__);
 		return -ENOMEM;
@@ -252,7 +252,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 				   socket_id);
 
 	if (queue->meta_q == 0 || queue->bufs == 0) {
-		PMD_DRV_LOG(ERR, "Failed to allocate "
+		ARK_PMD_LOG(ERR, "Failed to allocate "
 			    "queue memory in %s\n", __func__);
 		rte_free(queue->meta_q);
 		rte_free(queue->bufs);
drivers/net/ark/ark_logs.h +6 -57

72 lines not on this page · raw message

drivers/net/ark/ark_mpu.c +8 -24
index 21f840f3c..8160c1de7 100644
@@ -28,7 +28,7 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
 	if ((mpu->id.idnum != 0x2055504d) ||
 	    (mpu->hw.obj_size != obj_size) ||
 	    (version != 0x00003100)) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "   MPU module not found as expected %08x"
 			    " \"%c%c%c%c %c%c%c%c\"\n",
 			    mpu->id.idnum,
@@ -36,7 +36,7 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
 			    mpu->id.id[2], mpu->id.id[3],
 			    mpu->id.ver[0], mpu->id.ver[1],
 			    mpu->id.ver[2], mpu->id.ver[3]);
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "   MPU HW num_queues: %u hw_depth %u,"
 			    " obj_size: %u, obj_per_mrr: %u"
 			    " Expected size %u\n",
@@ -95,7 +95,7 @@ ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
 	ark_mpu_reset(mpu);
 
 	if (!rte_is_power_of_2(ring_size)) {
-		PMD_DRV_LOG(ERR, "ARK: Invalid ring size for MPU %d\n",
+		ARK_PMD_LOG(ERR, "Invalid ring size for MPU %d\n",
 			    ring_size);
 		return -1;
 	}
@@ -114,37 +114,21 @@ void
 ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
 {
 	/* DUMP to see that we have started */
-	PMD_DEBUG_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
+	ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
 		      code, qid,
 		      mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
-	PMD_DEBUG_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
-		      " data 0x%08x_%08x 0x%08x_%08x\n",
+	ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
+		      "\n",
 		      code,
 		      mpu->debug.state, mpu->debug.count,
-		      mpu->debug.reserved,
-		      mpu->debug.peek[1],
-		      mpu->debug.peek[0],
-		      mpu->debug.peek[3],
-		      mpu->debug.peek[2]
-		      );
-	PMD_STATS_LOG(INFO, "MPU: %s Q: %3u"
-		      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64
-		      ARK_SU64 ARK_SU64 ARK_SU64 "\n",
-		      code, qid,
-		      "PCI Request:", mpu->stats.pci_request,
-		      "Queue_empty", mpu->stats.q_empty,
-		      "Queue_q1", mpu->stats.q_q1,
-		      "Queue_q2", mpu->stats.q_q2,
-		      "Queue_q3", mpu->stats.q_q3,
-		      "Queue_q4", mpu->stats.q_q4,
-		      "Queue_full", mpu->stats.q_full
+		      mpu->debug.reserved
 		      );
 }
 
 void
 ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t q_id)
 {
-	PMD_DEBUG_LOG(DEBUG, "MPU Setup Q: %u"
+	ARK_PMD_LOG(DEBUG, "MPU Setup Q: %u"
 		      ARK_SU64X "\n",
 		      q_id,
 		      "ring_base", mpu->cfg.ring_base
drivers/net/ark/ark_pktchkr.c +18 -18
index ef861eea3..b8fb69497 100644
@@ -85,7 +85,7 @@ ark_pktchkr_init(void *addr, int ord, int l2_mode)
 		rte_malloc("ark_pkt_chkr_inst",
 			   sizeof(struct ark_pkt_chkr_inst), 0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
 		return inst;
 	}
 	inst->sregs = (struct ark_pkt_chkr_stat_regs *)addr;
@@ -130,10 +130,10 @@ ark_pktchkr_stop(ark_pkt_chkr_t handle)
 	while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
+		ARK_PMD_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
 			      inst->ordinal);
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
 }
 
 int
@@ -189,7 +189,7 @@ ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
 	struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
 
 	if (ark_pktchkr_is_gen_forever(handle)) {
-		PMD_DEBUG_LOG(ERR, "Pktchk wait_done will not terminate"
+		ARK_PMD_LOG(NOTICE, "Pktchk wait_done will not terminate"
 			      " because gen_forever=1\n");
 		return -1;
 	}
@@ -198,10 +198,10 @@ ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
 	while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG, "Waiting for packet checker %d's"
+		ARK_PMD_LOG(DEBUG, "Waiting for packet checker %d's"
 			      " internal pktgen to finish sending...\n",
 			      inst->ordinal);
-		PMD_DEBUG_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
+		ARK_PMD_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
 			      inst->ordinal);
 	}
 	return 0;
@@ -296,25 +296,25 @@ ark_pktchkr_dump_stats(ark_pkt_chkr_t handle)
 {
 	struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
 
-	PMD_STATS_LOG(INFO, "pkts_rcvd      = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_rcvd      = (%'u)\n",
 		      inst->sregs->pkts_rcvd);
-	PMD_STATS_LOG(INFO, "bytes_rcvd     = (%'" PRIU64 ")\n",
+	ARK_PMD_LOG(INFO, "bytes_rcvd     = (%'" PRIU64 ")\n",
 		      inst->sregs->bytes_rcvd);
-	PMD_STATS_LOG(INFO, "pkts_ok        = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_ok        = (%'u)\n",
 		      inst->sregs->pkts_ok);
-	PMD_STATS_LOG(INFO, "pkts_mismatch  = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_mismatch  = (%'u)\n",
 		      inst->sregs->pkts_mismatch);
-	PMD_STATS_LOG(INFO, "pkts_err       = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_err       = (%'u)\n",
 		      inst->sregs->pkts_err);
-	PMD_STATS_LOG(INFO, "first_mismatch = (%'u)\n",
+	ARK_PMD_LOG(INFO, "first_mismatch = (%'u)\n",
 		      inst->sregs->first_mismatch);
-	PMD_STATS_LOG(INFO, "resync_events  = (%'u)\n",
+	ARK_PMD_LOG(INFO, "resync_events  = (%'u)\n",
 		      inst->sregs->resync_events);
-	PMD_STATS_LOG(INFO, "pkts_missing   = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_missing   = (%'u)\n",
 		      inst->sregs->pkts_missing);
-	PMD_STATS_LOG(INFO, "min_latency    = (%'u)\n",
+	ARK_PMD_LOG(INFO, "min_latency    = (%'u)\n",
 		      inst->sregs->min_latency);
-	PMD_STATS_LOG(INFO, "max_latency    = (%'u)\n",
+	ARK_PMD_LOG(INFO, "max_latency    = (%'u)\n",
 		      inst->sregs->max_latency);
 }
 
@@ -327,7 +327,7 @@ options(const char *id)
 		if (strcmp(id, toptions[i].opt) == 0)
 			return &toptions[i];
 	}
-	PMD_DRV_LOG(ERR,
+	ARK_PMD_LOG(ERR,
 		    "pktchkr: Could not find requested option!, option = %s\n",
 		    id);
 	return NULL;
@@ -443,7 +443,7 @@ ark_pktchkr_setup(ark_pkt_chkr_t handle)
 		ark_pktchkr_stop(handle);
 
 	if (options("run")->v.BOOL) {
-		PMD_DEBUG_LOG(DEBUG, "Starting packet checker on port %d\n",
+		ARK_PMD_LOG(DEBUG, "Starting packet checker on port %d\n",
 			      options("port")->v.INT);
 		ark_pktchkr_run(handle);
 	}
drivers/net/ark/ark_pktdir.c +1 -1
index 1f2c8182a..25e121831 100644
@@ -18,7 +18,7 @@ ark_pktdir_init(void *base)
 			   sizeof(struct ark_pkt_dir_inst),
 			   0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
 		return inst;
 	}
 	inst->regs = (struct ark_pkt_dir_regs *)base;
drivers/net/ark/ark_pktgen.c +11 -11
index 2cae252d6..4a02662a4 100644
@@ -83,7 +83,7 @@ ark_pktgen_init(void *adr, int ord, int l2_mode)
 		rte_malloc("ark_pkt_gen_inst_pmd",
 			   sizeof(struct ark_pkt_gen_inst), 0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
 		return inst;
 	}
 	inst->regs = (struct ark_pkt_gen_regs *)adr;
@@ -126,12 +126,12 @@ ark_pktgen_pause(ark_pkt_gen_t handle)
 	while (!ark_pktgen_paused(handle)) {
 		usleep(1000);
 		if (cnt++ > 100) {
-			PMD_DRV_LOG(ERR, "Pktgen %d failed to pause.\n",
+			ARK_PMD_LOG(NOTICE, "Pktgen %d failed to pause.\n",
 				    inst->ordinal);
 			break;
 		}
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
 }
 
 void
@@ -141,7 +141,7 @@ ark_pktgen_reset(ark_pkt_gen_t handle)
 
 	if (!ark_pktgen_is_running(handle) &&
 	    !ark_pktgen_paused(handle)) {
-		PMD_DEBUG_LOG(DEBUG, "Pktgen %d is not running"
+		ARK_PMD_LOG(DEBUG, "Pktgen %d is not running"
 			      " and is not paused. No need to reset.\n",
 			      inst->ordinal);
 		return;
@@ -149,13 +149,13 @@ ark_pktgen_reset(ark_pkt_gen_t handle)
 
 	if (ark_pktgen_is_running(handle) &&
 	    !ark_pktgen_paused(handle)) {
-		PMD_DEBUG_LOG(DEBUG,
+		ARK_PMD_LOG(DEBUG,
 			      "Pktgen %d is not paused. Pausing first.\n",
 			      inst->ordinal);
 		ark_pktgen_pause(handle);
 	}
 
-	PMD_DEBUG_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
 	inst->regs->pkt_start_stop = (1 << 8);
 }
 
@@ -193,17 +193,17 @@ ark_pktgen_wait_done(ark_pkt_gen_t handle)
 	int wait_cycle = 10;
 
 	if (ark_pktgen_is_gen_forever(handle))
-		PMD_DRV_LOG(ERR, "Pktgen wait_done will not terminate"
+		ARK_PMD_LOG(NOTICE, "Pktgen wait_done will not terminate"
 			    " because gen_forever=1\n");
 
 	while (!ark_pktgen_tx_done(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG,
+		ARK_PMD_LOG(DEBUG,
 			      "Waiting for pktgen %d to finish sending...\n",
 			      inst->ordinal);
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
 }
 
 uint32_t
@@ -306,7 +306,7 @@ options(const char *id)
 			return &toptions[i];
 	}
 
-	PMD_DRV_LOG(ERR,
+	ARK_PMD_LOG(ERR,
 		    "Pktgen: Could not find requested option!, "
 		    "option = %s\n",
 		    id
@@ -465,7 +465,7 @@ ark_pktgen_setup(ark_pkt_gen_t handle)
 	if (options("reset")->v.BOOL)
 		ark_pktgen_reset(handle);
 	if (options("run")->v.BOOL) {
-		PMD_DEBUG_LOG(DEBUG, "Starting packet generator on port %d\n",
+		ARK_PMD_LOG(DEBUG, "Starting packet generator on port %d\n",
 				options("port")->v.INT);
 		ark_pktgen_run(handle);
 	}
drivers/net/ark/ark_rqp.c +2 -2
index bf1af4d61..ef9ccd070 100644
@@ -23,7 +23,7 @@ void
 ark_rqp_dump(struct ark_rqpace_t *rqp)
 {
 	if (rqp->err_count_other != 0)
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
 			    ARK_SU32
 			    ARK_SU32 "\n",
@@ -31,7 +31,7 @@ ark_rqp_dump(struct ark_rqpace_t *rqp)
 			    "Error Count", rqp->err_cnt,
 			    "Error General", rqp->err_count_other);
 
-	PMD_STATS_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
+	ARK_PMD_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
 		      ARK_SU32
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
drivers/net/ark/ark_udm.c +9 -9
index 03f1922c6..a740d36d4 100644
@@ -11,14 +11,14 @@ int
 ark_udm_verify(struct ark_udm_t *udm)
 {
 	if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: UDM structure looks incorrect %d vs %zd\n",
 			    ARK_UDM_EXPECT_SIZE, sizeof(struct ark_udm_t));
 		return -1;
 	}
 
 	if (udm->setup.const0 != ARK_UDM_CONST) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: UDM module not found as expected 0x%08x\n",
 			    udm->setup.const0);
 		return -1;
@@ -49,13 +49,13 @@ ark_udm_reset(struct ark_udm_t *udm)
 
 	status = ark_udm_stop(udm, 1);
 	if (status != 0) {
-		PMD_DEBUG_LOG(INFO, "%s  stop failed  doing forced reset\n",
+		ARK_PMD_LOG(NOTICE, "%s  stop failed  doing forced reset\n",
 			      __func__);
 		udm->cfg.command = 4;
 		usleep(10);
 		udm->cfg.command = 3;
 		status = ark_udm_stop(udm, 0);
-		PMD_DEBUG_LOG(INFO, "%s  stop status %d post failure"
+		ARK_PMD_LOG(INFO, "%s  stop status %d post failure"
 			      " and forced reset\n",
 			      __func__, status);
 	} else {
@@ -125,7 +125,7 @@ ark_udm_packets(struct ark_udm_t *udm)
 void
 ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
 {
-	PMD_STATS_LOG(INFO, "UDM Stats: %s"
+	ARK_PMD_LOG(INFO, "UDM Stats: %s"
 		      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
 		      msg,
 		      "Pkts Received", udm->stats.rx_packet_count,
@@ -138,7 +138,7 @@ ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
 void
 ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
 {
-	PMD_STATS_LOG(INFO, "UDM Queue %3u Stats: %s"
+	ARK_PMD_LOG(INFO, "UDM Queue %3u Stats: %s"
 		      ARK_SU64 ARK_SU64
 		      ARK_SU64 ARK_SU64
 		      ARK_SU64 "\n",
@@ -153,14 +153,14 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
 void
 ark_udm_dump(struct ark_udm_t *udm, const char *msg)
 {
-	PMD_DEBUG_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
+	ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
 		      udm->cfg.stop_flushed);
 }
 
 void
 ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
 {
-	PMD_DEBUG_LOG(DEBUG, "UDM Setup Q: %u"
+	ARK_PMD_LOG(DEBUG, "UDM Setup Q: %u"
 		      ARK_SU64X ARK_SU32 "\n",
 		      q_id,
 		      "hw_prod_addr", udm->rt_cfg.hw_prod_addr,
@@ -172,7 +172,7 @@ ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
 {
 	struct ark_udm_pcibp_t *bp = &udm->pcibp;
 
-	PMD_STATS_LOG(INFO, "UDM Performance %s"
+	ARK_PMD_LOG(INFO, "UDM Performance %s"
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
 		      "\n",
 		      msg,
Signature · 1 line
2.17.1
author
#22 lore raw

PATCH 2/2 net/ark: remove RTE_LIBRTE_ARK_PAD_TX configuration macro

Replace behavior with RTE_LIBRTE_ARK_MIN_TX_PKTLEN with a default value of 0.
Update documentation as needed.

---
 doc/guides/nics/ark.rst         | 16 ++++++++----
 drivers/net/ark/ark_ethdev_tx.c | 43 ++++++++++++++++++---------------
 drivers/net/ark/ark_logs.h      |  8 ------
 3 files changed, 35 insertions(+), 32 deletions(-)
doc/guides/nics/ark.rst +11 -5
index c3ffcbbc2..c7ed4095f 100644
@@ -126,11 +126,10 @@ Configuration Information
 
   The following configuration options are available for the ARK PMD:
 
-   * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
-     of the ARK PMD driver in the DPDK compilation.
-
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
+   * **RTE_LIBRTE_ARK_MIN_TX_PKTLEN** (default 0): Sets the minimum
+     packet length for tx packets to the FPGA.  Packets less than this
+     length are padded to meet the requirement. This allows padding to
+     be offloaded or remain in host software.
 
 
 Building DPDK
@@ -144,6 +143,13 @@ By default the ARK PMD library will be built into the DPDK library.
 For configuring and using UIO and VFIO frameworks, please also refer :ref:`the
 documentation that comes with DPDK suite <linux_gsg>`.
 
+To build with a non-zero minimum tx packet length, set the above macro in your
+CFLAGS environment prior to the meson build step. I.e.,
+
+    export CFLAGS="-DRTE_LIBRTE_ARK_MIN_TX_PKTLEN=60"
+    meson build
+
+
 Supported ARK RTL PCIe Instances
 --------------------------------
 
drivers/net/ark/ark_ethdev_tx.c +24 -19

58 lines not on this page · raw message

drivers/net/ark/ark_logs.h +0 -8
index c3d7e7d39..ca46d86c9 100644
@@ -8,14 +8,6 @@
 #include <inttypes.h>
 #include <rte_log.h>
 
-
-/* Configuration option to pad TX packets to 60 bytes */
-#ifdef RTE_LIBRTE_ARK_PAD_TX
-#define ARK_TX_PAD_TO_60   1
-#else
-#define ARK_TX_PAD_TO_60   0
-#endif
-
 /* system camel case definition changed to upper case */
 #define PRIU32 PRIu32
 #define PRIU64 PRIu64
Signature · 1 line
2.17.1
#23 lore raw

Re: [dpdk-dev] [PATCH 2/2] net/ark: remove RTE_LIBRTE_ARK_PAD_TX configuration macro

Quoted 3 lines · Ed Czeck

Replace behavior with RTE_LIBRTE_ARK_MIN_TX_PKTLEN with a default value of 0.
Update documentation as needed.

Can you please use versions in the patches, it makes easier to follow them? Like '[PATCH v4 2/2]', -v# option to "git format-patch" or "git send-email" does it automatically for you.

Also a changelog history that documents what changes in each version helps, a good place to put it is just below the '---' after sign off, this way although it stays in the patch, it is removed automatically by git while merging the patch.

Quoted 13 lines
---
 doc/guides/nics/ark.rst         | 16 ++++++++----
 drivers/net/ark/ark_ethdev_tx.c | 43 ++++++++++++++++++---------------
 drivers/net/ark/ark_logs.h      |  8 ------
 3 files changed, 35 insertions(+), 32 deletions(-)
doc/guides/nics/ark.rst +0 -0
index c3ffcbbc2..c7ed4095f 100644

doc/guides/nics/ark.rst Configuration Information · line 131

Quoted 6 lines
doc/guides/nics/ark.rst +0 -3
@@ -126,11 +126,10 @@ Configuration Information
 
   The following configuration options are available for the ARK PMD:
 
-   * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
-     of the ARK PMD driver in the DPDK compilation.
-

Hi Ed,

Can you leave out this piece in this patch? Yes it will go away eventually, but it is not related logically to this change. Let's leave removing it to the patch that removes Makefile which will be removing all relevant pieces as a whole.

Quoted 40 lines
doc/guides/nics/ark.rst +11 -2
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
+   * **RTE_LIBRTE_ARK_MIN_TX_PKTLEN** (default 0): Sets the minimum
+     packet length for tx packets to the FPGA.  Packets less than this
+     length are padded to meet the requirement. This allows padding to
+     be offloaded or remain in host software.
 
 
 Building DPDK
@@ -144,6 +143,13 @@ By default the ARK PMD library will be built into the DPDK library.
 For configuring and using UIO and VFIO frameworks, please also refer :ref:`the
 documentation that comes with DPDK suite <linux_gsg>`.
 
+To build with a non-zero minimum tx packet length, set the above macro in your
+CFLAGS environment prior to the meson build step. I.e.,
+
+    export CFLAGS="-DRTE_LIBRTE_ARK_MIN_TX_PKTLEN=60"
+    meson build
+
+
 Supported ARK RTL PCIe Instances
 --------------------------------
 
drivers/net/ark/ark_ethdev_tx.c +5 -0
index 72624deb3..52ce2ed41 100644
@@ -14,6 +14,11 @@
 #define ARK_TX_META_OFFSET (RTE_PKTMBUF_HEADROOM - ARK_TX_META_SIZE)
 #define ARK_TX_MAX_NOCHAIN (RTE_MBUF_DEFAULT_DATAROOM)
 
+#ifndef RTE_LIBRTE_ARK_MIN_TX_PKTLEN
+#define ARK_MIN_TX_PKTLEN 0
+#else
+#define ARK_MIN_TX_PKTLEN RTE_LIBRTE_ARK_MIN_TX_PKTLEN
+#endif
 
 /* ************************************************************************* */
 struct ark_tx_queue {

drivers/net/ark/ark_ethdev_tx.c eth_ark_xmit_pkts(void *vtxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts) · line 112

Quoted 8 lines
drivers/net/ark/ark_ethdev_tx.c +1 -4
@@ -104,28 +109,28 @@ eth_ark_xmit_pkts(void *vtxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 	     ++nb) {
 		mbuf = tx_pkts[nb];
 
-		if (ARK_TX_PAD_TO_60) {
-			if (unlikely(rte_pktmbuf_pkt_len(mbuf) < 60)) {
-				/* this packet even if it is small can be split,
-				 * be sure to add to the end mbuf
+#if ARK_MIN_TX_PKTLEN != 0

Previous "if (...)" approach was better, compiler was checking the code independent from 'RTE_LIBRTE_ARK_MIN_TX_PKTLEN' defined or not, and compiler was optimizing out the code if it is not defined.
With the '#if' macro, we are losing the compiler check.

If there is no explicit reason, can you keep the old behavior here?

author
#24 lore raw

PATCH v7 1/2 net/ark: remove compile time log macros in favor of run time log control

In reply to Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

---
 doc/guides/nics/ark.rst         | 13 ------
 drivers/net/ark/ark_ddm.c       | 12 ++---
 drivers/net/ark/ark_ethdev.c    | 77 +++++++++++++++------------------
 drivers/net/ark/ark_ethdev_rx.c | 46 ++++++++++----------
 drivers/net/ark/ark_ethdev_tx.c | 10 ++---
 drivers/net/ark/ark_logs.h      | 63 +++------------------------
 drivers/net/ark/ark_mpu.c       | 32 ++++----------
 drivers/net/ark/ark_pktchkr.c   | 36 +++++++--------
 drivers/net/ark/ark_pktdir.c    |  2 +-
 drivers/net/ark/ark_pktgen.c    | 22 +++++-----
 drivers/net/ark/ark_rqp.c       |  4 +-
 drivers/net/ark/ark_udm.c       | 18 ++++----
 12 files changed, 125 insertions(+), 210 deletions(-)
doc/guides/nics/ark.rst +0 -13
index 06e8c3374..c3ffcbbc2 100644
@@ -132,19 +132,6 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
      packets are padded to 60 bytes to support downstream MACS.
 
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_RX** (default n): Enables or disables debug
-     logging and internal checking of RX ingress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TX** (default n): Enables or disables debug
-     logging and internal checking of TX egress logic within the ARK PMD driver.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_STATS** (default n): Enables or disables debug
-     logging of detailed packet and performance statistics gathered in
-     the PMD and FPGA.
-
-   * **CONFIG_RTE_LIBRTE_ARK_DEBUG_TRACE** (default n): Enables or disables debug
-     logging of detailed PMD events and status.
-
 
 Building DPDK
 -------------
drivers/net/ark/ark_ddm.c +6 -6
index 57026f8d1..91d1179d8 100644
@@ -13,19 +13,19 @@ ark_ddm_verify(struct ark_ddm_t *ddm)
 {
 	uint32_t hw_const;
 	if (sizeof(struct ark_ddm_t) != ARK_DDM_EXPECTED_SIZE) {
-		PMD_DRV_LOG(ERR, "ARK: DDM structure looks incorrect %d vs %zd\n",
+		ARK_PMD_LOG(ERR, "DDM structure looks incorrect %d vs %zd\n",
 			    ARK_DDM_EXPECTED_SIZE, sizeof(struct ark_ddm_t));
 		return -1;
 	}
 
 	hw_const = ddm->cfg.const0;
 	if (hw_const == ARK_DDM_CONST1) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: DDM module is version 1, "
 			    "PMD expects version 2\n");
 		return -1;
 	} else if (hw_const != ARK_DDM_CONST2) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: DDM module not found as expected 0x%08x\n",
 			    ddm->cfg.const0);
 		return -1;
@@ -63,7 +63,7 @@ ark_ddm_reset(struct ark_ddm_t *ddm)
 	status = ark_ddm_stop(ddm, 1);
 
 	if (status != 0) {
-		PMD_DEBUG_LOG(INFO, "%s  stop failed  doing forced reset\n",
+		ARK_PMD_LOG(NOTICE, "%s  stop failed  doing forced reset\n",
 			      __func__);
 		ddm->cfg.command = 4;
 		usleep(10);
@@ -87,7 +87,7 @@ ark_ddm_stats_reset(struct ark_ddm_t *ddm)
 void
 ark_ddm_dump(struct ark_ddm_t *ddm, const char *msg)
 {
-	PMD_FUNC_LOG(DEBUG, "%s Stopped: %d\n", msg,
+	ARK_PMD_LOG(DEBUG, "%s Stopped: %d\n", msg,
 		     ark_ddm_is_stopped(ddm)
 		     );
 }
@@ -97,7 +97,7 @@ ark_ddm_dump_stats(struct ark_ddm_t *ddm, const char *msg)
 {
 	struct ark_ddm_stats_t *stats = &ddm->stats;
 
-	PMD_STATS_LOG(INFO, "DDM Stats: %s"
+	ARK_PMD_LOG(INFO, "DDM Stats: %s"
 		      ARK_SU64 ARK_SU64 ARK_SU64
 		      "\n", msg,
 		      "Bytes:", stats->tx_byte_count,
drivers/net/ark/ark_ethdev.c +36 -41

285 lines not on this page · raw message

drivers/net/ark/ark_ethdev_rx.c +23 -23

152 lines not on this page · raw message

drivers/net/ark/ark_ethdev_tx.c +5 -5
index 289668774..72624deb3 100644
@@ -143,8 +143,8 @@ eth_ark_xmit_pkts(void *vtxq, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)
 		}
 	}
 
-	if (ARK_TX_DEBUG && (nb != nb_pkts)) {
-		PMD_TX_LOG(DEBUG, "TX: Failure to send:"
+	if (ARK_DEBUG_CORE && nb != nb_pkts) {
+		ARK_PMD_LOG(DEBUG, "TX: Failure to send:"
 			   " req: %" PRIU32
 			   " sent: %" PRIU32
 			   " prod: %" PRIU32
@@ -214,7 +214,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 	int qidx = queue_idx;
 
 	if (!rte_is_power_of_2(nb_desc)) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "DPDK Arkville configuration queue size"
 			    " must be power of two %u (%s)\n",
 			    nb_desc, __func__);
@@ -227,7 +227,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 				   64,
 				   socket_id);
 	if (queue == 0) {
-		PMD_DRV_LOG(ERR, "Failed to allocate tx "
+		ARK_PMD_LOG(ERR, "Failed to allocate tx "
 			    "queue memory in %s\n",
 			    __func__);
 		return -ENOMEM;
@@ -252,7 +252,7 @@ eth_ark_tx_queue_setup(struct rte_eth_dev *dev,
 				   socket_id);
 
 	if (queue->meta_q == 0 || queue->bufs == 0) {
-		PMD_DRV_LOG(ERR, "Failed to allocate "
+		ARK_PMD_LOG(ERR, "Failed to allocate "
 			    "queue memory in %s\n", __func__);
 		rte_free(queue->meta_q);
 		rte_free(queue->bufs);
drivers/net/ark/ark_logs.h +6 -57

72 lines not on this page · raw message

drivers/net/ark/ark_mpu.c +8 -24
index 21f840f3c..8160c1de7 100644
@@ -28,7 +28,7 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
 	if ((mpu->id.idnum != 0x2055504d) ||
 	    (mpu->hw.obj_size != obj_size) ||
 	    (version != 0x00003100)) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "   MPU module not found as expected %08x"
 			    " \"%c%c%c%c %c%c%c%c\"\n",
 			    mpu->id.idnum,
@@ -36,7 +36,7 @@ ark_mpu_verify(struct ark_mpu_t *mpu, uint32_t obj_size)
 			    mpu->id.id[2], mpu->id.id[3],
 			    mpu->id.ver[0], mpu->id.ver[1],
 			    mpu->id.ver[2], mpu->id.ver[3]);
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "   MPU HW num_queues: %u hw_depth %u,"
 			    " obj_size: %u, obj_per_mrr: %u"
 			    " Expected size %u\n",
@@ -95,7 +95,7 @@ ark_mpu_configure(struct ark_mpu_t *mpu, rte_iova_t ring, uint32_t ring_size,
 	ark_mpu_reset(mpu);
 
 	if (!rte_is_power_of_2(ring_size)) {
-		PMD_DRV_LOG(ERR, "ARK: Invalid ring size for MPU %d\n",
+		ARK_PMD_LOG(ERR, "Invalid ring size for MPU %d\n",
 			    ring_size);
 		return -1;
 	}
@@ -114,37 +114,21 @@ void
 ark_mpu_dump(struct ark_mpu_t *mpu, const char *code, uint16_t qid)
 {
 	/* DUMP to see that we have started */
-	PMD_DEBUG_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
+	ARK_PMD_LOG(DEBUG, "MPU: %s Q: %3u sw_prod %u, hw_cons: %u\n",
 		      code, qid,
 		      mpu->cfg.sw_prod_index, mpu->cfg.hw_cons_index);
-	PMD_DEBUG_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
-		      " data 0x%08x_%08x 0x%08x_%08x\n",
+	ARK_PMD_LOG(DEBUG, "MPU: %s state: %d count %d, reserved %d"
+		      "\n",
 		      code,
 		      mpu->debug.state, mpu->debug.count,
-		      mpu->debug.reserved,
-		      mpu->debug.peek[1],
-		      mpu->debug.peek[0],
-		      mpu->debug.peek[3],
-		      mpu->debug.peek[2]
-		      );
-	PMD_STATS_LOG(INFO, "MPU: %s Q: %3u"
-		      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64
-		      ARK_SU64 ARK_SU64 ARK_SU64 "\n",
-		      code, qid,
-		      "PCI Request:", mpu->stats.pci_request,
-		      "Queue_empty", mpu->stats.q_empty,
-		      "Queue_q1", mpu->stats.q_q1,
-		      "Queue_q2", mpu->stats.q_q2,
-		      "Queue_q3", mpu->stats.q_q3,
-		      "Queue_q4", mpu->stats.q_q4,
-		      "Queue_full", mpu->stats.q_full
+		      mpu->debug.reserved
 		      );
 }
 
 void
 ark_mpu_dump_setup(struct ark_mpu_t *mpu, uint16_t q_id)
 {
-	PMD_DEBUG_LOG(DEBUG, "MPU Setup Q: %u"
+	ARK_PMD_LOG(DEBUG, "MPU Setup Q: %u"
 		      ARK_SU64X "\n",
 		      q_id,
 		      "ring_base", mpu->cfg.ring_base
drivers/net/ark/ark_pktchkr.c +18 -18
index ef861eea3..b8fb69497 100644
@@ -85,7 +85,7 @@ ark_pktchkr_init(void *addr, int ord, int l2_mode)
 		rte_malloc("ark_pkt_chkr_inst",
 			   sizeof(struct ark_pkt_chkr_inst), 0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_chkr_inst.\n");
 		return inst;
 	}
 	inst->sregs = (struct ark_pkt_chkr_stat_regs *)addr;
@@ -130,10 +130,10 @@ ark_pktchkr_stop(ark_pkt_chkr_t handle)
 	while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
+		ARK_PMD_LOG(DEBUG, "Waiting for pktchk %d to stop...\n",
 			      inst->ordinal);
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktchk %d stopped.\n", inst->ordinal);
 }
 
 int
@@ -189,7 +189,7 @@ ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
 	struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
 
 	if (ark_pktchkr_is_gen_forever(handle)) {
-		PMD_DEBUG_LOG(ERR, "Pktchk wait_done will not terminate"
+		ARK_PMD_LOG(NOTICE, "Pktchk wait_done will not terminate"
 			      " because gen_forever=1\n");
 		return -1;
 	}
@@ -198,10 +198,10 @@ ark_pktchkr_wait_done(ark_pkt_chkr_t handle)
 	while (!ark_pktchkr_stopped(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG, "Waiting for packet checker %d's"
+		ARK_PMD_LOG(DEBUG, "Waiting for packet checker %d's"
 			      " internal pktgen to finish sending...\n",
 			      inst->ordinal);
-		PMD_DEBUG_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
+		ARK_PMD_LOG(DEBUG, "Pktchk %d's pktgen done.\n",
 			      inst->ordinal);
 	}
 	return 0;
@@ -296,25 +296,25 @@ ark_pktchkr_dump_stats(ark_pkt_chkr_t handle)
 {
 	struct ark_pkt_chkr_inst *inst = (struct ark_pkt_chkr_inst *)handle;
 
-	PMD_STATS_LOG(INFO, "pkts_rcvd      = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_rcvd      = (%'u)\n",
 		      inst->sregs->pkts_rcvd);
-	PMD_STATS_LOG(INFO, "bytes_rcvd     = (%'" PRIU64 ")\n",
+	ARK_PMD_LOG(INFO, "bytes_rcvd     = (%'" PRIU64 ")\n",
 		      inst->sregs->bytes_rcvd);
-	PMD_STATS_LOG(INFO, "pkts_ok        = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_ok        = (%'u)\n",
 		      inst->sregs->pkts_ok);
-	PMD_STATS_LOG(INFO, "pkts_mismatch  = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_mismatch  = (%'u)\n",
 		      inst->sregs->pkts_mismatch);
-	PMD_STATS_LOG(INFO, "pkts_err       = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_err       = (%'u)\n",
 		      inst->sregs->pkts_err);
-	PMD_STATS_LOG(INFO, "first_mismatch = (%'u)\n",
+	ARK_PMD_LOG(INFO, "first_mismatch = (%'u)\n",
 		      inst->sregs->first_mismatch);
-	PMD_STATS_LOG(INFO, "resync_events  = (%'u)\n",
+	ARK_PMD_LOG(INFO, "resync_events  = (%'u)\n",
 		      inst->sregs->resync_events);
-	PMD_STATS_LOG(INFO, "pkts_missing   = (%'u)\n",
+	ARK_PMD_LOG(INFO, "pkts_missing   = (%'u)\n",
 		      inst->sregs->pkts_missing);
-	PMD_STATS_LOG(INFO, "min_latency    = (%'u)\n",
+	ARK_PMD_LOG(INFO, "min_latency    = (%'u)\n",
 		      inst->sregs->min_latency);
-	PMD_STATS_LOG(INFO, "max_latency    = (%'u)\n",
+	ARK_PMD_LOG(INFO, "max_latency    = (%'u)\n",
 		      inst->sregs->max_latency);
 }
 
@@ -327,7 +327,7 @@ options(const char *id)
 		if (strcmp(id, toptions[i].opt) == 0)
 			return &toptions[i];
 	}
-	PMD_DRV_LOG(ERR,
+	ARK_PMD_LOG(ERR,
 		    "pktchkr: Could not find requested option!, option = %s\n",
 		    id);
 	return NULL;
@@ -443,7 +443,7 @@ ark_pktchkr_setup(ark_pkt_chkr_t handle)
 		ark_pktchkr_stop(handle);
 
 	if (options("run")->v.BOOL) {
-		PMD_DEBUG_LOG(DEBUG, "Starting packet checker on port %d\n",
+		ARK_PMD_LOG(DEBUG, "Starting packet checker on port %d\n",
 			      options("port")->v.INT);
 		ark_pktchkr_run(handle);
 	}
drivers/net/ark/ark_pktdir.c +1 -1
index 1f2c8182a..25e121831 100644
@@ -18,7 +18,7 @@ ark_pktdir_init(void *base)
 			   sizeof(struct ark_pkt_dir_inst),
 			   0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_dir_inst.\n");
 		return inst;
 	}
 	inst->regs = (struct ark_pkt_dir_regs *)base;
drivers/net/ark/ark_pktgen.c +11 -11
index 2cae252d6..4a02662a4 100644
@@ -83,7 +83,7 @@ ark_pktgen_init(void *adr, int ord, int l2_mode)
 		rte_malloc("ark_pkt_gen_inst_pmd",
 			   sizeof(struct ark_pkt_gen_inst), 0);
 	if (inst == NULL) {
-		PMD_DRV_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
+		ARK_PMD_LOG(ERR, "Failed to malloc ark_pkt_gen_inst.\n");
 		return inst;
 	}
 	inst->regs = (struct ark_pkt_gen_regs *)adr;
@@ -126,12 +126,12 @@ ark_pktgen_pause(ark_pkt_gen_t handle)
 	while (!ark_pktgen_paused(handle)) {
 		usleep(1000);
 		if (cnt++ > 100) {
-			PMD_DRV_LOG(ERR, "Pktgen %d failed to pause.\n",
+			ARK_PMD_LOG(NOTICE, "Pktgen %d failed to pause.\n",
 				    inst->ordinal);
 			break;
 		}
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktgen %d paused.\n", inst->ordinal);
 }
 
 void
@@ -141,7 +141,7 @@ ark_pktgen_reset(ark_pkt_gen_t handle)
 
 	if (!ark_pktgen_is_running(handle) &&
 	    !ark_pktgen_paused(handle)) {
-		PMD_DEBUG_LOG(DEBUG, "Pktgen %d is not running"
+		ARK_PMD_LOG(DEBUG, "Pktgen %d is not running"
 			      " and is not paused. No need to reset.\n",
 			      inst->ordinal);
 		return;
@@ -149,13 +149,13 @@ ark_pktgen_reset(ark_pkt_gen_t handle)
 
 	if (ark_pktgen_is_running(handle) &&
 	    !ark_pktgen_paused(handle)) {
-		PMD_DEBUG_LOG(DEBUG,
+		ARK_PMD_LOG(DEBUG,
 			      "Pktgen %d is not paused. Pausing first.\n",
 			      inst->ordinal);
 		ark_pktgen_pause(handle);
 	}
 
-	PMD_DEBUG_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Resetting pktgen %d.\n", inst->ordinal);
 	inst->regs->pkt_start_stop = (1 << 8);
 }
 
@@ -193,17 +193,17 @@ ark_pktgen_wait_done(ark_pkt_gen_t handle)
 	int wait_cycle = 10;
 
 	if (ark_pktgen_is_gen_forever(handle))
-		PMD_DRV_LOG(ERR, "Pktgen wait_done will not terminate"
+		ARK_PMD_LOG(NOTICE, "Pktgen wait_done will not terminate"
 			    " because gen_forever=1\n");
 
 	while (!ark_pktgen_tx_done(handle) && (wait_cycle > 0)) {
 		usleep(1000);
 		wait_cycle--;
-		PMD_DEBUG_LOG(DEBUG,
+		ARK_PMD_LOG(DEBUG,
 			      "Waiting for pktgen %d to finish sending...\n",
 			      inst->ordinal);
 	}
-	PMD_DEBUG_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
+	ARK_PMD_LOG(DEBUG, "Pktgen %d done.\n", inst->ordinal);
 }
 
 uint32_t
@@ -306,7 +306,7 @@ options(const char *id)
 			return &toptions[i];
 	}
 
-	PMD_DRV_LOG(ERR,
+	ARK_PMD_LOG(ERR,
 		    "Pktgen: Could not find requested option!, "
 		    "option = %s\n",
 		    id
@@ -465,7 +465,7 @@ ark_pktgen_setup(ark_pkt_gen_t handle)
 	if (options("reset")->v.BOOL)
 		ark_pktgen_reset(handle);
 	if (options("run")->v.BOOL) {
-		PMD_DEBUG_LOG(DEBUG, "Starting packet generator on port %d\n",
+		ARK_PMD_LOG(DEBUG, "Starting packet generator on port %d\n",
 				options("port")->v.INT);
 		ark_pktgen_run(handle);
 	}
drivers/net/ark/ark_rqp.c +2 -2
index bf1af4d61..ef9ccd070 100644
@@ -23,7 +23,7 @@ void
 ark_rqp_dump(struct ark_rqpace_t *rqp)
 {
 	if (rqp->err_count_other != 0)
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "RQP Errors noted: ctrl: %d cplh_hmax %d cpld_max %d"
 			    ARK_SU32
 			    ARK_SU32 "\n",
@@ -31,7 +31,7 @@ ark_rqp_dump(struct ark_rqpace_t *rqp)
 			    "Error Count", rqp->err_cnt,
 			    "Error General", rqp->err_count_other);
 
-	PMD_STATS_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
+	ARK_PMD_LOG(INFO, "RQP Dump: ctrl: %d cplh_hmax %d cpld_max %d"
 		      ARK_SU32
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
drivers/net/ark/ark_udm.c +9 -9
index 03f1922c6..a740d36d4 100644
@@ -11,14 +11,14 @@ int
 ark_udm_verify(struct ark_udm_t *udm)
 {
 	if (sizeof(struct ark_udm_t) != ARK_UDM_EXPECT_SIZE) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: UDM structure looks incorrect %d vs %zd\n",
 			    ARK_UDM_EXPECT_SIZE, sizeof(struct ark_udm_t));
 		return -1;
 	}
 
 	if (udm->setup.const0 != ARK_UDM_CONST) {
-		PMD_DRV_LOG(ERR,
+		ARK_PMD_LOG(ERR,
 			    "ARK: UDM module not found as expected 0x%08x\n",
 			    udm->setup.const0);
 		return -1;
@@ -49,13 +49,13 @@ ark_udm_reset(struct ark_udm_t *udm)
 
 	status = ark_udm_stop(udm, 1);
 	if (status != 0) {
-		PMD_DEBUG_LOG(INFO, "%s  stop failed  doing forced reset\n",
+		ARK_PMD_LOG(NOTICE, "%s  stop failed  doing forced reset\n",
 			      __func__);
 		udm->cfg.command = 4;
 		usleep(10);
 		udm->cfg.command = 3;
 		status = ark_udm_stop(udm, 0);
-		PMD_DEBUG_LOG(INFO, "%s  stop status %d post failure"
+		ARK_PMD_LOG(INFO, "%s  stop status %d post failure"
 			      " and forced reset\n",
 			      __func__, status);
 	} else {
@@ -125,7 +125,7 @@ ark_udm_packets(struct ark_udm_t *udm)
 void
 ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
 {
-	PMD_STATS_LOG(INFO, "UDM Stats: %s"
+	ARK_PMD_LOG(INFO, "UDM Stats: %s"
 		      ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 ARK_SU64 "\n",
 		      msg,
 		      "Pkts Received", udm->stats.rx_packet_count,
@@ -138,7 +138,7 @@ ark_udm_dump_stats(struct ark_udm_t *udm, const char *msg)
 void
 ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
 {
-	PMD_STATS_LOG(INFO, "UDM Queue %3u Stats: %s"
+	ARK_PMD_LOG(INFO, "UDM Queue %3u Stats: %s"
 		      ARK_SU64 ARK_SU64
 		      ARK_SU64 ARK_SU64
 		      ARK_SU64 "\n",
@@ -153,14 +153,14 @@ ark_udm_dump_queue_stats(struct ark_udm_t *udm, const char *msg, uint16_t qid)
 void
 ark_udm_dump(struct ark_udm_t *udm, const char *msg)
 {
-	PMD_DEBUG_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
+	ARK_PMD_LOG(DEBUG, "UDM Dump: %s Stopped: %d\n", msg,
 		      udm->cfg.stop_flushed);
 }
 
 void
 ark_udm_dump_setup(struct ark_udm_t *udm, uint16_t q_id)
 {
-	PMD_DEBUG_LOG(DEBUG, "UDM Setup Q: %u"
+	ARK_PMD_LOG(DEBUG, "UDM Setup Q: %u"
 		      ARK_SU64X ARK_SU32 "\n",
 		      q_id,
 		      "hw_prod_addr", udm->rt_cfg.hw_prod_addr,
@@ -172,7 +172,7 @@ ark_udm_dump_perf(struct ark_udm_t *udm, const char *msg)
 {
 	struct ark_udm_pcibp_t *bp = &udm->pcibp;
 
-	PMD_STATS_LOG(INFO, "UDM Performance %s"
+	ARK_PMD_LOG(INFO, "UDM Performance %s"
 		      ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32 ARK_SU32
 		      "\n",
 		      msg,
Signature · 1 line
2.17.1
author
#25 lore raw

PATCH v7 2/2 net/ark: remove RTE_LIBRTE_ARK_PAD_TX configuration macro

Replace behavior with RTE_LIBRTE_ARK_MIN_TX_PKTLEN with a default value of 0.
Update documentation as needed.

---
v7:
-- add ARK_MIN_TX_PKTLEN to conditional expression
to avoid compile warning with icc.
-- restore CONFIG_RTE_LIBRTE_ARK_PMD doc as requested.

---
 doc/guides/nics/ark.rst         | 13 ++++++++--
 drivers/net/ark/ark_ethdev_tx.c | 43 ++++++++++++++++++---------------
 drivers/net/ark/ark_logs.h      |  8 ------
 3 files changed, 35 insertions(+), 29 deletions(-)
doc/guides/nics/ark.rst +11 -2
index c3ffcbbc2..358e7f624 100644
@@ -129,8 +129,10 @@ Configuration Information
    * **CONFIG_RTE_LIBRTE_ARK_PMD** (default y): Enables or disables inclusion
      of the ARK PMD driver in the DPDK compilation.
 
-   * **CONFIG_RTE_LIBRTE_ARK_PAD_TX** (default y):  When enabled TX
-     packets are padded to 60 bytes to support downstream MACS.
+   * **RTE_LIBRTE_ARK_MIN_TX_PKTLEN** (default 0): Sets the minimum
+     packet length for tx packets to the FPGA.  Packets less than this
+     length are padded to meet the requirement. This allows padding to
+     be offloaded or remain in host software.
 
 
 Building DPDK
@@ -144,6 +146,13 @@ By default the ARK PMD library will be built into the DPDK library.
 For configuring and using UIO and VFIO frameworks, please also refer :ref:`the
 documentation that comes with DPDK suite <linux_gsg>`.
 
+To build with a non-zero minimum tx packet length, set the above macro in your
+CFLAGS environment prior to the meson build step. I.e.,
+
+    export CFLAGS="-DRTE_LIBRTE_ARK_MIN_TX_PKTLEN=60"
+    meson build
+
+
 Supported ARK RTL PCIe Instances
 --------------------------------
 
drivers/net/ark/ark_ethdev_tx.c +24 -19

63 lines not on this page · raw message

drivers/net/ark/ark_logs.h +0 -8
index c3d7e7d39..ca46d86c9 100644
@@ -8,14 +8,6 @@
 #include <inttypes.h>
 #include <rte_log.h>
 
-
-/* Configuration option to pad TX packets to 60 bytes */
-#ifdef RTE_LIBRTE_ARK_PAD_TX
-#define ARK_TX_PAD_TO_60   1
-#else
-#define ARK_TX_PAD_TO_60   0
-#endif
-
 /* system camel case definition changed to upper case */
 #define PRIU32 PRIu32
 #define PRIU64 PRIu64
Signature · 1 line
2.17.1
Reviewed-by on v7 1/2
#26 lore raw

Re: [dpdk-dev] [PATCH v7 1/2] net/ark: remove compile time log macros in favor of run time log control

In reply to Ed Czeck
Quoted 5 lines · Ed Czeck

Use ARK_PMD_LOG in place of PMD_DRV_LOG, PMD_DEBUG_LOG, PMD_FUNC_LOG, PMD_STATS_LOG, PMD_RX_LOG, and PMD_TX_LOG.
Review and adjust log levels and messages as needed.

For series,

Series applied to dpdk-next-net/main, thanks.