Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp373805pxj; Tue, 18 May 2021 05:29:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw7g3UKUL9cfhQxlOLaVfS/rc8URfDWn+XIzLlpfxpd1o0ZYf9m2ymE7qcDWRTgmGD+ysi6 X-Received: by 2002:a05:6402:2548:: with SMTP id l8mr6882067edb.208.1621340944185; Tue, 18 May 2021 05:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621340944; cv=none; d=google.com; s=arc-20160816; b=mCMS1NahiZHwcEwPzrUKNlXo6wxcGwzXSr9zMgboCh4liB2DYjb/nBrcKCzBbCWUiU D0KnYx7Zid+L1bUGj54tbJq545mQXl1rtSEPuQ0dSLZwOFQu9sXeVRyCQhR2kBNJOJJa y01+oz2tFVszvx1sHWBHYYOIMD/cITgJbUqHaqm/J+MiJe819x+8Pg89xHs51cumkl7S v3U5pASgYKQVhvrYp4CnHMfUghQOCRIC9iBDbB9MklBctp8aFNd0J8eAe9bjmreuZBSB mXD+qgw3FbSUqDeq326/8y98xGOg66h2LqTuUaaYmoFmH6LlobO4/D12poRmOEmaW+Bx UdVw== 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=6e+dK4ivWlUVjEbdFS0cvkGnXyp00JBbfmxhTYH+Ewc=; b=Ec566fB4NseWHkO6Dx7YEHYDwz2v8ZBpp9R+Bq5W77yIVCpoeqM3TyQlCO0ap9egKi JBK13BcmJaOhPZZIANSLbh8cfP+HC2F45L4IElthjo0VSC4S/3N/ZcQ3y5tOgPTTk2ty xAvCFv9MAmOVjXYpQSUOeCjVfbcdapkEXSQO56YIIOE9ebUzNC/1ssPndrfEntGKjq0G 22qfc5WQEBbtHuLVqgSSqw6+dUYynmp42KX14CrEm4L+Oz0JjyzgJ/ii9ILWYPCm23p+ 8QtNZD0rKtqeWk1+EI/NPvDqJYyXwu4WIw83AA4oigfQUNRG6EwL/m510W0W6Gjq3YRM CBEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="S1ztyF/i"; 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 t16si21195253edi.299.2021.05.18.05.28.40; Tue, 18 May 2021 05:29:04 -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="S1ztyF/i"; 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 S244544AbhEQP2E (ORCPT + 99 others); Mon, 17 May 2021 11:28:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:34366 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243336AbhEQPNg (ORCPT ); Mon, 17 May 2021 11:13:36 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 31C716143B; Mon, 17 May 2021 14:31:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621261903; bh=zIWO+613aa93ZZ/vIAzAca28AJUUZ1Qux+x+xGm+ZvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S1ztyF/i5sCc37hTiiwBFVMNzybWQj92hRhLdzR3BUPAuf/3D00Z4jR31gfwtAXWY aGB1wVRP7mU6PyVdCV/xsJOV4GHLCqyqUvoSBn6zh1V5D81UShqYJlz/OBQIO/r1c9 Pl2XX8/lUQdAtU30wJbXXGijbQqczo7qNjc80SMo= 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.10 083/289] net: ethernet: mtk_eth_soc: fix RX VLAN offload Date: Mon, 17 May 2021 16:00:08 +0200 Message-Id: <20210517140307.980372445@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517140305.140529752@linuxfoundation.org> References: <20210517140305.140529752@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 6d2d60675ffd..d930fcda9c3b 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 454cfcd465fd..73ce1f0f307a 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -295,6 +295,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