From patchwork Mon Jul 1 08:19:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Furong Xu <0x1207@gmail.com> X-Patchwork-Id: 13717652 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C919EC2BD09 for ; Mon, 1 Jul 2024 08:20:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=MC5/1uIy6r+d6wkfwo0SgQbace/5QXNKCEPCP25Y26U=; b=aXbDe30dNXF3RKPeGMWYlrPr2Y bVMCEMxWNqZjoObupZaLMy4AmHDYlUUVfM2wTLNhQ1sXSAUsGwh5HAmVRA7vzG2dLb4c2LXcB+ExP pX0WB1inKjxr7zxjUU8QCSg12nMRyGq5EPzE/NqKlTOZGwk0P/rKmMTQtR3fqXO7TmmLihwAwFRIB 0/yMs+ggvyIUETFtsQ3bq5OHjgSfhY2omFfOZp8Yn+a9UWIkjP0altQN9sTRenplkF0Xvt/CZ5NLr 94DqquGalhKW5UZxW+MxCSao3a/uIlJ+nsk3HNDbIaxuInluyTvCEQdvDzW/CYL52QNaHdpIahOOa zHDTZifw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOCHD-00000002Cqr-3TGH; Mon, 01 Jul 2024 08:20:43 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sOCH4-00000002Col-1qfA for linux-arm-kernel@lists.infradead.org; Mon, 01 Jul 2024 08:20:35 +0000 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-70a078edb8aso1206190b3a.1 for ; Mon, 01 Jul 2024 01:20:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1719822033; x=1720426833; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MC5/1uIy6r+d6wkfwo0SgQbace/5QXNKCEPCP25Y26U=; b=ep/oXO1z4H+0dEpt7dTURuTE4Vs9b1biTbffhPzeXi/PDHUMQEPQsHzZoBmmI19RzB 8OrP39r/lZdTvy/5xlWZLCv9LM5+6siYX4gGdW+BqpxzijR5TGXxkzrEXkX9ibzB3PZ2 +Ja/mo9jmbmIRPiWedud8G3fpdUKN4oINVEHWb8mTKnfGqiaYg0+g2RMnC5wJIcYx2bh QoCmS6qv0cQ84xXg3cG65q1Rv/LB9VS8zE4Uwtmido57cDenNyLiJV99ASGqOrWtTsat JNpUst+dm+xHMbR345/K1PFyANahG1wAkGIfGTHoA+k6JCLbQHEDVVC737G/b4KlMLY6 cfqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719822033; x=1720426833; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MC5/1uIy6r+d6wkfwo0SgQbace/5QXNKCEPCP25Y26U=; b=IxpQ41BideyG11dxcySCGjt5sMubYERug0NM0q+fnKVG2hSw4jHfw9W2YBh6BS32yZ eJ4/CWUQLmRpoF8pmxP6pX8kqNgVBUrp7Mh9hqHekWrkY2uphL+holpO363bSUIyvMFv a21Xhd7O1JQXt0HGh0/U0R67sGVcPZdjZeIdspsS96rT/tQZ0tk4P+1yiacnSFhxiPlc 37n8Jx+UVRO7BnF01asMmKviK2Af4ip/MWMBXtpoIPnwjiTz4Q6Vz1Qk3bnH+50qCU5B k9phwYnRdeucR88Jj4TY3xIweMGiPwaoGil3H4hthVhmxMN2zjxvyp+J7HTjMZeOG25e /tJg== X-Forwarded-Encrypted: i=1; AJvYcCVjH1ss//YCg/3okBhOzacpL7UzOcmvRPnEUq5JV6NGOykUWgu4jtlVY9MqgmFfJBDwt/Hx1Wx5UDX8PSeBFtHyJ/a0Rqg5nlaAG0IOEVNSjpWuGe0= X-Gm-Message-State: AOJu0YxY9xgwlgnXeWp3HNDE3FvTg/NC7GWBJdQW25qyEu8i88twzzfs MWHnwHrKjDL+2v6yHKSp9BBs3EVX9qUeG9w7FKT01wM5PEnB1lDDsTGwkw== X-Google-Smtp-Source: AGHT+IHwmPMU7oYRhiuqelGxgEX+rgaw/YH4bqX/NunRhcIN6nUMudhE6o8PIx3RNMLJoj1enQ/H9g== X-Received: by 2002:a05:6a00:4b13:b0:705:cc7d:ab7d with SMTP id d2e1a72fcca58-70851875908mr16008127b3a.5.1719822033063; Mon, 01 Jul 2024 01:20:33 -0700 (PDT) Received: from localhost.localdomain ([129.146.253.192]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-708044ac424sm5864836b3a.161.2024.07.01.01.20.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Jul 2024 01:20:32 -0700 (PDT) From: Furong Xu <0x1207@gmail.com> To: "David S. Miller" , Alexandre Torgue , Jose Abreu , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , Joao Pinto , Lai Peter Jun Ann Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, xfr@outlook.com, rock.xu@nio.com, Furong Xu <0x1207@gmail.com> Subject: [PATCH net v1] net: stmmac: enable HW-accelerated VLAN stripping for gmac4 only Date: Mon, 1 Jul 2024 16:19:36 +0800 Message-Id: <20240701081936.752285-1-0x1207@gmail.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240701_012034_501668_B344A01D X-CRM114-Status: GOOD ( 11.67 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Commit 750011e239a5 ("net: stmmac: Add support for HW-accelerated VLAN stripping") enables MAC level VLAN tag stripping for all MAC cores, but leaves set_hw_vlan_mode() and rx_hw_vlan() un-implemented for both gmac and xgmac. On gmac and xgmac, ethtool reports rx-vlan-offload is on, both MAC and driver do nothing about VLAN packets actually, although VLAN works well. Driver level stripping should be used on gmac and xgmac for now. Fixes: 750011e239a5 ("net: stmmac: Add support for HW-accelerated VLAN stripping") Signed-off-by: Furong Xu <0x1207@gmail.com> --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c index b3afc7cb7d72..c58782c41417 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -7662,9 +7662,10 @@ int stmmac_dvr_probe(struct device *device, #ifdef STMMAC_VLAN_TAG_USED /* Both mac100 and gmac support receive VLAN tag detection */ ndev->features |= NETIF_F_HW_VLAN_CTAG_RX | NETIF_F_HW_VLAN_STAG_RX; - ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX; - priv->hw->hw_vlan_en = true; - + if (priv->plat->has_gmac4) { + ndev->hw_features |= NETIF_F_HW_VLAN_CTAG_RX; + priv->hw->hw_vlan_en = true; + } if (priv->dma_cap.vlhash) { ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER;