Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp343919rwb; Thu, 1 Dec 2022 03:00:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf4uky31PmmXkaf4b35TCkS/Rwru/YBheEOQV/FNrnggtNZum5GMTmMOzokdZe0pTKvzc2MM X-Received: by 2002:a17:907:8c81:b0:7bf:5cc5:67c5 with SMTP id td1-20020a1709078c8100b007bf5cc567c5mr17482723ejc.488.1669892447539; Thu, 01 Dec 2022 03:00:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669892447; cv=none; d=google.com; s=arc-20160816; b=V7ZZtNNaqez4JAChgKf+3Enk6tBnFY0aaVpq94pCIwad2jxhkCFAq2vzgjUCic49ks VUkGCXDNisEb+tEMXVSP8IVCJiYlDRdiMc/kirh2l/ms2sbzkwsDrMnq18qkT82D38IJ DJDHvsBYz8SrYb7AgAZwAOhILZV24SoBzPjG4IkwJgq+ya8QqvlF2qpvxaip+pykB2BX eY216+TPXWEM4urcMsXruNHdn1FGvJFwQGHH6nh9Mx7SzmH+mn4YU4MD15J446vP5jLD tQFMP3g6Isk42YKpnYC9lMaGZjZrZRoSg0nB1vV33PP8AMqENSBw/oToqnNaSUKxTgym Wq9w== 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=j+iNLgZBHVFYVqAiKpaqYdWWjZFUYRy5zBVAjX1O+nQ=; b=erdczcAPnKedK0SyDRzZ6YRh5OShHdOwNTg9YBoYHiOIsqTIeBRk+oYDemeKKGvhvd H+9GD4VCzcK2WMO8ZFTDjb89EjEcrnsGMpI/cE7SDuM4klg1NLu3YgjhLds84tqeO7ja IowaFaScAFFtYqp5hn8+4b8kXXbdVpTmL9b/UuHkUta+LzBGHl7NMAnCqCpLvctSSDLN QaFeyVcmxbX/ARLrYskZBbvgNI12pWvMqgBA7d+yCpCPTvSh6Kz2toBKClUtqABT7zx+ lOJDhCBRgEpXVv3Nm9io8qVaNhvN2ZXz9Y9Yci22lOY+kDWIzbOSASv0S8WUviw9+WgK 2zJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=YJWv5iOE; 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 sh39-20020a1709076ea700b0078ae5192906si3571066ejc.193.2022.12.01.03.00.15; Thu, 01 Dec 2022 03:00:47 -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=YJWv5iOE; 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 S229956AbiLAKVA (ORCPT + 82 others); Thu, 1 Dec 2022 05:21:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55360 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230341AbiLAKUU (ORCPT ); Thu, 1 Dec 2022 05:20:20 -0500 Received: from mail-pg1-x52b.google.com (mail-pg1-x52b.google.com [IPv6:2607:f8b0:4864:20::52b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A79C98959 for ; Thu, 1 Dec 2022 02:20:16 -0800 (PST) Received: by mail-pg1-x52b.google.com with SMTP id q1so1256381pgl.11 for ; Thu, 01 Dec 2022 02:20:16 -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=j+iNLgZBHVFYVqAiKpaqYdWWjZFUYRy5zBVAjX1O+nQ=; b=YJWv5iOEvqI+beFxfLWL+0HTOZlErkbrpNcTf4vFnDqxK8klrn+BorJpFEMBEdaVLs cnCCj3rLdSXDQQpIXtvi5IZ7L4kV0eNf0/7SnUv1LJ4zNJPZhpvV5JO/ZCxYMaXa2eWC 9h40Nv/9x6dEHPPbDONVxIfvE0i5uvkLJN2wuvPy1QGl6Hfd15fAjY+1t4Xjw91U/SV0 stIl21nN9reZb88gtoWcLzg7DMyQPFCjx5bplFUAQ3bvD7iw+3a7RswoQ0Qjg2yNtSI1 xtk4wemqixDdUN9oYzTPthVUSg0LtfIkVFHL9KuLyxDwgnb2AIpkyHAfm+elNiZFtLY0 6CZg== 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=j+iNLgZBHVFYVqAiKpaqYdWWjZFUYRy5zBVAjX1O+nQ=; b=Wzc1rViidXIp4gLW689NiNccrxfIrwAxEVsj4H9IC0fDfZR7gowoE4IMOKXvpVsjBC DYsZNlxrD+Rm9ttxhRZ97MO9+pKizwWSgrQHq63L68b8vSiSrlUuQQTLJF0gtX+dHC9D 6q8CfsN+1GATDrD53LcrhrFDoYbV2JADFchhdtueF7CMOlpOEii5yXTE2PYhI9yME2ZW BhoCerriKuS8FNyNXk8z4amG4cmNB4qgNJXEWz9IJTL71PwZT0Q7lRQEEvI2y0TTB6fB Cv0qdoIR8wTeEiGagAPLCcFlCS+nYMb+WOmmf/d5xwLDTMCaj1Y6jGmp/rlnDxkfWV26 j6qw== X-Gm-Message-State: ANoB5ploo6uTGhmB01CNdr7hdO1ImbFz2B8Uq71MGNjnTVV6IDh7oOlD qnWjvc6UBJbSFozM7dCFRUVJgmkSvg3yMhz8 X-Received: by 2002:a05:6a00:324e:b0:575:871f:2e7a with SMTP id bn14-20020a056a00324e00b00575871f2e7amr11661250pfb.35.1669890015643; Thu, 01 Dec 2022 02:20:15 -0800 (PST) Received: from alarm.flets-east.jp ([2400:4050:c360:8200:7b99:f7c3:d084:f1e2]) by smtp.gmail.com with ESMTPSA id j5-20020a170902690500b001708c4ebbaesm3164914plk.309.2022.12.01.02.20.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Dec 2022 02:20:15 -0800 (PST) From: Akihiko Odaki Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, Paul Menzel , Jesse Brandeburg , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yan Vugenfirer , Yuri Benditovich , Tony Nguyen , Leon Romanovsky , Akihiko Odaki Subject: [PATCH net v4] igbvf: Regard vf reset nack as success Date: Thu, 1 Dec 2022 19:20:03 +0900 Message-Id: <20221201102003.67861-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 vf reset nack actually represents the reset operation itself is performed but no address is assigned. Therefore, e1000_reset_hw_vf should fill the "perm_addr" with the zero address and return success on such an occasion. This prevents its callers in netdev.c from saying PF still resetting, and instead allows them to correctly report that no address is assigned. Fixes: 6ddbc4cf1f4d ("igb: Indicate failure on vf reset for empty mac address") Signed-off-by: Akihiko Odaki --- V3 -> V4: Removed blank lines between cases V2 -> V3: Added Fixes: tag drivers/net/ethernet/intel/igbvf/vf.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/intel/igbvf/vf.c b/drivers/net/ethernet/intel/igbvf/vf.c index b8ba3f94c363..a47a2e3e548c 100644 --- a/drivers/net/ethernet/intel/igbvf/vf.c +++ b/drivers/net/ethernet/intel/igbvf/vf.c @@ -1,6 +1,8 @@ // SPDX-License-Identifier: GPL-2.0 /* Copyright(c) 2009 - 2018 Intel Corporation. */ +#include + #include "vf.h" static s32 e1000_check_for_link_vf(struct e1000_hw *hw); @@ -131,11 +133,16 @@ static s32 e1000_reset_hw_vf(struct e1000_hw *hw) /* set our "perm_addr" based on info provided by PF */ ret_val = mbx->ops.read_posted(hw, msgbuf, 3); if (!ret_val) { - if (msgbuf[0] == (E1000_VF_RESET | - E1000_VT_MSGTYPE_ACK)) + switch (msgbuf[0]) { + case E1000_VF_RESET | E1000_VT_MSGTYPE_ACK: memcpy(hw->mac.perm_addr, addr, ETH_ALEN); - else + break; + case E1000_VF_RESET | E1000_VT_MSGTYPE_NACK: + eth_zero_addr(hw->mac.perm_addr); + break; + default: ret_val = -E1000_ERR_MAC_INIT; + } } } -- 2.38.1