Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp3675992pxv; Mon, 26 Jul 2021 09:11:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylm3v0Y6L2Hi3HLmWqQWx/mYVa5auhF8SiyAQ4GWwc96mxECIKiPfSl46FYCR01H94DMS0 X-Received: by 2002:a05:6638:3181:: with SMTP id z1mr17223021jak.100.1627315890410; Mon, 26 Jul 2021 09:11:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627315890; cv=none; d=google.com; s=arc-20160816; b=QYM+sFOuwhECULh9T+osCD+yR7Gtcs9WQfvBmpErpn18j3C6G1lXip9ol7QyD8re1C Se5SVq+8wCaIkUImrCBPb+n68Qt+Vm30SSXusX/LBN5HSw1LAjJSurmPnPCudz80zG4r YgLCU+Qta6YexOrnn7MURqkiM6W3GUbkTYACZbwOvb4cp07DraZX2/2gqYpv9ZfQae/q XQMNXMLRZV8PwbozZgzq/i7CulYRCCvsRWRZ6LjK4lHxhvng235bs5xcivDpdYXBOCvG DFlGdU73sxp5ajYiAgBIW1uyba0a96C0VVeDyF4SxIajz9qH4HlspLjvzd+G91IYLdDe 9Lug== 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=QQOj+i27jX0cJ+OKgWkIkHPIq4WkrZNAdBQCkG4L2AM=; b=hddqsBn1E5iNzDVZ4Wa1ZkRxOTvB7OqlPH8pIKI1eQ2IiqeT28YWva/YOApaspDBDs FzluYOJK6c9M9sFxzpc1h+AXeeFs9R49+qkB8Y7Gmx1l04s08GTP4/rU2LgB//q6k+iu ICeIxzUnNWw5hWHrTVjnsAW4B0b4e1KPt/dNgl3n4xuI3DA1Wpwt951JQLiopXBJdX56 a84lkkQ/A9tGQMxnqEAcHkRTgXBBUa69h/cRugcLKd9H/rYr0qnnmlKhLsBrwZtT+cHX mDFnK/ENRr5KDgrdWH3lbFa2rUXAVhamJzWpFPRsThsx4remB07DkH8GrOEC8V4gvv30 Icrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="pLZzy/W6"; 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 s12si262977iog.99.2021.07.26.09.11.15; Mon, 26 Jul 2021 09:11:30 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="pLZzy/W6"; 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 S234349AbhGZP3J (ORCPT + 99 others); Mon, 26 Jul 2021 11:29:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:56410 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236361AbhGZPQj (ORCPT ); Mon, 26 Jul 2021 11:16:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6329860F38; Mon, 26 Jul 2021 15:57:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1627315027; bh=o+Hl5PxnNN66nfBYS6wwfVNpuDJJjn/wYQjy4g+risI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pLZzy/W6RjDei+PnhOrmRvTflBs8LXFmK5yncPNMrcd7ArV9S4PnhvPjOevBoOWuR mdLVHjgTKJioB8UmkvmOUjQgr+DopACe3iufYrK5dAGtJ/6KR8fxsLjYB2GHOxDc2m cRpJnrIEabligeNDXYVXIun9aEfKS+ovyMaYqPTE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jian Shen , Guangbin Huang , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.4 057/108] net: hns3: fix rx VLAN offload state inconsistent issue Date: Mon, 26 Jul 2021 17:38:58 +0200 Message-Id: <20210726153833.508400110@linuxfoundation.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210726153831.696295003@linuxfoundation.org> References: <20210726153831.696295003@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: Jian Shen [ Upstream commit bbfd4506f962e7e6fff8f37f017154a3c3791264 ] 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 Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- .../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 fc275d4f484c..ea348ebbbf2e 100644 --- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c @@ -2119,6 +2119,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.30.2