Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13475555ybl; Sun, 29 Dec 2019 12:48:49 -0800 (PST) X-Google-Smtp-Source: APXvYqykGdB9ZEbGcFi8VbTNGYFRbaDgNInlEtM1N05WvDslx2WmO2Esl+JgRnp9AAmDAKCYJPAr X-Received: by 2002:a9d:133:: with SMTP id 48mr68021737otu.15.1577652529598; Sun, 29 Dec 2019 12:48:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652529; cv=none; d=google.com; s=arc-20160816; b=h4M7V7QiQYyWEiIaZklnl8IDl92duX4lnq9wMa7XLdoweCJpeJGPlHY7m1+PAEyGcm lW8Vo7lrmYJcKcVfnUuNKscDXNq8Rf+SBPxzyPy4WtFkS1tuCbzopSahPTTdCHtINwrC GUrUNo5i0m9LWOC16lSU9FI1FWGofprSkGmFGmeK53L2WlIt609NkZ/dZMgMaLtcYeQ9 tt//thMVI68uEmeHV6QQikAXmMeVzmAhl3Y4gETQy+pjawmIR7exgRcV5harzyZFpkIi fsFStvm2JV+iqHMMaCZuv+hKjdtBdUOIJcOIRTdZazJ4+F3jZwCDPsRnoIGB5aFclWNO BTXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=iQI2NEzLWv93dYtyrJ+dAwVASs/ZfMTFlk0Zg/o6Bg0=; b=ABT7ylv77TKASsdTBrom7qO+FVGqPQinZ9MZjXZRBT4E4pAV03qnJX1Ry3BvemWN/N IJBwg4bLRxDZA7BKzQO7dfsF5C4KS8n1y0RRYWCTMtmR98NcrVDz4JPxMPPzKxkKcDAo JpuvJyn6rJl+MKDlEZ7mlCLquWokvcKMcOMG/T1AY2t3WvaNhwbZeKnG/p70Xy7498Iq vcdf3UvGHYeplGpUT5Fl5AqbWHuIT9NGnPeAv2qi6saFsrm5bWG3EVZwB1O9mQKR/brT qHVqA8sa2/qKCu6CQ6UNjwmEtOXmdHuM9sIrRyNJ3tz5uum3dUAX3QCkzGpFJMkT3E2F hnyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Y3a/IkRY"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z22si14322233otq.94.2019.12.29.12.48.38; Sun, 29 Dec 2019 12:48:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Y3a/IkRY"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732899AbfL2RzX (ORCPT + 99 others); Sun, 29 Dec 2019 12:55:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:43942 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732879AbfL2RzV (ORCPT ); Sun, 29 Dec 2019 12:55:21 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B2855222C3; Sun, 29 Dec 2019 17:55:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577642120; bh=fsAlUN/G6n68DhtQhTV/M/YPqQwOFu4GkGS865YO4OA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y3a/IkRYxpcZcYJaMPntskD3zo3YTXZt3AFR70M/qaSr4pANJUjaWYFwCk4f0tEhG aSzU8PFvoESx62xUlgwdYm1Eidb5B2+lNWIiL769bxQAiMWO2BH5FJndJzoyqfnGiz /OGKbSwr8j8VmvPtF3MEP3kCJQmDaDph9BGT/dOE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Akeem G Abodunrin , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 5.4 350/434] ice: Only disable VF state when freeing each VF resources Date: Sun, 29 Dec 2019 18:26:43 +0100 Message-Id: <20191229172725.220428240@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Akeem G Abodunrin [ Upstream commit 1f9639d2fb9188a59acafae9dea626391c442a8d ] It is wrong to set PF disable state flag for all VFs when freeing VF resources - Instead, we should set VF disable state flag for each VF with its resources being returned to the device. Right now, all VF opcodes, mailbox communication to clear its resources as well fails - since we already indicate that PF is in disable state, with all VFs not active. In addition, we don't need to notify VF that PF is intending to reset it, if it is already in disabled state. Signed-off-by: Akeem G Abodunrin Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c index b45797f39b2f..c0637a0cbfe8 100644 --- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c @@ -317,8 +317,9 @@ void ice_free_vfs(struct ice_pf *pf) pf->num_alloc_vfs = 0; for (i = 0; i < tmp; i++) { if (test_bit(ICE_VF_STATE_INIT, pf->vf[i].vf_states)) { - /* disable VF qp mappings */ + /* disable VF qp mappings and set VF disable state */ ice_dis_vf_mappings(&pf->vf[i]); + set_bit(ICE_VF_STATE_DIS, pf->vf[i].vf_states); ice_free_vf_res(&pf->vf[i]); } } @@ -1287,9 +1288,12 @@ static void ice_vc_notify_vf_reset(struct ice_vf *vf) if (!vf || vf->vf_id >= vf->pf->num_alloc_vfs) return; - /* verify if the VF is in either init or active before proceeding */ - if (!test_bit(ICE_VF_STATE_INIT, vf->vf_states) && - !test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) + /* Bail out if VF is in disabled state, neither initialized, nor active + * state - otherwise proceed with notifications + */ + if ((!test_bit(ICE_VF_STATE_INIT, vf->vf_states) && + !test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states)) || + test_bit(ICE_VF_STATE_DIS, vf->vf_states)) return; pfe.event = VIRTCHNL_EVENT_RESET_IMPENDING; -- 2.20.1