Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp850777rdg; Fri, 11 Aug 2023 01:36:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IElt+M5Za9Id8F8I8Mad9KtST2knFfn4ZQV9rF3423UB5jArU8jwZiHB1DIb9tduyvIJCfh X-Received: by 2002:aa7:cfd1:0:b0:523:d51:bb2 with SMTP id r17-20020aa7cfd1000000b005230d510bb2mr994954edy.15.1691742973145; Fri, 11 Aug 2023 01:36:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691742973; cv=none; d=google.com; s=arc-20160816; b=DDA8hDHrpHUt87T+5vQK6Hc/t/pWiU8FnE9F+QCO87xFpNiuBXVpK4ZlF0MiOmXF9c x8SnmXstDjlCNOv4sLdC8TNofCWfxfwyn0OADesTr3Uj9/167ru14NOxu4Zdnq+ipnbT IFVrq4jyvbwb7rq2mbijUsUdpGOIwwyN2eee3SMgTpr/DfM7QDVtv0RTOpUlnoCixuIz OnKhvYJpZDAYDN3Vngq0oER48aSLKAbW3+tYSMTViAD6Qzvfn+xCaONiYRYVPVF3PC9U C4/cNNZptes5Zb+N1Q0i3Yp4/EcW+aiOuKacL+FmBXsTETEZxE2rNLDLuyL9Me6deuBI 8ycw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Xn0qkCPb+OG4etF/4CweACpxkW6uLvMKCcTztxKbaJE=; fh=kLJfcuh7/q8oMVOrzCP9vFd6VBvx8myd1ju6IuDeIqQ=; b=j2s+fZnoYp5PBvBuZtN95kpFKxO+s3ntV3OIg40cYsv6wjZXEAq/gSUscmiYekEIXM IBQREBrDZwd720DZMb148hCFg+Q5GXqMvA3GVFkrNismobBfkAv6v07ZNutF+M+cCeDW 72C5ZFeNIZCSv5PdQUC2qV91ymXgLF/rn9KBxntH5F2vqn4GB1zfEKjWaZyuz5ezav0F mzFoTmywiII5KJUwwl0P4epxFi9jBIkx2ojy+pFXWHdskd/h5+OgXzeJiiZGpzsExHE5 zRNso7ZVMMI3KNe1s6VQaSlxhEUB9xt4k2DnuOBT3jnE6ORL7O4xkslWrtvjMwsPrxuo 0c4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VnfqtzJ9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r13-20020aa7d58d000000b005221edcf201si2966623edq.57.2023.08.11.01.35.48; Fri, 11 Aug 2023 01:36:13 -0700 (PDT) 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=pass header.i=@redhat.com header.s=mimecast20190719 header.b=VnfqtzJ9; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229994AbjHKIH6 (ORCPT + 99 others); Fri, 11 Aug 2023 04:07:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbjHKIH5 (ORCPT ); Fri, 11 Aug 2023 04:07:57 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C70C2130 for ; Fri, 11 Aug 2023 01:07:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1691741236; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Xn0qkCPb+OG4etF/4CweACpxkW6uLvMKCcTztxKbaJE=; b=VnfqtzJ9/v7ZZzu2N8yB+eRRQFQoTKA7hd8xQylFY/Upnn4SoLsyv5MdixbWB+rjHXnvO1 b2sxLEwlsphkL/ID8VoVeokDrV7e1vUzNCcbuiaiFgOFxgBTjOMKtEK9hNl0QwJGdy517G 0ynVHDp6vP2eURmlWG8gs+QM0SAhgK8= Received: from mimecast-mx02.redhat.com (66.187.233.73 [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-210-qc9bPcduM_ec8uKxwdE44Q-1; Fri, 11 Aug 2023 04:07:09 -0400 X-MC-Unique: qc9bPcduM_ec8uKxwdE44Q-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 44AF51C06934; Fri, 11 Aug 2023 08:07:08 +0000 (UTC) Received: from swamp.redhat.com (unknown [10.45.224.150]) by smtp.corp.redhat.com (Postfix) with ESMTP id D7C162166B25; Fri, 11 Aug 2023 08:07:05 +0000 (UTC) From: Petr Oros To: netdev@vger.kernel.org Cc: jesse.brandeburg@intel.com, anthony.l.nguyen@intel.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, Jacob.e.keller@intel.com, przemyslawx.patynowski@intel.com, kamil.maziarz@intel.com, dawidx.wesierski@intel.com, mateusz.palczewski@intel.com, slawomirx.laba@intel.com, norbertx.zulinski@intel.com, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, przemyslaw.kitszel@intel.com, horms@kernel.org Subject: [PATCH net v3 1/2] Revert "ice: Fix ice VF reset during iavf initialization" Date: Fri, 11 Aug 2023 10:07:01 +0200 Message-ID: <20230811080702.1254319-2-poros@redhat.com> In-Reply-To: <20230811080702.1254319-1-poros@redhat.com> References: <20230811080702.1254319-1-poros@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.1 on 10.11.54.6 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL, 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This reverts commit 7255355a0636b4eff08d5e8139c77d98f151c4fc. After this commit we are not able to attach VF to VM: virsh attach-interface v0 hostdev --managed 0000:41:01.0 --mac 52:52:52:52:52:52 error: Failed to attach interface error: Cannot set interface MAC to 52:52:52:52:52:52 for ifname enp65s0f0np0 vf 0: Resource temporarily unavailable ice_check_vf_ready_for_cfg() already contain waiting for reset. New condition in ice_check_vf_ready_for_reset() causing only problems. Fixes: 7255355a0636 ("ice: Fix ice VF reset during iavf initialization") Signed-off-by: Petr Oros Reviewed-by: Simon Horman Reviewed-by: Przemek Kitszel Reviewed-by: Jacob Keller --- v3: added tags from previous reviews --- drivers/net/ethernet/intel/ice/ice_sriov.c | 8 ++++---- drivers/net/ethernet/intel/ice/ice_vf_lib.c | 19 ------------------- drivers/net/ethernet/intel/ice/ice_vf_lib.h | 1 - drivers/net/ethernet/intel/ice/ice_virtchnl.c | 1 - 4 files changed, 4 insertions(+), 25 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_sriov.c b/drivers/net/ethernet/intel/ice/ice_sriov.c index 1f66914c7a202a..31314e7540f8cf 100644 --- a/drivers/net/ethernet/intel/ice/ice_sriov.c +++ b/drivers/net/ethernet/intel/ice/ice_sriov.c @@ -1131,7 +1131,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena) if (!vf) return -EINVAL; - ret = ice_check_vf_ready_for_reset(vf); + ret = ice_check_vf_ready_for_cfg(vf); if (ret) goto out_put_vf; @@ -1246,7 +1246,7 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac) goto out_put_vf; } - ret = ice_check_vf_ready_for_reset(vf); + ret = ice_check_vf_ready_for_cfg(vf); if (ret) goto out_put_vf; @@ -1300,7 +1300,7 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted) return -EOPNOTSUPP; } - ret = ice_check_vf_ready_for_reset(vf); + ret = ice_check_vf_ready_for_cfg(vf); if (ret) goto out_put_vf; @@ -1613,7 +1613,7 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos, if (!vf) return -EINVAL; - ret = ice_check_vf_ready_for_reset(vf); + ret = ice_check_vf_ready_for_cfg(vf); if (ret) goto out_put_vf; diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.c b/drivers/net/ethernet/intel/ice/ice_vf_lib.c index b26ce4425f4559..294e91c3453ccd 100644 --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.c +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.c @@ -185,25 +185,6 @@ int ice_check_vf_ready_for_cfg(struct ice_vf *vf) return 0; } -/** - * ice_check_vf_ready_for_reset - check if VF is ready to be reset - * @vf: VF to check if it's ready to be reset - * - * The purpose of this function is to ensure that the VF is not in reset, - * disabled, and is both initialized and active, thus enabling us to safely - * initialize another reset. - */ -int ice_check_vf_ready_for_reset(struct ice_vf *vf) -{ - int ret; - - ret = ice_check_vf_ready_for_cfg(vf); - if (!ret && !test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) - ret = -EAGAIN; - - return ret; -} - /** * ice_trigger_vf_reset - Reset a VF on HW * @vf: pointer to the VF structure diff --git a/drivers/net/ethernet/intel/ice/ice_vf_lib.h b/drivers/net/ethernet/intel/ice/ice_vf_lib.h index 67172fdd9bc27f..48fea6fa036210 100644 --- a/drivers/net/ethernet/intel/ice/ice_vf_lib.h +++ b/drivers/net/ethernet/intel/ice/ice_vf_lib.h @@ -215,7 +215,6 @@ u16 ice_get_num_vfs(struct ice_pf *pf); struct ice_vsi *ice_get_vf_vsi(struct ice_vf *vf); bool ice_is_vf_disabled(struct ice_vf *vf); int ice_check_vf_ready_for_cfg(struct ice_vf *vf); -int ice_check_vf_ready_for_reset(struct ice_vf *vf); void ice_set_vf_state_dis(struct ice_vf *vf); bool ice_is_any_vf_in_unicast_promisc(struct ice_pf *pf); void diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl.c b/drivers/net/ethernet/intel/ice/ice_virtchnl.c index efbc2968a7bf6a..dcf628b1fccd93 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl.c @@ -3947,7 +3947,6 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event, ice_vc_notify_vf_link_state(vf); break; case VIRTCHNL_OP_RESET_VF: - clear_bit(ICE_VF_STATE_ACTIVE, vf->vf_states); ops->reset_vf(vf); break; case VIRTCHNL_OP_ADD_ETH_ADDR: -- 2.41.0