Message ID | 20221122131145.68107-1-akihiko.odaki@daynix.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2191713wrr; Tue, 22 Nov 2022 05:13:41 -0800 (PST) X-Google-Smtp-Source: AA0mqf434Bq0+f8Yc56Bllx43h63CAHcBUzuNye2KRymbePFSov6LHVGLSz2fp3biA4dLAwbM+TV X-Received: by 2002:a17:902:dad1:b0:188:5698:6b69 with SMTP id q17-20020a170902dad100b0018856986b69mr3787815plx.142.1669122820813; Tue, 22 Nov 2022 05:13:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669122820; cv=none; d=google.com; s=arc-20160816; b=zemvbG3PetQEcHkxZmFunhtfrmDMJLTEOqM/9BfhYmDyDVGfgiDkWSpkgh385BIg+i gqFLzeA5zGKDk51StcKiW97Sf1RconhU6BvPbMOdYrA7JRb8GQv4Nl075yEVwIzXs2B/ y+VWZmMGNv1lP0+gI/htz+ZSy74dfdBgWpWdRGWQf74o9Cs1o2C0OFPW0mg1bbO7nvE2 UnejDbjtdE/t8GEZBSRqDjcXq0kaSM4LbCJJeNkow11iT4BUW76pnPihpLWxBFEYUfN1 4p5ujINFJ1TcVNwK/NQjeXYLG/n+LycxVZSlYx+aNM4Js6fR6tiusSdh0TmOL/3CNzUt o3Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=oqwHzAInlPVGD6Tj99gfuhNqltvuUaoQbnrjs4tthqQ=; b=Iwp3zZUzzLvUeGLWBjjZuM/HvPcTIMysFlP0raL9L3w7pVn0GmuhJl4alaaH36sZJx Vj3IcPZl0iaWcKxgoKLLEngFvDzRePx04m2ze640BLUg6lBuK5ttgalHBFxGx/vm+W14 oolx80VQNlkdlwjUSHxVxuVsXIkhQbUeMwlXJOsD7RhT1V5snbKgigR1Kx7bEqeerDGA gH2R9VIuI9kNukQByyDww3IR889Ryiq5kc20bFcfzyEcI98mBkRwi0lZGEPBlcyxFcbD 9MxwC4sNLk7SXaYcclmTiR+3HjabtO19Zn11qmYnES5y06XIclkJESmUSkI4nMrdbu9K OqRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b="iqFptG7/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l5-20020a056a00140500b00563ab8e5e83si11780181pfu.370.2022.11.22.05.13.26; Tue, 22 Nov 2022 05:13:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b="iqFptG7/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232656AbiKVNM1 (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Tue, 22 Nov 2022 08:12:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232532AbiKVNMZ (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 22 Nov 2022 08:12:25 -0500 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D10A623BC for <linux-kernel@vger.kernel.org>; Tue, 22 Nov 2022 05:12:24 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id q71so14025013pgq.8 for <linux-kernel@vger.kernel.org>; Tue, 22 Nov 2022 05:12:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daynix-com.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=oqwHzAInlPVGD6Tj99gfuhNqltvuUaoQbnrjs4tthqQ=; b=iqFptG7/uCjX/WZys0RvEFs1QNIHoCzPFv1fNAzqAMu+zJYLIAIlTk5xbXKdx+huTA 903beUgNqdUyJbtx+1indJKeCxTl6PcQCU9vqOpDLb83FX0WK23+ILBpy9ly3TpIZDCC xgjqsPh29pWWGt+2eiT8p/uT708pvtye0mpxMZQl+7KXngPg5fYjUKzILGUff0EBmGWG OWN1ybOPMEoD14w22QOUMf0rMMUS/XViBDGXZgvtTtSzOJdrHzoq31K9eGKmHbbI91Gb UUo/9UggJh/iYOMPpOGdHM+AU2ZIRy4cGxaeLE55UWyAkPBxF36Rdhb8iB+puBt7zvDM ub8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oqwHzAInlPVGD6Tj99gfuhNqltvuUaoQbnrjs4tthqQ=; b=LjJ21/AaBSxE2Ay/Hc87W34E9fJSA7T8TbwAkZ90hFf1lQs6ynXRabLLMOelXCIUZR NPZ4wmB9VkARNXmO7FYbO/XMxctz5zYuySqOiM52uPBzC2qxurmmasJq2TBrfj2IGu5R 7IuEKcVPH0usWNO4lL20uEoBbA8aXclromstu09yAFaj7WoLysD5sba0KbRRdIUerQGp Y1XtycgULzukUDnNXXfFQa0lpqg+4XxNz/jAH2YYyakIIqnicJNz5zRQTh+gYqbgNL29 pZx1OQYPMYJx27DnV90vQgFF8VKifYFNxB3+yICxvX302b+SiOyJshpxwN73ahQAy3yu 7Nrw== X-Gm-Message-State: ANoB5pnpS7w469T9CEaUvSi+gsalB/j/CGloDpurbPFNI8FP7g8DeHc/ +5m7BFCP66NIRxx06fT9yz9Vms9wvbpRQQ== X-Received: by 2002:a63:5819:0:b0:476:8ce9:be5d with SMTP id m25-20020a635819000000b004768ce9be5dmr5324378pgb.15.1669122743413; Tue, 22 Nov 2022 05:12:23 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id w18-20020a170902e89200b00183e2a96414sm11948992plg.121.2022.11.22.05.12.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 05:12:22 -0800 (PST) From: Akihiko Odaki <akihiko.odaki@daynix.com> Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Maciej Fijalkowski <maciej.fijalkowski@intel.com>, Jesse Brandeburg <jesse.brandeburg@intel.com>, Tony Nguyen <anthony.l.nguyen@intel.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Yan Vugenfirer <yan@daynix.com>, Yuri Benditovich <yuri.benditovich@daynix.com>, Akihiko Odaki <akihiko.odaki@daynix.com> Subject: [PATCH v2] igb: Allocate MSI-X vector when testing Date: Tue, 22 Nov 2022 22:11:45 +0900 Message-Id: <20221122131145.68107-1-akihiko.odaki@daynix.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750198829964942861?= X-GMAIL-MSGID: =?utf-8?q?1750202130840452782?= |
Series |
[v2] igb: Allocate MSI-X vector when testing
|
|
Commit Message
Akihiko Odaki
Nov. 22, 2022, 1:11 p.m. UTC
Without this change, the interrupt test fail with MSI-X environment:
$ sudo ethtool -t enp0s2 offline
[ 43.921783] igb 0000:00:02.0: offline testing starting
[ 44.855824] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Down
[ 44.961249] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
[ 51.272202] igb 0000:00:02.0: testing shared interrupt
[ 56.996975] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
The test result is FAIL
The test extra info:
Register test (offline) 0
Eeprom test (offline) 0
Interrupt test (offline) 4
Loopback test (offline) 0
Link test (on/offline) 0
Here, "4" means an expected interrupt was not delivered.
This change routes interrupts correctly to the first MSI-X vector, and
fixes the test:
$ sudo ethtool -t enp0s2 offline
[ 42.762985] igb 0000:00:02.0: offline testing starting
[ 50.141967] igb 0000:00:02.0: testing shared interrupt
[ 56.163957] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX
The test result is PASS
The test extra info:
Register test (offline) 0
Eeprom test (offline) 0
Interrupt test (offline) 0
Loopback test (offline) 0
Link test (on/offline) 0
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 ++
1 file changed, 2 insertions(+)
Comments
On Tue, Nov 22, 2022 at 10:11:45PM +0900, Akihiko Odaki wrote: > Without this change, the interrupt test fail with MSI-X environment: > > $ sudo ethtool -t enp0s2 offline > [ 43.921783] igb 0000:00:02.0: offline testing starting > [ 44.855824] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Down > [ 44.961249] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX > [ 51.272202] igb 0000:00:02.0: testing shared interrupt > [ 56.996975] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX > The test result is FAIL > The test extra info: > Register test (offline) 0 > Eeprom test (offline) 0 > Interrupt test (offline) 4 > Loopback test (offline) 0 > Link test (on/offline) 0 > > Here, "4" means an expected interrupt was not delivered. > > This change routes interrupts correctly to the first MSI-X vector, and > fixes the test: Try to use imperative mood - simply stating something like "To fix this, route IRQs correctly to the first MSI-X vector by xyz" > > $ sudo ethtool -t enp0s2 offline > [ 42.762985] igb 0000:00:02.0: offline testing starting > [ 50.141967] igb 0000:00:02.0: testing shared interrupt > [ 56.163957] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX > The test result is PASS > The test extra info: > Register test (offline) 0 > Eeprom test (offline) 0 > Interrupt test (offline) 0 > Loopback test (offline) 0 > Link test (on/offline) 0 Looks better now, would be also good to explain what is the *actual* fix by explaining the HW registers setting that you're doing. Thanks! > > Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> > --- > drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c > index e5f3e7680dc6..ff911af16a4b 100644 > --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c > +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c > @@ -1413,6 +1413,8 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data) > *data = 1; > return -1; > } > + wr32(E1000_IVAR_MISC, E1000_IVAR_VALID << 8); > + wr32(E1000_EIMS, BIT(0)); > } else if (adapter->flags & IGB_FLAG_HAS_MSI) { > shared_int = false; > if (request_irq(irq, > -- > 2.38.1 >
On Tue, Nov 22, 2022 at 10:11:45PM +0900, Akihiko Odaki wrote: > Without this change, the interrupt test fail with MSI-X environment: > > $ sudo ethtool -t enp0s2 offline > [ 43.921783] igb 0000:00:02.0: offline testing starting > [ 44.855824] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Down > [ 44.961249] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX > [ 51.272202] igb 0000:00:02.0: testing shared interrupt > [ 56.996975] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX > The test result is FAIL > The test extra info: > Register test (offline) 0 > Eeprom test (offline) 0 > Interrupt test (offline) 4 > Loopback test (offline) 0 > Link test (on/offline) 0 > > Here, "4" means an expected interrupt was not delivered. > > This change routes interrupts correctly to the first MSI-X vector, and > fixes the test: Imperative mood, please - "To fix this, route interrupts correctly..." > > $ sudo ethtool -t enp0s2 offline > [ 42.762985] igb 0000:00:02.0: offline testing starting > [ 50.141967] igb 0000:00:02.0: testing shared interrupt > [ 56.163957] igb 0000:00:02.0 enp0s2: igb: enp0s2 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: RX/TX > The test result is PASS > The test extra info: > Register test (offline) 0 > Eeprom test (offline) 0 > Interrupt test (offline) 0 > Loopback test (offline) 0 > Link test (on/offline) 0 > You still didn't specify the tree. If it's 'net' and you're not sure about fixes tag, then please provide some explanation to maintainers why you're not adding this. > Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> > --- > drivers/net/ethernet/intel/igb/igb_ethtool.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c > index e5f3e7680dc6..ff911af16a4b 100644 > --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c > +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c > @@ -1413,6 +1413,8 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data) > *data = 1; > return -1; > } > + wr32(E1000_IVAR_MISC, E1000_IVAR_VALID << 8); > + wr32(E1000_EIMS, BIT(0)); > } else if (adapter->flags & IGB_FLAG_HAS_MSI) { > shared_int = false; > if (request_irq(irq, > -- > 2.38.1 >
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c index e5f3e7680dc6..ff911af16a4b 100644 --- a/drivers/net/ethernet/intel/igb/igb_ethtool.c +++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c @@ -1413,6 +1413,8 @@ static int igb_intr_test(struct igb_adapter *adapter, u64 *data) *data = 1; return -1; } + wr32(E1000_IVAR_MISC, E1000_IVAR_VALID << 8); + wr32(E1000_EIMS, BIT(0)); } else if (adapter->flags & IGB_FLAG_HAS_MSI) { shared_int = false; if (request_irq(irq,