Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5875898rwb; Tue, 22 Nov 2022 06:08:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf7P7fmf0+D4S0QtZHGEWr/14luG70KAWvi7wmXI47OjFkJatjFtChglyYrIcMU2G2OrNttD X-Received: by 2002:a17:902:6505:b0:186:e568:3442 with SMTP id b5-20020a170902650500b00186e5683442mr17048498plk.56.1669126088936; Tue, 22 Nov 2022 06:08:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669126088; cv=none; d=google.com; s=arc-20160816; b=WJQYnfz78xDMY8TMJ1EJvENO7xVktAfDR6c61x5rpNaTyI725eDl/TZhFktyJCNf+9 1f6XMilx7B5/M62eOXkQWkJTFgcrv2csdSwN5hyo2YHZ0i1kTxj2O8dukKuUUuMbBwph Q6OhMG5dvK+e232XtH5PNEsbiEI84BOBM3GsOrbLXkp7VumEGk4h4l09UYIwtAq6lXtF QuS/xTZEAVHmc5FMBBCTjfCSzGte5i0Q+4EQo1hZP3ZTHGXt0PE66HWMQ44xWHhg4qCR 2xwhGmY8e76ao9GLWPKMG1aNWdX3myt9P0KktgCNvO4VZnEaUD6Cl56ClfukPOcgVPa+ EYnQ== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a10-20020a170902b58a00b001865dfb6774si12990113pls.458.2022.11.22.06.07.54; Tue, 22 Nov 2022 06:08:08 -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 + 90 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 ); 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 ; Tue, 22 Nov 2022 05:12:24 -0800 (PST) Received: by mail-pg1-x52e.google.com with SMTP id q71so14025013pgq.8 for ; 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 Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Maciej Fijalkowski , Jesse Brandeburg , Tony Nguyen , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yan Vugenfirer , Yuri Benditovich , Akihiko Odaki 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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