Received: by 10.192.165.148 with SMTP id m20csp557298imm; Wed, 25 Apr 2018 04:13:39 -0700 (PDT) X-Google-Smtp-Source: AIpwx494jviJeFp5vK84k+lkT+wE9WD2IMi+6aLBzshQwCQu5oLKjiXvMWQxAcsFz/tqyYmkDYQj X-Received: by 2002:a17:902:265:: with SMTP id 92-v6mr28038777plc.368.1524654819032; Wed, 25 Apr 2018 04:13:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524654819; cv=none; d=google.com; s=arc-20160816; b=fbO7g7KhM7SbdqH0M0saKxuismcb//G7/4p+dBZRP7wbe4O5Rr5KU2AtWpt4V9ehcw ptSbLWwcXh7BzK7XygB7xmqMEhtjzAU4u114yzujVGmtCgL6ZNcAfEln0Dq0DdPwOAPB llYKg3Q/Fdc6XwPBdZhWnH/pQ6ZH2XwTj+gV41rof6yru1GMM0ZgCcycz3LzVgDcYybT rAfloK4otoGdZHzQfGBefcHDcTgKFVeqBL29bZvdGh4d+r9lqoeC3Ra1GVCFY06Acs5t 18sn21eY7OKLppCn3omLxhNOorRE2CwwXkgeQ2v0HUB44Ufma1rVtgN5WDtmWT2iI8WZ iGMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=APgKXjM/YXa4KGzXSxs6e2khlh00wEWTx6vfdP2MOgM=; b=aZ9MDtmHA32Doz2W2YjMWh6R65d/oHf/qfJtuh6DgZHQWhMWjPeL/28XmKB4qD4k5d yuWuBo+P8xsxA0SFGEhpfPrKhRj9Iodserbmu/mVjLy+lKwj1DaVCF/FZbzoTxlt8e0N MBPFDaN+UrPxaH2LXkJhmRJPypK47N3M3pWWRt+ySxr7CIuebxfHLhoTsHHXbZuDEqnU NXO/wq6ulsvG/A9xpyoQ4O68eSWznTRxURiEhO2t6WvXab9hgUD8HN//zvzwocRWYNUo hqem9DLkG7DJkVDd8Prf6Nk9YemUR9D5R1cigK+fmtcSfPYsIycgWJgLRV8Tgg5kTFED ISpw== ARC-Authentication-Results: i=1; mx.google.com; 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 k2-v6si16133094plt.406.2018.04.25.04.13.24; Wed, 25 Apr 2018 04:13:38 -0700 (PDT) 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; 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 S1753875AbeDYKkv (ORCPT + 99 others); Wed, 25 Apr 2018 06:40:51 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:52160 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753223AbeDYKkf (ORCPT ); Wed, 25 Apr 2018 06:40:35 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 207AB481; Wed, 25 Apr 2018 10:40:33 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ngai-Mint Kwan , Jacob Keller , Krishneil Singh , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.14 086/183] fm10k: fix "failed to kill vid" message for VF Date: Wed, 25 Apr 2018 12:35:06 +0200 Message-Id: <20180425103245.955091246@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Ngai-Mint Kwan [ Upstream commit cf315ea596ec26d7aa542a9ce354990875a920c0 ] When a VF is under PF VLAN assignment: ip link set vf <#> vlan This will remove all previous entries in the VLAN table including those generated by VLAN interfaces created on the VF. The issue arises when the VF is under PF VLAN assignment and one or more of these VLAN interfaces of the VF are deleted. When deleting these VLAN interfaces, the following message will be generated in "dmesg": failed to kill vid 0081/ for device This is due to the fact that "ndo_vlan_rx_kill_vid" exits with an error. The handler for this ndo is "fm10k_update_vid". Any calls to this function while under PF VLAN management will exit prematurely and, thus, it will generate the failure message. Additionally, since "fm10k_update_vid" exits prematurely, none of the VLAN update is performed. So, even though the actual VLAN interfaces of the VF will be deleted, the active_vlans bitmask is not cleared. When the VF is no longer under PF VLAN assignment, the driver mistakenly restores the previous entries of the VLAN table based on an unsynchronized list of active VLANs. The solution to this issue involves checking the VLAN update action type before exiting "fm10k_update_vid". If the VLAN update action type is to "add", this action will not be permitted while the VF is under PF VLAN assignment and the VLAN update is abandoned like before. However, if the VLAN update action type is to "kill", then we need to also clear the active_vlans bitmask. However, we don't need to actually queue any messages to the PF, because the MAC and VLAN tables have already been cleared, and the PF would silently ignore these requests anyways. Signed-off-by: Ngai-Mint Kwan Signed-off-by: Jacob Keller Tested-by: Krishneil Singh Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c @@ -815,8 +815,12 @@ static int fm10k_update_vid(struct net_d if (vid >= VLAN_N_VID) return -EINVAL; - /* Verify we have permission to add VLANs */ - if (hw->mac.vlan_override) + /* Verify that we have permission to add VLANs. If this is a request + * to remove a VLAN, we still want to allow the user to remove the + * VLAN device. In that case, we need to clear the bit in the + * active_vlans bitmask. + */ + if (set && hw->mac.vlan_override) return -EACCES; /* update active_vlans bitmask */ @@ -835,6 +839,12 @@ static int fm10k_update_vid(struct net_d rx_ring->vid &= ~FM10K_VLAN_CLEAR; } + /* If our VLAN has been overridden, there is no reason to send VLAN + * removal requests as they will be silently ignored. + */ + if (hw->mac.vlan_override) + return 0; + /* Do not remove default VLAN ID related entries from VLAN and MAC * tables */