Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp374655pxj; Thu, 20 May 2021 11:19:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2mqEzcAEH1+cmhcWj1XUDg67vDUryYYWrYud5oPHQDHM4tc3XbsIN3xNuqctwZVzVj/ty X-Received: by 2002:a6b:b4d8:: with SMTP id d207mr1132222iof.152.1621534751271; Thu, 20 May 2021 11:19:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621534751; cv=none; d=google.com; s=arc-20160816; b=nTfpAy45UkXNI3DNlh9Oo+Z0jm3j6/R2u6UsA0IAjCTztuyIQRbpaocZLe1gV55/ON 3Z5FphUKZcxDO1EgPAgK9MKoPVeL0z+DlPkAz95jJDO+xoIpYLc4Ckn+1FAd3huD6Sqo No/ogD8ZeVBBDyeZNac8bs1NDdpaCIALudGTh5uJlFfd0tRb0hScupvhF2lG3lhPIVE3 9SJ1ZpCwdYwQZOp8h576QQfvBBlEekoeaMwSGSHxMwsMXObGgV2wN8Xtzbtin1XeoIx/ zlujrBEvbhrsgvgeypfKrW4PczN238b5c05yn63n6iT7IZ/6hEKDqP4POj9cpRG7KL/o Hu/w== 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=3CW2I9LHO5IWX6PRlSN8thzxNdzFbKUAtq160vECOCI=; b=DBHT8t53xFB6prbagkP6zXKtMvZrsiNlQ/aOJKim4fZKSOUtBz5bkvSpH+nhKfIUlY EOKPdKos0H4va7hC7cAqsO3TzzOa/NLv1eWiKSxO0x+IFo0t3nkbAhHX/v8CdikZTGz2 7boNqEj5MkL6vludTalCoFpJIVkHgIUBdDDm7UNF0/XzsmC9OcJ5puk5F7vQyTR1JDXQ C06Tywa6+Ye5a6XB3mGbI6dVUqWwU2Bln8P8hF2DU/S3UD66YjNhuQSXHeNVZ4wAy0i6 /LIjZSEaqPpQnwKZfJjesJg2hRUyTeCZsUvPfi/nJ/tPze5JpGXY1vGBBezGEXVXuwht BTLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=1rGqbrAa; 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 x11si2816148iov.17.2021.05.20.11.18.57; Thu, 20 May 2021 11:19:11 -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=1rGqbrAa; 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 S236225AbhETKSO (ORCPT + 99 others); Thu, 20 May 2021 06:18:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:42308 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235822AbhETKJ1 (ORCPT ); Thu, 20 May 2021 06:09:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 87BD861444; Thu, 20 May 2021 09:42:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621503756; bh=2OMhfOSE2hc5YlXeGMX+M4+Zqe3M8J8R/W0DHF6u5ok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1rGqbrAa0QwFFZ6Vu3S1ZS/sIclBhdTXtyNxEqH1fQlbIUztJNFHNhZveevzHJauJ cxLL5EPs570kETnoDGX/3C0P4MMDin8WbOgFKB4U9kYIL0wuB1zOpYynUTPmCfEjeP QY2hLcQxMX3mCIYMKNOYkgpAiYgcJvjKOuoJ4rac= 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.19 331/425] net: ethernet: mtk_eth_soc: fix RX VLAN offload Date: Thu, 20 May 2021 11:21:40 +0200 Message-Id: <20210520092142.293033841@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092131.308959589@linuxfoundation.org> References: <20210520092131.308959589@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 b72a4fad7bc8..59f3dce3ab1d 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 46819297fc3e..cb6b27861afa 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -285,6 +285,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