Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3666463pxp; Tue, 15 Mar 2022 03:55:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyamCPnI1OoTtd2ufuevRmrELPqjgdgYUr+xnIgwkpTHhUe0KeYzMetOlDWvL4QKfFxA3Tl X-Received: by 2002:a63:4e56:0:b0:381:4051:41 with SMTP id o22-20020a634e56000000b0038140510041mr7172164pgl.365.1647341746135; Tue, 15 Mar 2022 03:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647341746; cv=none; d=google.com; s=arc-20160816; b=EJeeluG648sGgExhCQIZe1mUZTTONpIPIHecLu48oExzanv0iCeQvODYH8hIat065t gfuLFa52+SSTbRmZc/9AHnaeenn4/x1oW28i/tw8XJsn/UjYHhMMlPexBnu0NnKB0FQy 2O7kiFgqGR4T4AoackkWSfKYODsVt/fLaO9NTw8BIssAsR5Eiaj/mO8/x/iiWaqPXEAv 1dy0rnvU02dnoS3xBcyDlxAimf9aXjg73ggiwPUh48gmuC6Rn+gsA7X/PdTGDBFGWOrU TCEL6kUSKy96UucXWneykNRkO3faPsmKi4Ia6+oidnqLw8Bo/8AteZ4Elh6ExnupiP3Q KAuw== 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=6Ctn5pxXnV23HNwRrM3RjPye74hM7c4B0NDMQhfeNQc=; b=D54+UIgTmcT4VpOIdlX56KvXMdhvcd1GUq2lYx0+Bg931CcW9T1TlLmkkpCACybGsY mEkCJgkwzD/AI8hIeSGW7U/zWbQU3Qwolhmj3zpzsio1cEfyhgdGmnH7Z707ff1t85TH 7YgPYI+hVHHt0AIlG8wd4gpuiRzDEATdhwhVVMnOeIYhOWEVmcsVszqrHGhBfVVBqORP GcAr5My0OxSlqth5JRLU/pAw8ycZo2jPOjxVoR6SWBGB7kYZcek5MfEVhTmC80wdUJAG dsTD2U9iGlGg9IlTC8D3+Kg5DGbMmhCFCn+CaetXBNBxn3nlSFlKT4kylbJGE0IMYJzp oNSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YVoL8Nin; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m22-20020a656a16000000b00372b111bf20si22089699pgu.19.2022.03.15.03.55.34; Tue, 15 Mar 2022 03:55:46 -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=@linuxfoundation.org header.s=korg header.b=YVoL8Nin; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241385AbiCNMNQ (ORCPT + 99 others); Mon, 14 Mar 2022 08:13:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241584AbiCNMIz (ORCPT ); Mon, 14 Mar 2022 08:08:55 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53DBE4E385; Mon, 14 Mar 2022 05:05:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id C1A5CB80DED; Mon, 14 Mar 2022 12:05:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9E3F7C340E9; Mon, 14 Mar 2022 12:05:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1647259528; bh=Oi2nDr1BOouXK2/axWMtjdtL6BaEKLa5Dz+J4JrchiY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YVoL8NingUjhGicveFWwRXBW7mY8pV+jrautXeaIXgiJKDLU0ZxP1equjc6wG5pgC yEMEloIiD1iK9hOCbOPCnDli8/sdbTrz6xmmz3OCXwhpG/RoUn2idsS2BKIMKTw41O jNqvAV0jS1H0RDxQ6LF/jfddC570B2fiaMcr1p0Y= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Norbert Ciosek , Michal Maloszewski , Konrad Jankowski , Tony Nguyen , Sasha Levin Subject: [PATCH 5.15 028/110] iavf: Fix handling of vlan strip virtual channel messages Date: Mon, 14 Mar 2022 12:53:30 +0100 Message-Id: <20220314112743.820858392@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220314112743.029192918@linuxfoundation.org> References: <20220314112743.029192918@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham 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 From: Michal Maloszewski [ Upstream commit 2cf29e55894886965722e6625f6a03630b4db31d ] Modify netdev->features for vlan stripping based on virtual channel messages received from the PF. Change is needed to synchronize vlan strip status between PF sysfs and iavf ethtool. Fixes: 5951a2b9812d ("iavf: Fix VLAN feature flags after VFR") Signed-off-by: Norbert Ciosek Signed-off-by: Michal Maloszewski Tested-by: Konrad Jankowski Signed-off-by: Tony Nguyen Signed-off-by: Sasha Levin --- .../net/ethernet/intel/iavf/iavf_virtchnl.c | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c index 8a1c293b8c7a..7013769fc038 100644 --- a/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c +++ b/drivers/net/ethernet/intel/iavf/iavf_virtchnl.c @@ -1460,6 +1460,22 @@ void iavf_request_reset(struct iavf_adapter *adapter) adapter->current_op = VIRTCHNL_OP_UNKNOWN; } +/** + * iavf_netdev_features_vlan_strip_set - update vlan strip status + * @netdev: ptr to netdev being adjusted + * @enable: enable or disable vlan strip + * + * Helper function to change vlan strip status in netdev->features. + */ +static void iavf_netdev_features_vlan_strip_set(struct net_device *netdev, + const bool enable) +{ + if (enable) + netdev->features |= NETIF_F_HW_VLAN_CTAG_RX; + else + netdev->features &= ~NETIF_F_HW_VLAN_CTAG_RX; +} + /** * iavf_virtchnl_completion * @adapter: adapter structure @@ -1683,8 +1699,18 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, } break; case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING: + dev_warn(&adapter->pdev->dev, "Changing VLAN Stripping is not allowed when Port VLAN is configured\n"); + /* Vlan stripping could not be enabled by ethtool. + * Disable it in netdev->features. + */ + iavf_netdev_features_vlan_strip_set(netdev, false); + break; case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING: dev_warn(&adapter->pdev->dev, "Changing VLAN Stripping is not allowed when Port VLAN is configured\n"); + /* Vlan stripping could not be disabled by ethtool. + * Enable it in netdev->features. + */ + iavf_netdev_features_vlan_strip_set(netdev, true); break; default: dev_err(&adapter->pdev->dev, "PF returned error %d (%s) to our request %d\n", @@ -1918,6 +1944,20 @@ void iavf_virtchnl_completion(struct iavf_adapter *adapter, spin_unlock_bh(&adapter->adv_rss_lock); } break; + case VIRTCHNL_OP_ENABLE_VLAN_STRIPPING: + /* PF enabled vlan strip on this VF. + * Update netdev->features if needed to be in sync with ethtool. + */ + if (!v_retval) + iavf_netdev_features_vlan_strip_set(netdev, true); + break; + case VIRTCHNL_OP_DISABLE_VLAN_STRIPPING: + /* PF disabled vlan strip on this VF. + * Update netdev->features if needed to be in sync with ethtool. + */ + if (!v_retval) + iavf_netdev_features_vlan_strip_set(netdev, false); + break; default: if (adapter->current_op && (v_opcode != adapter->current_op)) dev_warn(&adapter->pdev->dev, "Expected response %d from PF, received %d\n", -- 2.34.1