From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id A5B20A04A3 for ; Tue, 16 Jun 2020 15:51:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 53A825B3A; Tue, 16 Jun 2020 15:51:51 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 7CABF5B3A for ; Tue, 16 Jun 2020 15:51:49 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1592315509; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YLTk0rFyDhmFvZolur/iF0MRiBCDk5UWa+PhIP+UL0A=; b=I0syf+s0uxR7iMNJys9PdxcLDSVtPnyZIB7WSQUJXABGQ7x5ZE/NriRz/z1iSzPkxMYM11 RPIAVKztQS8+s9h/GEcjLRc6d5zbZt2Is53LhGigSJ8Jd16AFCBzZ4910PHK7XdxTVc70A y8rJUZjSYmEeDqNZO+/6p56hPejrkh8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-380-IIlfmmaQOFqvht8DhsZuQw-1; Tue, 16 Jun 2020 09:51:47 -0400 X-MC-Unique: IIlfmmaQOFqvht8DhsZuQw-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 64BFD1083E83; Tue, 16 Jun 2020 13:51:46 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.205]) by smtp.corp.redhat.com (Postfix) with ESMTP id 58FF96EDBE; Tue, 16 Jun 2020 13:51:45 +0000 (UTC) From: Kevin Traynor To: stable@dpdk.org Cc: bluca@debian.org, ferruh.yigit@intel.com, Kevin Traynor Date: Tue, 16 Jun 2020 14:51:34 +0100 Message-Id: <20200616135137.8563-2-ktraynor@redhat.com> In-Reply-To: <20200616135137.8563-1-ktraynor@redhat.com> References: <20200616135137.8563-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] [PATCH 18.11 1/4] kni: fix gcc 10 ethtool build error X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" 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 --- 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