Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp4134096pxb; Mon, 8 Feb 2021 08:43:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvlbB8JLpT+DSVF/IoQ40YnO6G1HgLO+wh+YVx/B6rjemEQ1z5Dsg8VplSd2l+daQCWBY+ X-Received: by 2002:a17:906:2bce:: with SMTP id n14mr10683265ejg.171.1612802581185; Mon, 08 Feb 2021 08:43:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612802581; cv=none; d=google.com; s=arc-20160816; b=ZfsOrRalpczGOjkDuwYPJ4knoojjV74Yde7W7ByKuboYGQeH1Gt+vkEzKd5oFC2FuH DkJYjNC056WOz7pifBetMepDc1MK3zxWmHVNTZlSIVC8l3YRmT/26Q6/ynwENIvvRxJh l/gp69Q+5+0UiDsXngaaRszWZcFKZc9WXSGtREw/lJ0TT5xZ8OYkEmdrHzHaFzg0E/MI uPbmrRcrdMV6Teol1i9CZjZxkTON7kZSstf5bvBGHMhp9R/UOg6N17DHxbLqlQ0H+y9/ Y55K0/Tr9YBUIk1xZUHgNBoHDGKancYDR0QKppAfjZLZJPKkJ74Chu0lNW4ElHLJmgb3 /Wgg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=gUc2lud130P+NCDgb68puFZOQgfxWYVLNxlfF86xwPI=; b=PivBa5RjjWZ/NfBFkwYN8O4jTaXTo8zPBY14hhxwPyygyI8CcX4KfmAQU5v6a3o+ad P2PCgVIYYF4C9m55XfpfkpVI5+RbpWT/LFxxB2XzUaCybCEI4yw+VzENbSP4xDss+VPi SRMET7nd7EqTWfVJhDKofgEOT+3om0Y+IVcseg5idCTUQ5v1heG0J4yKcj+9VtK9mNOH H/NTvk2DCLZWxBFsPOSybUcdNH0r9oifrct9BB09qGrt72cJrYTm72+5r9qDw+5B8HoW a5aJOm9hCcH3+OQhiBsrmRHs1hfifpnqsC+OvfSYaSqvkU8reO33j3z7M5oe8JUhpamk 3yLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NQ1BO0Bb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u14si11815865edx.321.2021.02.08.08.42.36; Mon, 08 Feb 2021 08:43:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NQ1BO0Bb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232763AbhBHQmC (ORCPT + 99 others); Mon, 8 Feb 2021 11:42:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:60180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233532AbhBHPPP (ORCPT ); Mon, 8 Feb 2021 10:15:15 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 88F3864ECE; Mon, 8 Feb 2021 15:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1612797053; bh=JNT0e7NOCpnGy1ts2DBGh5vktxZvKrb82RMeQtxt1s0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NQ1BO0Bb6NKVz52nWjS4spFawhnG/d4mVRUAC5Np9RIl+s8xaVSQTzTpaW+rkUi3T ObgzV9lg98WRmInpJFMSTA2RQWdDWoaz/51IQOOSPpRIBRT3O5P4g3XcPDYIzRuiCF ra2DNp+85YE/MR8P9SVsARc57baMJBBTiKLEQ3ZY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Aleksandr Loktionov , Arkadiusz Kubalewski , Konrad Jankowski , Tony Nguyen , Sasha Levin Subject: [PATCH 5.4 15/65] i40e: Revert "i40e: dont report link up for a VF who hasnt enabled queues" Date: Mon, 8 Feb 2021 16:00:47 +0100 Message-Id: <20210208145810.828420855@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210208145810.230485165@linuxfoundation.org> References: <20210208145810.230485165@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Aleksandr Loktionov [ Upstream commit f559a356043a55bab25a4c00505ea65c50a956fb ] This reverts commit 2ad1274fa35ace5c6360762ba48d33b63da2396c VF queues were not brought up when PF was brought up after being downed if the VF driver disabled VFs queues during PF down. This could happen in some older or external VF driver implementations. The problem was that PF driver used vf->queues_enabled as a condition to decide what link-state it would send out which caused the issue. Remove the check for vf->queues_enabled in the VF link notify. Now VF will always be notified of the current link status. Also remove the queues_enabled member from i40e_vf structure as it is not used anymore. Otherwise VNF implementation was broken and caused a link flap. The original commit was a workaround to avoid breaking existing VFs though it's really a fault of the VF code not the PF. The commit should be safe to revert as all of the VFs we know of have been fixed. Also, since we now know there is a related bug in the workaround, removing it is preferred. Fixes: 2ad1274fa35a ("i40e: don't report link up for a VF who hasn't enabled") Signed-off-by: Aleksandr Loktionov Signed-off-by: Arkadiusz Kubalewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 13 +------------ drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 1 - 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c index c20dc689698ed..5acd599d6b9af 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c @@ -55,12 +55,7 @@ static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf) pfe.event = VIRTCHNL_EVENT_LINK_CHANGE; pfe.severity = PF_EVENT_SEVERITY_INFO; - - /* Always report link is down if the VF queues aren't enabled */ - if (!vf->queues_enabled) { - pfe.event_data.link_event.link_status = false; - pfe.event_data.link_event.link_speed = 0; - } else if (vf->link_forced) { + if (vf->link_forced) { pfe.event_data.link_event.link_status = vf->link_up; pfe.event_data.link_event.link_speed = (vf->link_up ? VIRTCHNL_LINK_SPEED_40GB : 0); @@ -70,7 +65,6 @@ static void i40e_vc_notify_vf_link_state(struct i40e_vf *vf) pfe.event_data.link_event.link_speed = i40e_virtchnl_link_speed(ls->link_speed); } - i40e_aq_send_msg_to_vf(hw, abs_vf_id, VIRTCHNL_OP_EVENT, 0, (u8 *)&pfe, sizeof(pfe), NULL); } @@ -2393,8 +2387,6 @@ static int i40e_vc_enable_queues_msg(struct i40e_vf *vf, u8 *msg) } } - vf->queues_enabled = true; - error_param: /* send the response to the VF */ return i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_ENABLE_QUEUES, @@ -2416,9 +2408,6 @@ static int i40e_vc_disable_queues_msg(struct i40e_vf *vf, u8 *msg) struct i40e_pf *pf = vf->pf; i40e_status aq_ret = 0; - /* Immediately mark queues as disabled */ - vf->queues_enabled = false; - if (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) { aq_ret = I40E_ERR_PARAM; goto error_param; diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h index 7164b9bb294ff..f65cc0c165502 100644 --- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h +++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h @@ -99,7 +99,6 @@ struct i40e_vf { unsigned int tx_rate; /* Tx bandwidth limit in Mbps */ bool link_forced; bool link_up; /* only valid if VF link is forced */ - bool queues_enabled; /* true if the VF queues are enabled */ bool spoofchk; u16 num_mac; u16 num_vlan; -- 2.27.0