Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3525521pxv; Mon, 19 Jul 2021 02:19:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwwoMPvAn0+3TFLojNYfyJXjMWNnc54V8Jiteh2KiTnZZkXhrwwIvEROnkzbHnYElvfEPEo X-Received: by 2002:a02:11c6:: with SMTP id 189mr20832313jaf.20.1626686356889; Mon, 19 Jul 2021 02:19:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626686356; cv=none; d=google.com; s=arc-20160816; b=wqRE0ie0u65abrWVcyF/emjsILpINIihMdxf0hyfH3m4o3gtdxyC5HX5Lw+hJILp5r UCfZgHzr0ubly0pgTvjLh3kty3REpbfcF2iBXlAxvMIiYNYSw352B9O41qC6gCs/kD5+ ENQK0bu41nS3tsSzcgyCreVVsLAdFvQK2JlCj5MeRb+YnGxGJvKkwLr+bKX8YHy8gsfI YaYaGLNmjlOZWrLyXPj9l3XFfpe26REh+6swLLlbXOAqOFJvS79JvsDqfPVKpHCB0szh Dw3SvpFSgJnG7q1xu88Cuc7F/SCIOydmBpVSIvGaFmmXtSvTyi7frLspNyWUrt2Z67Tt RtiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=K0wMOn3jowEaUcjw+QUwFjBbv/bh6Y0myIMBpb1ZO+Y=; b=dqWvJTc3Zv5ghJIG5sZ9phDVn8mTb/yQAaGZp3+vYTQOT4tMy1256D6vCn8v2GOar1 9AEPSllHldW33X5WVXy6QVA3pwMNwYvEURi+cBzy4iIgV4YTGJ/eHjLWFSg/Pq9c01zY tL8Tava8+HXJ0AySFB+WA5eKnPxRbWEWZRSiDwXM1VRSux4SrLleKd0IUIrHwolbMTTz hUMe8Zoyi1987SP7gtYH9cGT/ZtmRxDn0EwAb2UkuVMaOj1rufZPMnSAlNI2RcbtZ1UU JIrPz5UiS5S3/UIM69+aFy88EDEKWoawXaWQyoFHjG5gfR9NVTb3HjDuAdQ/+x6DQQdS 7ZXg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p31si22321342jac.95.2021.07.19.02.19.05; Mon, 19 Jul 2021 02:19:16 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235932AbhGSIgF (ORCPT + 99 others); Mon, 19 Jul 2021 04:36:05 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:11446 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235428AbhGSIgA (ORCPT ); Mon, 19 Jul 2021 04:36:00 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4GSx316W5gzcfPs; Mon, 19 Jul 2021 17:13:17 +0800 (CST) Received: from dggemi759-chm.china.huawei.com (10.1.198.145) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.2176.2; Mon, 19 Jul 2021 17:16:39 +0800 Received: from localhost.localdomain (10.67.165.24) by dggemi759-chm.china.huawei.com (10.1.198.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2176.2; Mon, 19 Jul 2021 17:16:38 +0800 From: Guangbin Huang To: , , CC: , , , , Subject: [PATCH net 4/4] net: hns3: fix rx VLAN offload state inconsistent issue Date: Mon, 19 Jul 2021 17:13:08 +0800 Message-ID: <1626685988-25869-5-git-send-email-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1626685988-25869-1-git-send-email-huangguangbin2@huawei.com> References: <1626685988-25869-1-git-send-email-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggemi759-chm.china.huawei.com (10.1.198.145) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jian Shen Currently, VF doesn't enable rx VLAN offload when initializating, and PF does it for VFs. If user disable the rx VLAN offload for VF with ethtool -K, and reload the VF driver, it may cause the rx VLAN offload state being inconsistent between hardware and software. Fixes it by enabling rx VLAN offload when VF initializing. Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Jian Shen Signed-off-by: Guangbin Huang --- drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c index 52eaf82b7cd7..8784d61e833f 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -2641,6 +2641,16 @@ static int hclgevf_rss_init_hw(struct hclgevf_dev *hdev) static int hclgevf_init_vlan_config(struct hclgevf_dev *hdev) { + struct hnae3_handle *nic = &hdev->nic; + int ret; + + ret = hclgevf_en_hw_strip_rxvtag(nic, true); + if (ret) { + dev_err(&hdev->pdev->dev, + "failed to enable rx vlan offload, ret = %d\n", ret); + return ret; + } + return hclgevf_set_vlan_filter(&hdev->nic, htons(ETH_P_8021Q), 0, false); } -- 2.8.1