* [dpdk-stable] [PATCH 18.11 1/4] kni: fix gcc 10 ethtool build error
2020-06-16 13:51 [dpdk-stable] [PATCH 18.11 0/4] 18.11.9 build fixes Kevin Traynor
@ 2020-06-16 13:51 ` Kevin Traynor
2020-06-16 13:51 ` [dpdk-stable] [PATCH 18.11 2/4] kni: fix ethtool maybe-uninitialized warnings Kevin Traynor
` (3 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Kevin Traynor @ 2020-06-16 13:51 UTC (permalink / raw)
To: stable; +Cc: bluca, ferruh.yigit, Kevin Traynor
gcc 10 is smart enough to see that the usec_interval passed into
e1000_phy_has_link_generic() is sometimes a large constant (100000)
and under some conditions it may be passed directly into udelay().
udelay generates an error when it gets these large values by inserting
an undefined function:
if (__builtin_constant_p(n)) { \
if ((n) / 20000 >= 1) \
__bad_udelay(); \
And hence we see the error in the form of:
ERROR: "__bad_udelay"
[/root/dpdk/build/kernel/linux/kni/rte_kni.ko] undefined!
Fix this by using similar code to elsewhere in the function whereby
msec_delay_irq() is used when usec value >= 1000.
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
kernel/linux/kni/ethtool/igb/e1000_phy.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/kernel/linux/kni/ethtool/igb/e1000_phy.c b/kernel/linux/kni/ethtool/igb/e1000_phy.c
index 5257b9141e..b4d363ba28 100644
--- a/kernel/linux/kni/ethtool/igb/e1000_phy.c
+++ b/kernel/linux/kni/ethtool/igb/e1000_phy.c
@@ -2257,10 +2257,14 @@ s32 e1000_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
*/
ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
- if (ret_val)
+ if (ret_val) {
/* If the first read fails, another entity may have
* ownership of the resources, wait and try again to
* see if they have relinquished the resources yet.
*/
- usec_delay(usec_interval);
+ if (usec_interval >= 1000)
+ msec_delay_irq(usec_interval/1000);
+ else
+ usec_delay(usec_interval);
+ }
ret_val = hw->phy.ops.read_reg(hw, PHY_STATUS, &phy_status);
if (ret_val)
--
2.21.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-stable] [PATCH 18.11 2/4] kni: fix ethtool maybe-uninitialized warnings
2020-06-16 13:51 [dpdk-stable] [PATCH 18.11 0/4] 18.11.9 build fixes Kevin Traynor
2020-06-16 13:51 ` [dpdk-stable] [PATCH 18.11 1/4] kni: fix gcc 10 ethtool build error Kevin Traynor
@ 2020-06-16 13:51 ` Kevin Traynor
2020-06-16 13:51 ` [dpdk-stable] [PATCH 18.11 3/4] crypto/octeontx: fix gcc 10 -fno-common build errors Kevin Traynor
` (2 subsequent siblings)
4 siblings, 0 replies; 7+ messages in thread
From: Kevin Traynor @ 2020-06-16 13:51 UTC (permalink / raw)
To: stable; +Cc: bluca, ferruh.yigit, Kevin Traynor
Similar to
commit 46136031f191 ("net/e1000: clean LTO warnings")
initialize the link variable to squash these maybe-uninitialized
false positive warnings in ethtool.
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
kernel/linux/kni/ethtool/igb/e1000_phy.c | 18 +++++++++---------
1 file changed, 9 insertions(+), 9 deletions(-)
diff --git a/kernel/linux/kni/ethtool/igb/e1000_phy.c b/kernel/linux/kni/ethtool/igb/e1000_phy.c
index b4d363ba28..1510211e3f 100644
--- a/kernel/linux/kni/ethtool/igb/e1000_phy.c
+++ b/kernel/linux/kni/ethtool/igb/e1000_phy.c
@@ -1587,5 +1587,5 @@ s32 e1000_setup_copper_link_generic(struct e1000_hw *hw)
{
s32 ret_val;
- bool link;
+ bool link = true;
DEBUGFUNC("e1000_setup_copper_link_generic");
@@ -1642,5 +1642,5 @@ s32 e1000_phy_force_speed_duplex_igp(struct e1000_hw *hw)
s32 ret_val;
u16 phy_data;
- bool link;
+ bool link = true;
DEBUGFUNC("e1000_phy_force_speed_duplex_igp");
@@ -1708,5 +1708,5 @@ s32 e1000_phy_force_speed_duplex_m88(struct e1000_hw *hw)
s32 ret_val;
u16 phy_data;
- bool link;
+ bool link = true;
DEBUGFUNC("e1000_phy_force_speed_duplex_m88");
@@ -1845,5 +1845,5 @@ s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw)
s32 ret_val;
u16 data;
- bool link;
+ bool link = true;
DEBUGFUNC("e1000_phy_force_speed_duplex_ife");
@@ -2521,5 +2521,5 @@ s32 e1000_get_phy_info_m88(struct e1000_hw *hw)
s32 ret_val;
u16 phy_data;
- bool link;
+ bool link = true;
DEBUGFUNC("e1000_get_phy_info_m88");
@@ -2596,5 +2596,5 @@ s32 e1000_get_phy_info_igp(struct e1000_hw *hw)
s32 ret_val;
u16 data;
- bool link;
+ bool link = true;
DEBUGFUNC("e1000_get_phy_info_igp");
@@ -2658,5 +2658,5 @@ s32 e1000_get_phy_info_ife(struct e1000_hw *hw)
s32 ret_val;
u16 data;
- bool link;
+ bool link = true;
DEBUGFUNC("e1000_get_phy_info_ife");
@@ -3047,5 +3047,5 @@ s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw)
s32 ret_val;
u16 phy_data;
- bool link;
+ bool link = true;
DEBUGFUNC("e1000_phy_force_speed_duplex_82577");
@@ -3096,5 +3096,5 @@ s32 e1000_get_phy_info_82577(struct e1000_hw *hw)
s32 ret_val;
u16 data;
- bool link;
+ bool link = true;
DEBUGFUNC("e1000_get_phy_info_82577");
--
2.21.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-stable] [PATCH 18.11 3/4] crypto/octeontx: fix gcc 10 -fno-common build errors
2020-06-16 13:51 [dpdk-stable] [PATCH 18.11 0/4] 18.11.9 build fixes Kevin Traynor
2020-06-16 13:51 ` [dpdk-stable] [PATCH 18.11 1/4] kni: fix gcc 10 ethtool build error Kevin Traynor
2020-06-16 13:51 ` [dpdk-stable] [PATCH 18.11 2/4] kni: fix ethtool maybe-uninitialized warnings Kevin Traynor
@ 2020-06-16 13:51 ` Kevin Traynor
2020-06-16 13:51 ` [dpdk-stable] [PATCH 18.11 4/4] app/testpmd: disable " Kevin Traynor
2020-06-17 9:15 ` [dpdk-stable] [PATCH 18.11 0/4] 18.11.9 build fixes Luca Boccassi
4 siblings, 0 replies; 7+ messages in thread
From: Kevin Traynor @ 2020-06-16 13:51 UTC (permalink / raw)
To: stable; +Cc: bluca, ferruh.yigit, Kevin Traynor
gcc 10 defaults to -fno-common, this means a linker error will now be
reported if the same global variable is defined in more than one
compilation unit.
Fix this for cpt_logtype.
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
drivers/common/cpt/cpt_pmd_logs.h | 2 +-
drivers/crypto/octeontx/otx_cryptodev.c | 2 ++
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/common/cpt/cpt_pmd_logs.h b/drivers/common/cpt/cpt_pmd_logs.h
index 4cbec4e36c..2681d12869 100644
--- a/drivers/common/cpt/cpt_pmd_logs.h
+++ b/drivers/common/cpt/cpt_pmd_logs.h
@@ -46,5 +46,5 @@
* by otx_* driver routines during PCI probe.
*/
-int cpt_logtype;
+extern int cpt_logtype;
#endif /* _CPT_PMD_LOGS_H_ */
diff --git a/drivers/crypto/octeontx/otx_cryptodev.c b/drivers/crypto/octeontx/otx_cryptodev.c
index d48fd1971c..d334fbfdd5 100644
--- a/drivers/crypto/octeontx/otx_cryptodev.c
+++ b/drivers/crypto/octeontx/otx_cryptodev.c
@@ -20,4 +20,6 @@ static int otx_cryptodev_logtype;
uint8_t otx_cryptodev_driver_id;
+int cpt_logtype;
+
static struct rte_pci_id pci_id_cpt_table[] = {
{
--
2.21.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* [dpdk-stable] [PATCH 18.11 4/4] app/testpmd: disable gcc 10 -fno-common build errors
2020-06-16 13:51 [dpdk-stable] [PATCH 18.11 0/4] 18.11.9 build fixes Kevin Traynor
` (2 preceding siblings ...)
2020-06-16 13:51 ` [dpdk-stable] [PATCH 18.11 3/4] crypto/octeontx: fix gcc 10 -fno-common build errors Kevin Traynor
@ 2020-06-16 13:51 ` Kevin Traynor
2020-06-17 9:15 ` [dpdk-stable] [PATCH 18.11 0/4] 18.11.9 build fixes Luca Boccassi
4 siblings, 0 replies; 7+ messages in thread
From: Kevin Traynor @ 2020-06-16 13:51 UTC (permalink / raw)
To: stable; +Cc: bluca, ferruh.yigit, Kevin Traynor
gcc 10 defaults to -fno-common and as a result when building
testpmd, there are errors.
These could be fixed with a rebased version of
commit f6e63e59e7e2 ("app/testpmd: fix global variable multiple definitions")
but there are conflicts with that patch.
When DPDK 18.11 was released -fcommon was the default on gcc, so disable
the warnings for testpmd.
Signed-off-by: Kevin Traynor <ktraynor@redhat.com>
---
app/test-pmd/Makefile | 6 ++++++
app/test-pmd/meson.build | 5 +++++
2 files changed, 11 insertions(+)
diff --git a/app/test-pmd/Makefile b/app/test-pmd/Makefile
index d5258eae4a..f36137fd44 100644
--- a/app/test-pmd/Makefile
+++ b/app/test-pmd/Makefile
@@ -16,4 +16,10 @@ CFLAGS += $(WERROR_FLAGS)
CFLAGS += -Wno-deprecated-declarations
+ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
+ifeq ($(shell test $(GCC_VERSION) -ge 100 && echo 1), 1)
+CFLAGS += -fcommon
+endif
+endif
+
#
# all source are stored in SRCS-y
diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
index 6006c60f99..adeeeeedba 100644
--- a/app/test-pmd/meson.build
+++ b/app/test-pmd/meson.build
@@ -6,4 +6,9 @@ name = 'testpmd'
allow_experimental_apis = true
cflags += '-Wno-deprecated-declarations'
+
+if (toolchain == 'gcc' and cc.version().version_compare('>=10.0.0'))
+ cflags += '-fcommon'
+endif
+
sources = files('cmdline.c',
'cmdline_flow.c',
--
2.21.3
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-stable] [PATCH 18.11 0/4] 18.11.9 build fixes
2020-06-16 13:51 [dpdk-stable] [PATCH 18.11 0/4] 18.11.9 build fixes Kevin Traynor
` (3 preceding siblings ...)
2020-06-16 13:51 ` [dpdk-stable] [PATCH 18.11 4/4] app/testpmd: disable " Kevin Traynor
@ 2020-06-17 9:15 ` Luca Boccassi
2020-06-19 9:38 ` Kevin Traynor
4 siblings, 1 reply; 7+ messages in thread
From: Luca Boccassi @ 2020-06-17 9:15 UTC (permalink / raw)
To: Kevin Traynor, stable; +Cc: ferruh.yigit
On Tue, 2020-06-16 at 14:51 +0100, Kevin Traynor wrote:
> Various build fixes so that 18.11.9 will build with gcc 10
>
> Kevin Traynor (4):
> kni: fix gcc 10 ethtool build error
> kni: fix ethtool maybe-uninitialized warnings
> crypto/octeontx: fix gcc 10 -fno-common build errors
> app/testpmd: disable gcc 10 -fno-common build errors
>
> app/test-pmd/Makefile | 6 ++++++
> app/test-pmd/meson.build | 5 +++++
> drivers/common/cpt/cpt_pmd_logs.h | 2 +-
> drivers/crypto/octeontx/otx_cryptodev.c | 2 ++
> kernel/linux/kni/ethtool/igb/e1000_phy.c | 26 ++++++++++++++----------
> 5 files changed, 29 insertions(+), 12 deletions(-)
Series-Acked-By: Luca Boccassi <bluca@debian.org>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [dpdk-stable] [PATCH 18.11 0/4] 18.11.9 build fixes
2020-06-17 9:15 ` [dpdk-stable] [PATCH 18.11 0/4] 18.11.9 build fixes Luca Boccassi
@ 2020-06-19 9:38 ` Kevin Traynor
0 siblings, 0 replies; 7+ messages in thread
From: Kevin Traynor @ 2020-06-19 9:38 UTC (permalink / raw)
To: Luca Boccassi, stable; +Cc: ferruh.yigit
On 17/06/2020 10:15, Luca Boccassi wrote:
> On Tue, 2020-06-16 at 14:51 +0100, Kevin Traynor wrote:
>> Various build fixes so that 18.11.9 will build with gcc 10
>>
>> Kevin Traynor (4):
>> kni: fix gcc 10 ethtool build error
>> kni: fix ethtool maybe-uninitialized warnings
>> crypto/octeontx: fix gcc 10 -fno-common build errors
>> app/testpmd: disable gcc 10 -fno-common build errors
>>
>> app/test-pmd/Makefile | 6 ++++++
>> app/test-pmd/meson.build | 5 +++++
>> drivers/common/cpt/cpt_pmd_logs.h | 2 +-
>> drivers/crypto/octeontx/otx_cryptodev.c | 2 ++
>> kernel/linux/kni/ethtool/igb/e1000_phy.c | 26 ++++++++++++++----------
>> 5 files changed, 29 insertions(+), 12 deletions(-)
>
> Series-Acked-By: Luca Boccassi <bluca@debian.org>
>
Applied, thanks
^ permalink raw reply [flat|nested] 7+ messages in thread