diff mbox series

[v5,8/8] net/igc: refine debug build option

Message ID 20210323110749.2306452-9-qi.z.zhang@intel.com (mailing list archive)
State Superseded
Delegated to: Ferruh Yigit
Headers show
Series ether: refine debug build option | expand

Checks

Context Check Description
ci/iol-testing success Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/github-robot success github build: passed
ci/travis-robot success travis build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/intel-Testing success Testing PASS
ci/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Zhang, Qi Z March 23, 2021, 11:07 a.m. UTC
1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX

Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
---
 drivers/net/igc/igc_logs.h | 4 ++--
 drivers/net/igc/igc_txrx.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

Comments

Ferruh Yigit March 24, 2021, 7:27 p.m. UTC | #1
On 3/23/2021 11:07 AM, Qi Zhang wrote:
> 1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
> 2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
> 3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX
> 
> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>

CI is reporting a build error [1], I don't reproduce the error and I assume it 
is false positive but can you please check it?

Also cc'ed Zhaoyan & Aaron for the possible CI issue.

[1]
http://mails.dpdk.org/archives/test-report/2021-March/184153.html
David Marchand March 24, 2021, 8:31 p.m. UTC | #2
On Wed, Mar 24, 2021 at 8:27 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 3/23/2021 11:07 AM, Qi Zhang wrote:
> > 1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
> > 2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
> > 3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX
> >
> > Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>
> CI is reporting a build error [1], I don't reproduce the error and I assume it
> is false positive but can you please check it?
>
> Also cc'ed Zhaoyan & Aaron for the possible CI issue.
>
> [1]
> http://mails.dpdk.org/archives/test-report/2021-March/184153.html
>

Not sure what gcc+debug target is, but I guess it passes the old config item.
The compat stuff should be placed in rte_config.h (or something
similar to config/rte_compatibility_defines.h) and not in
lib/librte_ethdev/rte_ethdev.h.

