Message ID | 20221122092707.30981-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 q4csp2104023wrr; Tue, 22 Nov 2022 01:45:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf5aZ4rTXrvG37QXNyBbWfS3M6IjbsORAr2u1vmE42aXYVpofrx0jo+CIMSJP8dcqa0YFnYK X-Received: by 2002:a17:902:f2c5:b0:189:1cc3:802a with SMTP id h5-20020a170902f2c500b001891cc3802amr4912518plc.56.1669110315730; Tue, 22 Nov 2022 01:45:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669110315; cv=none; d=google.com; s=arc-20160816; b=Z24Ep80vLnDtTVSScIqp0yUQ02Ob/j2XcMevAbJkwcJ4eIFHBfGUkl3sl7ca7F/VbP NbBqIx9jMVLvhye+0QDTWFdnIx/QlxM2tan5PevmoqTaJI6CmN7SMMEwCYsVA3PdLBuC ks00XW13UfFLuL3I+uPg8FdTCqARxfGXqPiKBAr1BPAfc8yGhd5LTS8bIlZdbIqOFFci B7E7yJbeEjdIRcybS5vpnFGW31gz10LyydCin5Qc5opAJ95/tKH5g5p0nGl2TOa1XodB XRtG4j1DtIy38Nisv3bM6QC6kUQDJHZLYBA1UE3V0DwcvoDH2Y3c6Y8nZdUFC1X4tW4L 18TA== 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=eATo/hld30hJMYbs854XvpQGAeslm1I6YJ3BHDFYFEg=; b=SLs+00OmprjG+Vdjv6QC4PTZkQnYb4orr6mZ81cF7lnOv1t6BeVoAtasbxA3Tal7nr Tg9FE3lBUDLAcURvyiDBu0F5PB7LerF0II3Lsvp6OkLYlAIN1PJ4cJsmVB/JYj7+YsJl +rbshQ7Dq6OP189WiXngIHNBE8GvNDpb2wLYIshMkzgxZc7ubrRS7ZGLODY6QfX7alQH pmKwEbGtQ9oW5XAqu4/cYC3jUrNpYA37tlEg2Qy67ZvjNch3RB7bgW9p4HiQVLY8c3lH MD+JcO6FvzmOrOWAmkrKvJCAJxcpwTOJpMNd8rdZwETWgVhyyRFX0e82LZJMhowUhyiq hy8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@daynix-com.20210112.gappssmtp.com header.s=20210112 header.b=Dh3UF3El; 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 s14-20020a63924e000000b004614aa5f31csi13500259pgn.255.2022.11.22.01.45.01; Tue, 22 Nov 2022 01:45:15 -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=Dh3UF3El; 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 S232742AbiKVJ15 (ORCPT <rfc822;cjcooper78@gmail.com> + 99 others); Tue, 22 Nov 2022 04:27:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60594 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232827AbiKVJ1v (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 22 Nov 2022 04:27:51 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1F0B462EE for <linux-kernel@vger.kernel.org>; Tue, 22 Nov 2022 01:27:29 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id x66so5231247pfx.3 for <linux-kernel@vger.kernel.org>; Tue, 22 Nov 2022 01:27:29 -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=eATo/hld30hJMYbs854XvpQGAeslm1I6YJ3BHDFYFEg=; b=Dh3UF3El3dMJ6YHfGqSY2/yW/4eIWI4c2NX7FXI3gZTQg52GpepQx2iYs+axwGyBch xiLrUm+XzFNiFGIfuuQRPX9rt6coTdn4F9lkTciXMvemJQXPzHd68W7F/hIphcnaTbBV 8cByzmD0CZttP5yYv4Rs0IuLYG/6TWS6YFUemU+GT8E0CXUkzN22hbt4eFMS2TinVBRl x0SmsG5H6gYOAnieaxxv5MxW4lHVdXfqFXPd2AI4NhLFOiybEtgqwU5eZikBFTVreFz9 L5njN1gHd6uREwoD6fbog1A8q5qxdd1uYNjAqvPpzZnWJaClkz1cMnLhqB2DWZd8wFyp Q9Zg== 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=eATo/hld30hJMYbs854XvpQGAeslm1I6YJ3BHDFYFEg=; b=HvrAGx6QTcpdHjYda2SfTtGPYxZyxQWV0JXncRNHovsYvF2Rv3OvEal2/jlzgc2kjR EoKdNrFKYPQ3tLo0rEWmfDt87tn6cFRhlOtupTKVGbRKSmvXYrwWkjVaj2UVfHj9ZkGn ynHZnI1J5vCwtUEYB6jwN/aEfg1IOGFH1/OP4Se1CZmhv1SzibKhOiOBZX5NzsZoKKmT jV8FfXdZtH96S5af+kmERBgsKxdH958+TfjExJ97QhqVv9ESB1P2TTfXIXujjeeevtt8 m4JQDUIttpcC9DvhXJHtCTXbg4npQt0wXnYwZ9k4+WykFXRUm3ZYKQfGByGEkroTmDCc b/4w== X-Gm-Message-State: ANoB5pl83uMjVQWZh8ygHDqnXl3QDjR5ELPVCTtUFax4Xy9M2mALITCF o+DE0pgLNfN0MqnPJxNMjTEXT8S+pOVX4A== X-Received: by 2002:aa7:9293:0:b0:56b:9bf4:c1c4 with SMTP id j19-20020aa79293000000b0056b9bf4c1c4mr14057458pfa.67.1669109249227; Tue, 22 Nov 2022 01:27:29 -0800 (PST) Received: from fedora.flets-east.jp ([2400:4050:c360:8200:8ae8:3c4:c0da:7419]) by smtp.gmail.com with ESMTPSA id g10-20020a170902d1ca00b00178acc7ef16sm9678567plb.253.2022.11.22.01.27.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 01:27:28 -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, 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] igbvf: Regard vf reset nack as success Date: Tue, 22 Nov 2022 18:27:07 +0900 Message-Id: <20221122092707.30981-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?1750189018477492943?= X-GMAIL-MSGID: =?utf-8?q?1750189018477492943?= |
Series |
igbvf: Regard vf reset nack as success
|
|
Commit Message
Akihiko Odaki
Nov. 22, 2022, 9:27 a.m. UTC
vf reset nack actually represents the reset operation itself is
performed but no address is not assigned. Therefore, e1000_reset_hw_vf
should fill the "perm_addr" with the zero address and return success on
such an occassion. This prevents its callers in netdev.c from saying PF
still resetting, and instead allows them to correctly report that no
address is assigned.
Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com>
---
drivers/net/ethernet/intel/igbvf/vf.c | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
Comments
Dear Akihiko, Thank you for your patch. Am 22.11.22 um 10:27 schrieb Akihiko Odaki: > vf reset nack actually represents the reset operation itself is > performed but no address is not assigned. Therefore, e1000_reset_hw_vf Is … no … not assigned … intentional? > should fill the "perm_addr" with the zero address and return success on > such an occassion. This prevents its callers in netdev.c from saying PF occasion > still resetting, and instead allows them to correctly report that no > address is assigned. In what environment do you hit the problem? […] Kind regards, Paul
Hi, On 2022/11/22 23:17, Paul Menzel wrote: > Dear Akihiko, > > > Thank you for your patch. > > > Am 22.11.22 um 10:27 schrieb Akihiko Odaki: >> vf reset nack actually represents the reset operation itself is >> performed but no address is not assigned. Therefore, e1000_reset_hw_vf > > Is … no … not assigned … intentional? > >> should fill the "perm_addr" with the zero address and return success on >> such an occassion. This prevents its callers in netdev.c from saying PF > > occasion I have just sent v2 with the message fixed. > >> still resetting, and instead allows them to correctly report that no >> address is assigned. > > In what environment do you hit the problem? I found this bug when I was developing a QEMU patch to emulate 82576. Regards, Akihiko Odaki > > […] > > > Kind regards, > > Paul
diff --git a/drivers/net/ethernet/intel/igbvf/vf.c b/drivers/net/ethernet/intel/igbvf/vf.c index b8ba3f94c363..2691ae2a8002 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 <linux/etherdevice.h> + #include "vf.h" static s32 e1000_check_for_link_vf(struct e1000_hw *hw); @@ -131,11 +133,18 @@ 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; + } } }