Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp6686903rwb; Tue, 22 Nov 2022 17:35:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf4sycefOkVGSmhkeDawAfpx3TqCfFmveooJIxPJvi+Ay16ngoyJvqpYDxXa6RMT4vx9plpP X-Received: by 2002:a17:906:81cd:b0:7ad:beb3:91b6 with SMTP id e13-20020a17090681cd00b007adbeb391b6mr6525174ejx.159.1669167330464; Tue, 22 Nov 2022 17:35:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669167330; cv=none; d=google.com; s=arc-20160816; b=Cyg18jkSZseeWCts4BjU4TxV3PpoE/lC7KUCaNHPB3vRuNdl7uqJG8MNs3H87sHJ03 RkVu3JvdNh2302XwyPA2j/mn2B3MHBM/p/RdgB159ypCQt0IqAdskJROZOK97DryovJb xR+e3J4+343VTAbEaav46E5Vb4gzs98TU/BPThZTIawgkDWNr/bDD/jhV7aYlauB0fly rM+Rx5tkpiONdPKR7tOctQ2+hodvUcMLRsPKmyIw1ogncgT5oZKaqEUgupcQGm2FvsNL uUcDbeP79U5yYpTEYdYwow7jRgr/8c3hAnQ1jnOfDR+k+9GbwGCR67s37Jxv5YAd7ABo BW2Q== 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=/V51eYi8kNH703uTKmSzNllQwio3tsi/yeJV9VYuXpc=; b=io4laDuM89R9ET2bkrFAaZ7belp3bYFNqzIbJkzkCjjOg4tI7hWl+xV+Qopf8xhlw5 Nikc8Iqyfu6zAhi08WJDM/JJPmYOB4m/NdGqXJhz/s8Yqh9OrSoM2VimbIynBKw/s9kO EQL411MHfY1h9yue5z5ja1IV7t14K2UjRCowtnuXkk3zLAsAKguwQsC4ZNTbPrtd08QM 8Skdf22qkg+mlZ2s3a4ITGLbXzhUgC6wGHFbnpMv6Lq/bL2viKOD65+IQeWv48jqsZLF CoV2lmhy9QExV8kAqcQXYuxuvUtXlpdHuupdOaA5F/kX5FVIv6TRxv9BpZeCC1zRF1wY 2Wyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=lrW4Id5T; 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 ne21-20020a1709077b9500b0079195d87013si9225158ejc.713.2022.11.22.17.35.09; Tue, 22 Nov 2022 17:35:30 -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=lrW4Id5T; 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 S235475AbiKWBJn (ORCPT + 89 others); Tue, 22 Nov 2022 20:09:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46846 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235485AbiKWBJh (ORCPT ); Tue, 22 Nov 2022 20:09:37 -0500 Received: from mail-pl1-x634.google.com (mail-pl1-x634.google.com [IPv6:2607:f8b0:4864:20::634]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A3F6DDFBC for ; Tue, 22 Nov 2022 17:09:37 -0800 (PST) Received: by mail-pl1-x634.google.com with SMTP id w4so6495426plp.1 for ; Tue, 22 Nov 2022 17:09:37 -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=/V51eYi8kNH703uTKmSzNllQwio3tsi/yeJV9VYuXpc=; b=lrW4Id5THbQtufiIuhTDV12fIXnXs2AY/a0DuVmYeuisSZPyJkQi00phxQ4u4SNwFY 6R3pReduNo28T/sy/smgfVHCqcHl4JSEJOC6W4cZEkShcPFuRBhYKdZXjmihnAUcyXRe rYOZzWbE6Bx+MCZXs18h0fTfmCv3DmV6ZUutx9wvEAamr0NW0ypkfE2Q+tgG3jJuzJQX +YKniqqZ114B1cPCpBeqd5R+oa9KPX1uy9zgrZC+KewsW9OstAzfASiEsXi+N9+p+2Sq fMM75XqGe/mEwAck8azYhQWm/VuxpOeBdT8gfmkKlmjPsf8WJhFyPxLCGZaf7fQOxvxG 9YAw== 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=/V51eYi8kNH703uTKmSzNllQwio3tsi/yeJV9VYuXpc=; b=C16XVCmFPgKPsMS5Q8FIRN3b9Z3o9pZ6V1bzOBCA0DxK5bgvui6qpwBWN+m/w8/dVq ZPVqCO1bCB4+WiQNrWI2kqVLyk/4WkqQ12Loxufh5r/u1d/g7fDdvXkJVXkQxkjSYVRD nPQ8AkMK/45KDDZFkg2g8vqOK34xlI4vhPvEDUyGVoK5PbQ7P+jPoeaadZIWbAH6jfa7 DDF8eLzaVfWCh//uoLyL+jCtsgiu8iVgTo92YLdJnqb0y50BaIYxD6fLlYA7fGXzx5hP J2mMAJVebNDkgsh12Y0RnX67HbfoioToZgbKsgkHG+GEen3W3ztfpiSnVh+UMJXehCRM Z8LQ== X-Gm-Message-State: ANoB5pmVGvGzFDpccR8eMnRNqz4Da4OHfh4cG37xShkrpR9wDgnKATb3 zGvq+f+4Z26K4CdMscy55t+0MlVh9y3lSw== X-Received: by 2002:a17:902:ed94:b0:186:748f:e8c5 with SMTP id e20-20020a170902ed9400b00186748fe8c5mr6375972plj.73.1669165776461; Tue, 22 Nov 2022 17:09:36 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id x15-20020aa78f0f000000b0056be4dbd4besm11309911pfr.111.2022.11.22.17.09.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 17:09:36 -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 v3] igb: Allocate MSI-X vector when testing Date: Wed, 23 Nov 2022 10:09:26 +0900 Message-Id: <20221123010926.7924-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=ham 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. To fix this, route IRQs correctly to the first MSI-X vector by setting IVAR_MISC. Also, set bit 0 of EIMS so that the vector will not be masked. The interrupt test now runs properly with this change: $ 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