To reproduce:
$ meson configure $HOME/builds/build-gcc-static/
-Dc_args="-DRTE_LIBRTE_ETHDEV_DEBUG=1"
$ ./devtools/test-meson-builds.sh
...
FAILED: drivers/librte_net_e1000.so.21.2
gcc  -o drivers/librte_net_e1000.so.21.2
drivers/librte_net_e1000.so.21.2.p/meson-generated_.._rte_net_e1000.pmd.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_base.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_80003es2lan.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82540.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82541.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82542.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82543.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82571.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_82575.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_api.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_i210.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_ich8lan.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_mac.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_manage.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_mbx.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_nvm.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_osdep.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_phy.c.o
drivers/net/e1000/base/libe1000_base.a.p/e1000_vf.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_e1000_logs.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_ethdev.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_ethdev.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_flow.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_pf.c.o
drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o
-I/home/dmarchan/intel-ipsec-mb/install/include
-L/home/dmarchan/intel-ipsec-mb/install/lib -Wl,--as-needed
-Wl,--no-undefined -shared -fPIC -Wl,--start-group
-Wl,-soname,librte_net_e1000.so.21 -Wl,--no-as-needed -pthread -lm
-ldl -lnuma -lfdt lib/librte_ethdev.so.21.2 lib/librte_eal.so.21.2
lib/librte_kvargs.so.21.2 lib/librte_telemetry.so.21.2
lib/librte_net.so.21.2 lib/librte_mbuf.so.21.2
lib/librte_mempool.so.21.2 lib/librte_ring.so.21.2
lib/librte_meter.so.21.2 drivers/librte_bus_pci.so.21.2
lib/librte_pci.so.21.2 drivers/librte_bus_vdev.so.21.2
-Wl,--version-script=/home/dmarchan/dpdk/drivers/net/e1000/version.map
/usr/lib64/libbsd.so -Wl,--end-group
'-Wl,-rpath,$ORIGIN/../lib:$ORIGIN/'
-Wl,-rpath-link,/home/dmarchan/builds/build-gcc-static/lib
-Wl,-rpath-link,/home/dmarchan/builds/build-gcc-static/drivers
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:
in function `eth_em_xmit_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:400:
undefined reference to `e1000_logtype_tx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:
in function `rte_prefetch0':
/home/dmarchan/builds/build-gcc-static/../../dpdk/lib/librte_eal/x86/include/rte_prefetch.h:17:
undefined reference to `e1000_logtype_tx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:
in function `em_xmit_cleanup':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:314:
undefined reference to `e1000_logtype_tx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:
in function `eth_em_recv_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:743:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:751:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:836:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:
in function `eth_em_recv_scattered_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:923:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:931:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_em_rxtx.c.o:/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/em_rxtx.c:1081:
more undefined references to `e1000_logtype_rx' follow
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o:
in function `eth_igb_xmit_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:409:
undefined reference to `e1000_logtype_tx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o:
in function `rte_prefetch0':
/home/dmarchan/builds/build-gcc-static/../../dpdk/lib/librte_eal/x86/include/rte_prefetch.h:17:
undefined reference to `e1000_logtype_tx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o:
in function `eth_igb_recv_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:871:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:879:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:974:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o:
in function `eth_igb_recv_scattered_pkts':
/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:1062:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: /home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:1070:
undefined reference to `e1000_logtype_rx'
/usr/bin/ld: drivers/libtmp_rte_net_e1000.a.p/net_e1000_igb_rxtx.c.o:/home/dmarchan/builds/build-gcc-static/../../dpdk/drivers/net/e1000/igb_rxtx.c:1236:
more undefined references to `e1000_logtype_rx' follow
collect2: error: ld returned 1 exit status
[1113/2466] Compiling C object
lib/librte_pipeline.a.p/librte_pipeline_rte_table_action.c.o
Ferruh Yigit March 25, 2021, 3:43 p.m. UTC | #3
On 3/24/2021 8:31 PM, David Marchand wrote:
> On Wed, Mar 24, 2021 at 8:27 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>
>> On 3/23/2021 11:07 AM, Qi Zhang wrote:
>>> 1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
>>> 2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
>>> 3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX
>>>
>>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>>
>> CI is reporting a build error [1], I don't reproduce the error and I assume it
>> is false positive but can you please check it?
>>
>> Also cc'ed Zhaoyan & Aaron for the possible CI issue.
>>
>> [1]
>> http://mails.dpdk.org/archives/test-report/2021-March/184153.html
>>
> 
> Not sure what gcc+debug target is, but I guess it passes the old config item.
> The compat stuff should be placed in rte_config.h (or something
> similar to config/rte_compatibility_defines.h) and not in
> lib/librte_ethdev/rte_ethdev.h.
> 
> To reproduce:
> $ meson configure $HOME/builds/build-gcc-static/
> -Dc_args="-DRTE_LIBRTE_ETHDEV_DEBUG=1"
> $ ./devtools/test-meson-builds.sh

Thanks for the steps, I can reproduce it. The alias is not working because 
'rte_ethdev.h' where the alias is defined is not included in this path.

Following update should fix it, what do you think?


  diff --git a/drivers/net/e1000/base/meson.build 
b/drivers/net/e1000/base/meson.build
  index d13f693d3eb8..a9f92cbc4770 100644
  --- a/drivers/net/e1000/base/meson.build
  +++ b/drivers/net/e1000/base/meson.build
  @@ -33,6 +33,6 @@ foreach flag: error_cflags
   endforeach

   base_lib = static_library('e1000_base', sources,
  -       dependencies: static_rte_eal,
  +       dependencies: [static_rte_eal,static_rte_ethdev],
          c_args: c_args)
   base_objs = base_lib.extract_all_objects()
  diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
  index 86f546b0f9ed..210c3447c66c 100644
  --- a/drivers/net/e1000/e1000_logs.h
  +++ b/drivers/net/e1000/e1000_logs.h
  @@ -7,6 +7,9 @@

   #include <rte_log.h>

  +/* included because of RTE_LIBRTE_ETHDEV_DEBUG alias */
  +#include <rte_ethdev.h>
  +
   extern int e1000_logtype_init;

   #define PMD_INIT_LOG(level, fmt, args...) \
Ferruh Yigit March 30, 2021, 2:06 p.m. UTC | #4
On 3/25/2021 3:43 PM, Ferruh Yigit wrote:
> On 3/24/2021 8:31 PM, David Marchand wrote:
>> On Wed, Mar 24, 2021 at 8:27 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>>>
>>> On 3/23/2021 11:07 AM, Qi Zhang wrote:
>>>> 1. replace RTE_LIBRTE_IGC_DEBUG_RX with RTE_ETHDEV_DEBUG_RX.
>>>> 2. replace RTE_LIBRTE_IGC_DEBUG_TX whth RTE_ETHDEV_DEBUG_TX.
>>>> 3. merge RTE_LIBRTE_ETHDEV_DEBUG into RTE_ETHDEV_DEBUG_TX
>>>>
>>>> Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
>>>
>>> CI is reporting a build error [1], I don't reproduce the error and I assume it
>>> is false positive but can you please check it?
>>>
>>> Also cc'ed Zhaoyan & Aaron for the possible CI issue.
>>>
>>> [1]
>>> http://mails.dpdk.org/archives/test-report/2021-March/184153.html
>>>
>>
>> Not sure what gcc+debug target is, but I guess it passes the old config item.
>> The compat stuff should be placed in rte_config.h (or something
>> similar to config/rte_compatibility_defines.h) and not in
>> lib/librte_ethdev/rte_ethdev.h.
>>
>> To reproduce:
>> $ meson configure $HOME/builds/build-gcc-static/
>> -Dc_args="-DRTE_LIBRTE_ETHDEV_DEBUG=1"
>> $ ./devtools/test-meson-builds.sh
> 
> Thanks for the steps, I can reproduce it. The alias is not working because 
> 'rte_ethdev.h' where the alias is defined is not included in this path.
> 
> Following update should fix it, what do you think?
> 
> 
> diff --git a/drivers/net/e1000/base/meson.build 
> b/drivers/net/e1000/base/meson.build
> index d13f693d3eb8..a9f92cbc4770 100644
> --- a/drivers/net/e1000/base/meson.build
> +++ b/drivers/net/e1000/base/meson.build
> @@ -33,6 +33,6 @@ foreach flag: error_cflags
>   endforeach
> 
>   base_lib = static_library('e1000_base', sources,
> -       dependencies: static_rte_eal,
> +       dependencies: [static_rte_eal,static_rte_ethdev],
>          c_args: c_args)
>   base_objs = base_lib.extract_all_objects()
> diff --git a/drivers/net/e1000/e1000_logs.h b/drivers/net/e1000/e1000_logs.h
> index 86f546b0f9ed..210c3447c66c 100644
> --- a/drivers/net/e1000/e1000_logs.h
> +++ b/drivers/net/e1000/e1000_logs.h
> @@ -7,6 +7,9 @@
> 
>   #include <rte_log.h>
> 
> +/* included because of RTE_LIBRTE_ETHDEV_DEBUG alias */
> +#include <rte_ethdev.h>
> +
>   extern int e1000_logtype_init;
> 
>   #define PMD_INIT_LOG(level, fmt, args...) \

Hi Qi,

Can you make a new version with above fix if it makes sense?
diff mbox series

Patch

diff --git a/drivers/net/igc/igc_logs.h b/drivers/net/igc/igc_logs.h
index 6457c4d180..11071a32b5 100644
--- a/drivers/net/igc/igc_logs.h
+++ b/drivers/net/igc/igc_logs.h
@@ -20,14 +20,14 @@  extern int igc_logtype_driver;
 
 #define PMD_INIT_FUNC_TRACE() PMD_INIT_LOG(DEBUG, " >>")
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_RX
+#ifdef RTE_ETHDEV_DEBUG_RX
 #define PMD_RX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
 #define PMD_RX_LOG(level, fmt, args...) do { } while (0)
 #endif
 
-#ifdef RTE_LIBRTE_IGC_DEBUG_TX
+#ifdef RTE_ETHDEV_DEBUG_TX
 #define PMD_TX_LOG(level, fmt, args...) \
 	RTE_LOG(level, PMD, "%s(): " fmt "\n", __func__, ## args)
 #else
diff --git a/drivers/net/igc/igc_txrx.c b/drivers/net/igc/igc_txrx.c
index c0a5d5e84f..f092709c02 100644
--- a/drivers/net/igc/igc_txrx.c
+++ b/drivers/net/igc/igc_txrx.c
@@ -1434,7 +1434,7 @@  eth_igc_prep_pkts(__rte_unused void *tx_queue, struct rte_mbuf **tx_pkts,
 			return i;
 		}
 
-#ifdef RTE_LIBRTE_ETHDEV_DEBUG
+#ifdef RTE_ETHDEV_DEBUG_TX
 		ret = rte_validate_tx_offload(m);
 		if (ret != 0) {
 			rte_errno = -ret;