Received: by 2002:a05:6520:4211:b029:f4:110d:56bc with SMTP id o17csp2119956lkv; Thu, 20 May 2021 03:53:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwkn+Oo1og1S9di+UPIfwsO5RZlc1Zz46ju63nDeoC3LcEE5d9egKXcYGNnse0bueFRtHSy X-Received: by 2002:a17:906:7e0f:: with SMTP id e15mr4002101ejr.398.1621508007237; Thu, 20 May 2021 03:53:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621508007; cv=none; d=google.com; s=arc-20160816; b=tM4iSd9hnptWA7KvNnSG3gFVaW/oepcRbhhVUuytf6JqIBaxdfxG4lleLytmqet66n IjfwzlgnZ+gJ0CEkeBBWCa2lp/byGRHYbENYePwyhJUtz5RG3ubFuy9/Xo/aE1X144rq oZ4hWxBUQyjRPWm5Rq+Ofmk17EjQWLsaKnV6DiIkPqu36PPHVpm1WikPxV1UqhRxENaa tpzULhnFPajBaNslNX1VOfPojKHo2MamblOYyb7S0laOEyzRO1FVMcsA2Uy0vpuDLj3e nV1IhjAKCKbgE5XFqgLz2p905sfxjC/mPSYnmwwfoNERKQeQok6o5ScA4iqIs+O0K0gH eTNA== 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=MrlIAQazQlOraDcPvNZpuynr497toqfAjw+YG6x00YU=; b=DzUO88NrpgqGnB2YFWW/lIfUtCa70xHO9eLlzt8qq3HrTG1jPatagBtdQ6FzX0oJuF nfux1LME5Zpff+J5nVZoZGQR/PCL+SmwUCw/ktewLinpN/6D+kiXt0qiv70hrGZ24DVg zQlzRmx34oUhB5w5q2OpbKBOVi7wiOq1brzr1gYOfzNImTNglNwXAxjEzFtsd+aExAGb Gwiua34GzMF6BQDqZdb9d+3JFjKiK6/lSVhSxUtGf81aFBS+OGrTh/WLwXEN3zUqSzut rbnyIsc+sBusBZOTYbZOazEYKhjmEHafxkf7l0T0Nngy4yhc3uUVvOlZiJt72nRLBiNK sZBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=B2QK0GsO; 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 l15si1871986edv.507.2021.05.20.03.53.03; Thu, 20 May 2021 03:53:27 -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=B2QK0GsO; 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 S238535AbhETKwO (ORCPT + 99 others); Thu, 20 May 2021 06:52:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:39730 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237123AbhETKgp (ORCPT ); Thu, 20 May 2021 06:36:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id AB0EB61C6D; Thu, 20 May 2021 09:54:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621504462; bh=dLExIPbUsLELB2mh7d2PwNf7U5Fnt958NIluJdxmVGA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B2QK0GsOtht/4DZcATBYdHbWQTw8bX67S1mqBF31grwRa4+8sMyeaA6lTgDx8m9f+ YS8RNx7ibYnVIO8gC9q5cv7+LCXtg0IYdFWgVcwKytViVxgyQfbzSFy4/JyOwYMo96 A4Glcys+DGRB5ZWjUeUMq1oa0jFlzCKMK1dj+gzk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Felix Fietkau , Ilya Lipnitskiy , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 257/323] net: ethernet: mtk_eth_soc: fix RX VLAN offload Date: Thu, 20 May 2021 11:22:29 +0200 Message-Id: <20210520092129.014745554@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092120.115153432@linuxfoundation.org> References: <20210520092120.115153432@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: Felix Fietkau [ Upstream commit 3f57d8c40fea9b20543cab4da12f4680d2ef182c ] The VLAN ID in the rx descriptor is only valid if the RX_DMA_VTAG bit is set. Fixes frames wrongly marked with VLAN tags. Signed-off-by: Felix Fietkau [Ilya: fix commit message] Signed-off-by: Ilya Lipnitskiy Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c index a52909db67f6..dbd16dd5aa04 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1041,7 +1041,7 @@ static int mtk_poll_rx(struct napi_struct *napi, int budget, skb->protocol = eth_type_trans(skb, netdev); if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX && - RX_DMA_VID(trxd.rxd3)) + (trxd.rxd2 & RX_DMA_VTAG)) __vlan_hwaccel_put_tag(skb, htons(ETH_P_8021Q), RX_DMA_VID(trxd.rxd3)); skb_record_rx_queue(skb, 0); diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h index 3d3c24a28112..ef82a30b2a0d 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -283,6 +283,7 @@ #define RX_DMA_DONE BIT(31) #define RX_DMA_PLEN0(_x) (((_x) & 0x3fff) << 16) #define RX_DMA_GET_PLEN0(_x) (((_x) >> 16) & 0x3fff) +#define RX_DMA_VTAG BIT(15) /* QDMA descriptor rxd3 */ #define RX_DMA_VID(_x) ((_x) & 0xfff) -- 2.30.2