Received: by 10.213.65.68 with SMTP id h4csp2152092imn; Sun, 8 Apr 2018 21:03:22 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+fZz3sPAjL0AMtLkEeLFCVLzG0elD9G7SPXVpWMkfACVp7xB5ipV0M14U5JgqibW2sfjW3 X-Received: by 2002:a17:902:748a:: with SMTP id h10-v6mr3261834pll.160.1523246602566; Sun, 08 Apr 2018 21:03:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523246602; cv=none; d=google.com; s=arc-20160816; b=RM/kFpoeupZ4jx/JdFe4Hjicigcf4WL8Gh61EyklA7L8IRreJrQiMnsxkvNa97B4hE gSx9/jaIVQARbV8tFZuc935UBlto3U04SRKbjMGP5YZ9fNuO56zBNRbk1CO85VlD40r+ DJAeFNgpjlJLZivqHBrN8r/hD0wxS6U8uHQaaIVJfjM3NMlhRwDLOMySinvADjr6SC6I x/fJ12QANc2if/G1tIA8rcJojeXJ9xJcaPEb1bCPnCUMmMZHUQXHRv+1mvFWtt6c40by ro/bIEz312FZHQfFy/APnhBp42YkAVkavXuhg/re44eh/WIl17qt20XV3LoBJ8VaZgEH SA1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=2fnMJqFijsmEbux3fDPHyXSPu9IXUjOA1dKxW03PaM0=; b=miyoZFHUwk5HfPIKowwIbRb+wVbfvK4eTJmUIB8ZVk5hmgiEfKGYE2puPnJJY93y+L HqJBmcir/NQpa9q9to3k5kSGIOabKNoE3wZwI8yK6QKFixCZMbnHpS1FBW9NdwxvllNF 5oamBUBYwXuQ8pvWgnAdw1J1GGX2+cZVycTV9SePpmszKAN8EAena/3qA7bgYaqLh6sm TpiQaBh2UWY4pJWApgp13sMJsB7lLQk2aOduj6f931sTR5+k6BBYRB9WOJz0Brhlnq+i pKjiO/wS5zc1rSbI1iOwibbm/F5HlntVJDvoiqlQwsFZ8P7VzqQ0YHW7epv0TR1jNUKV f3oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=hJvi5oCh; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k70si10570746pga.118.2018.04.08.21.02.44; Sun, 08 Apr 2018 21:03:22 -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; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=hJvi5oCh; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754099AbeDIDzQ (ORCPT + 99 others); Sun, 8 Apr 2018 23:55:16 -0400 Received: from mail-bn3nam01on0092.outbound.protection.outlook.com ([104.47.33.92]:62923 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753814AbeDIASv (ORCPT ); Sun, 8 Apr 2018 20:18:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2fnMJqFijsmEbux3fDPHyXSPu9IXUjOA1dKxW03PaM0=; b=hJvi5oCh1Zo2VIBIrKbzlWPfEme8AMHNduJkhtXYyYxaYVxXbDlAxtaOYXrKiztMYKNxnl0d4lw2wlm5n3CN+JG9kiWPJtd2AZdwiH2+Ur8dJaF6gCrrzVOC2IuS2HG1ad4VywE332/GwOQkvpDN+lzGfFA7I4MZRsVAnHml3dE= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1128.namprd21.prod.outlook.com (52.132.133.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:18:42 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:18:42 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Ngai-Mint Kwan , Jacob Keller , Jeff Kirsher , Sasha Levin Subject: [PATCH AUTOSEL for 4.15 088/189] fm10k: fix "failed to kill vid" message for VF Thread-Topic: [PATCH AUTOSEL for 4.15 088/189] fm10k: fix "failed to kill vid" message for VF Thread-Index: AQHTz5g0VrnpesOQ9kay0vnMmJe/rQ== Date: Mon, 9 Apr 2018 00:17:54 +0000 Message-ID: <20180409001637.162453-88-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1128;7:Xi8WDN2MYKRRfh40puGTvCZeeBwSEkHTKEqLhG8OTzAmX7bvKdFWBsGEITuAvNQ9akSpi5AaJb2T5HSUdg56zbEd+hKX0qEZRvof33fxAMwYqgZATZHEvlYW6sVL8VivCKOzbbT9LjVwLXwKn3w3gxgCDfxm27RpM8jjef7kBE9cKii9OpdcMPxdkp5t+mxfeNlFtGnhoVQ6USThQoCmfEBU2uoZxbpvFFjFKVLoG2065ibd+MVOQjv+2JE9iHHH;20:7tJlnP3ar3oAMfXHtlabRkVHJlvFzz2nXVyqztVQM1Y/fy6YdTJsmAB5yMwsL76RzyKbosSDR9Hfbt4hHk3DLB0JYTJ5Cz0JwwsoTXeeTim/JafxTU7F91ITcnCtEvbGR+IJDija7Ie8Mo26VGpjeimJxsbkkr8EMgWjsRBpe20= x-ms-office365-filtering-ht: Tenant X-MS-Office365-Filtering-Correlation-Id: 380a5e90-166c-482e-c8e4-08d59daf737c x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(48565401081)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7193020);SRVR:DM5PR2101MB1128; x-ms-traffictypediagnostic: DM5PR2101MB1128: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1128;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1128; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(396003)(376002)(366004)(39380400002)(199004)(189003)(66066001)(86362001)(59450400001)(3660700001)(3280700002)(2900100001)(25786009)(36756003)(6506007)(76176011)(2906002)(6486002)(86612001)(99286004)(102836004)(1076002)(7736002)(97736004)(2616005)(446003)(486006)(11346002)(476003)(26005)(305945005)(6666003)(6512007)(4326008)(107886003)(478600001)(6436002)(5660300001)(10290500003)(5250100002)(22452003)(15650500001)(316002)(105586002)(186003)(8676002)(110136005)(54906003)(72206003)(53936002)(2501003)(68736007)(14454004)(6116002)(8936002)(3846002)(81156014)(10090500001)(106356001)(81166006)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1128;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: FpZ3Kn+i5ELVJ08U9HquVdqdtPxfzr1Rd6BmR9e7xwPPoJYH/ydpcy5WdzReFhNBNuEKG48n/JT1uQbMzOD+6NbJ00HIByWc2DZA/rAWJDjiHPH+zSEs8ofbow0hR1EJGZGOxPU6tpoySZIN6Ri/C6YcCym6rBeWjO6hQaoKwcRn2t7COxJMUX4Ysi1g2uvsBafdxtbIqWgsjkEq5zGoXDTeBBi/2bi9jTT7qwjQ9xc5BVDs3XTHfXJrbvOvhPAlurYmtIU4u+LOstOTL7JzeYxCEFrdPnQu5XJ5SMw1A/Tqge6tsncdtOVPNvkr9mNpBBKyAVOPiYoQptPl5xRRKNipEgQOXUFY205BmPNjUoSSKn7caHOm9g01gZIobxIto5O72LsPQQbvKxlvhDpr9Xpuy2xdiZSjejcvTtMSEOo= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 380a5e90-166c-482e-c8e4-08d59daf737c X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:17:54.9917 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1128 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/net/ethernet/intel/fm10k/fm10k_netdev.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c b/drivers/net/= ethernet/intel/fm10k/fm10k_netdev.c index adc62fb38c49..61d062836402 100644 --- a/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c +++ b/drivers/net/ethernet/intel/fm10k/fm10k_netdev.c @@ -934,8 +934,12 @@ static int fm10k_update_vid(struct net_device *netdev,= u16 vid, bool set) if (vid >=3D VLAN_N_VID) return -EINVAL; =20 - /* 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; =20 /* update active_vlans bitmask */ @@ -954,6 +958,12 @@ static int fm10k_update_vid(struct net_device *netdev,= u16 vid, bool set) rx_ring->vid &=3D ~FM10K_VLAN_CLEAR; } =20 + /* 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 */ --=20 2.15.1