Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp3011850pxj; Mon, 17 May 2021 15:32:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxex84Z9coqPIHsE7Rod9u3d+nGbfK12EaD5NDo/LKQl7BErF5yNwPwL6CDTCA4T451wA9t X-Received: by 2002:a05:6402:20f:: with SMTP id t15mr2811035edv.370.1621290735536; Mon, 17 May 2021 15:32:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621290735; cv=none; d=google.com; s=arc-20160816; b=s53AaUntyd7YTRYsNjy/g3k9urmrbcEaNqJZihucmilvE8Bh67bSYL5YkyIBrF9ESy 1B9REN7rJQi0hQusBWx9OL2+22Rlbmsz0oCVvPYxe96Uo3W8K/cuIXPogLY3Rl2g2MqQ d5gU5tzdDppvOimK83ztMgMNvxr/yyc55olb7leKJbRBB3eUPDmiRGo9ZXAlkZtFwaPu fe/yy4ek1WyCVrU0L0CfMEIHZZH/mP7AAzuU6jdHFix5EPwW/EGP5U6EOUjFsflTkjWY q+yBV/8/HVImURFBU9zyk7J6dSWCwWGOpfMv4i+VcJb3RZOBbIvUY1hP8Au1F4UlRN9w kqEQ== 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=xm2GyZFKrxHwl6FwCjY+xF/yrZPyl5dLvVaWurE7i+o=; b=s1UOSXfatAWzEP7+23Oi02BElkoFFACAqMX0UIM6NbU8RVxzwFk3BAPab5vY93HXIp qesQArn2ip1/3Lc/yh3pTFdpUr2fTBV6SNKhwW/42gxW/Ggx+nTWh28h6qtbbh/CUGNn jRutPj9tKLYixAObJHb35cjfn5GPK1docYu8Q4QzRwD7bCX/NvZKvU+HropkcmWka2Ez gs58BmHSP0v+JgQeYQJB8sv9fBtMlRxrkazcY/BCWY4ppCR1TQiIadT+vpP/H2cns7ZV FXWn+rpqWSF2p5JIhpWfRcr/Bk9CIyXclILUKJd66XnhDvYeIXBSBa5VOGGcLBjNxEFv UOFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=yUyasCgW; 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 la26si4514093ejb.524.2021.05.17.15.31.52; Mon, 17 May 2021 15:32:15 -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=yUyasCgW; 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 S237064AbhEQOPr (ORCPT + 99 others); Mon, 17 May 2021 10:15:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:46666 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236836AbhEQONA (ORCPT ); Mon, 17 May 2021 10:13:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 31E0C61364; Mon, 17 May 2021 14:08:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621260505; bh=UimeJS6hq2lUy+unWCGlr0f/LHC0pS+MIX4eyMbSJdc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yUyasCgWN7ySQmgN+ayV/H0mKKCBbWjyounxnjNlOwxru+g6mx4qhBj66jFYlGPho cT+mOTPhQRNN60Z215CgtJF9lG53L4R3XsLXUvk5jISul+PASGhcompNpJdsPYbBw5 NobkI0lJcdAkNrtjkeaAmaJNjyhnUED+GP2KcFYM= 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 5.12 112/363] net: ethernet: mtk_eth_soc: fix RX VLAN offload Date: Mon, 17 May 2021 15:59:38 +0200 Message-Id: <20210517140306.406951178@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140302.508966430@linuxfoundation.org> References: <20210517140302.508966430@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 01d3ee4b5829..bcd5e7ae8482 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -1319,7 +1319,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 fd3cec8f06ba..c47272100615 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -296,6 +296,7 @@ #define RX_DMA_LSO BIT(30) #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