patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: stable@dpdk.org
Cc: bluca@debian.org, ferruh.yigit@intel.com,
	Kevin Traynor <ktraynor@redhat.com>
Subject: [dpdk-stable] [PATCH 18.11 1/4] kni: fix gcc 10 ethtool build error
Date: Tue, 16 Jun 2020 14:51:34 +0100	[thread overview]
Message-ID: <20200616135137.8563-2-ktraynor@redhat.com> (raw)
In-Reply-To: <20200616135137.8563-1-ktraynor@redhat.com>

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


  reply	other threads:[~2020-06-16 13:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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 ` [dpdk-stable] [PATCH 18.11 3/4] crypto/octeontx: fix gcc 10 -fno-common build errors 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
2020-06-19  9:38   ` Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200616135137.8563-2-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=bluca@debian.org \
    --cc=ferruh.yigit@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).