Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp588423pxj; Thu, 20 May 2021 17:07:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz7fv+LvM3z1R+Y+meCCmgE7Ct89wcBdyel+12aUx56qvbbLyimadYHNpC294Z1lCioxPrf X-Received: by 2002:a05:6638:3013:: with SMTP id r19mr169935jak.36.1621555662277; Thu, 20 May 2021 17:07:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621555662; cv=none; d=google.com; s=arc-20160816; b=zm7SJSn1SPsC1cecnUJNAzcU2IH1kXEl//N7ae9puObPam0ODID3+km5m0WAirmyE2 A9Xh3zsetJEjjI4irEt2rG+AIDe0kcgFfuYszGrCHvH7s0pFMTI/zvuzRvY19SNiYDro xuLYReqH3HyorOKoykPKuZW/F8RYAnTU3nEve4wNer31CXaVbIrEtsFWhbD7ShjegdU5 na/AfK8F9Hs2e2uPoF2r5cQRZBieGTsown26vajZU9S7hZl2X3VltdtguFNK2P1Xb0lz 7YQkL5xmuNkbicFnDZEGOdvYNF0+4XGJ6XiX20ERcepSS6j8cXQdTObZ7u43mPadVatC deEA== 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=vJEfoM93HqjkiB3a65ovI7z4CRnI4Ajp5+aqAYds+FE=; b=NJwiUZbSw6fNou4X8eRL1JWJm9enMoAhJDiirvqkZu3yRcnGRuTHOsjf+3yg4MUg+V tu16OjsgTDYjps4oUm+J22lMWHJV7mCpG9x+3G9kyZAoZHf4ZTS+rEoGFLZ56IrA6oZc YsA2GA6tvGirZXjmygqrx4Ear8GnE43h/dAwTWe8ii/5s6YQMlClfmbBIfaFDhwv3DW2 RjeBgPvcHEK56AFFYwwkcgDAV/7vPz9AcpMgWoIzehkSvaWl5wa04WACNF3PKiK/XNTf l7WD4BX1A6OWdATYCrAjYZ7Cs0Uor7snjD2u4/ZIZUd2aTUzXYyUW+XhE9KHCs78hsoe WGPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=TTbDlV1A; 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 t19si3426782iog.66.2021.05.20.17.07.29; Thu, 20 May 2021 17:07:42 -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=TTbDlV1A; 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 S241108AbhETLVm (ORCPT + 99 others); Thu, 20 May 2021 07:21:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:56974 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239151AbhETLBj (ORCPT ); Thu, 20 May 2021 07:01:39 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CE1B16142C; Thu, 20 May 2021 10:03:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621505027; bh=sfDLtjKtJDIrtdiiba2YhMmGFCjvSbLT2V1gqLl01Yc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TTbDlV1AqCFcv2i/7nWH/neO/j+kUgTj9IaTAPtPd6ib0MwniRia+r6WmEyV7LTk1 Efr0KhkvqyAZTGy4w0Yl7s0lJJn2omv0vU93ayIkBDGI3Vvzkmc8GJ79GjuB+7Q4gL hX7PDlIgmSUgHhoNonGVnSNoiUyKfIdpbbdpww9c= 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.9 190/240] net: ethernet: mtk_eth_soc: fix RX VLAN offload Date: Thu, 20 May 2021 11:23:02 +0200 Message-Id: <20210520092115.045090591@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210520092108.587553970@linuxfoundation.org> References: <20210520092108.587553970@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 d10c8a8156bc..5b072bf80783 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c @@ -964,7 +964,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)); napi_gro_receive(napi, skb); diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h index 99b1c8e9f16f..2e7ccd8261c3 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -272,6 +272,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