Received: by 2002:a05:6358:701b:b0:131:369:b2a3 with SMTP id 27csp202645rwo; Fri, 21 Jul 2023 10:29:40 -0700 (PDT) X-Google-Smtp-Source: APBJJlHalZN0jn5MCBreldO0qEw8XDPRB8NTsyynHLhznc7L5UE+COkBYfjlUMvX2/OkZmbaDiFR X-Received: by 2002:a05:6402:510f:b0:51e:538c:1e19 with SMTP id m15-20020a056402510f00b0051e538c1e19mr9596860edd.15.1689960579948; Fri, 21 Jul 2023 10:29:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689960579; cv=none; d=google.com; s=arc-20160816; b=BhtYOm90l5mQhR82F+ug21L/qYG7PfK/4aN6oMZ5Ksy42iXKfPUjE6gVpgTG2WzaEg eC16zY7DLXMhYyrBop9FrHx7tvvPCVhD+xRA8kt1+tk4YJwsH7qKPMbsAM0xuAFM+cpm /HgYcFAnJMBUdzWOP7bwg6q3Rc97zXiZbMltjA4YHAqsW5reNVKJ9TTb/JCSOMV67jvI ebamCXgoLUhG56Mi6GWqbZWD4IU6z0Wm6qc4tgeeSegtkvwjchxTpME3yl7hQVQZcG+5 MMpVM1aAqdorMPSoJMQW6I4nBppwhXAeUoSBCRZbaDMqNpHUgHgoBHorVUUlBaSp2I+8 T1+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=ouosyBPb4dn4HHlTnUJ4FSBNaoZUMLrSaPdnIDz9wuw=; fh=bz2CBdzDFjQImTkS504fNwvEuGuMfGPbB8IgiElJ//E=; b=rDVtHR/iaGKpIDBUM5dnLHfClBQ250W2Hu/Il4bTfdeglOIAWodycxsTYl71R8Gqrr hSIY1NzoevYrYuH1MsxkklgJ+12F5vNZjD+0lrlb72vpZyAjSn/P30bRZDuB+rqG+Hhc mGQhvF4Lk9lEuPiRFg1I69bNB2dANtR1E5HA7TZTiyUfs28Y/oi+rtPEV23XFEJdCCWX J819E3QJPR5L47Etz7oJCKEUgkD8V+YpN3sFafqq0NnMqidQ7NzRb7n3gKfmYXnmu4+1 gAhWXu1ErkDK6Httt60Ymcdazl+hx0MLawOJTgRkXfdJwJqUTy61a4hWQaT4KimIh9x7 fG8A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Vk2fCFGE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c10-20020aa7c98a000000b0051e24097920si2809861edt.559.2023.07.21.10.29.15; Fri, 21 Jul 2023 10:29:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=Vk2fCFGE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230054AbjGUP7N (ORCPT + 99 others); Fri, 21 Jul 2023 11:59:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59138 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229746AbjGUP7L (ORCPT ); Fri, 21 Jul 2023 11:59:11 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 374EB2D47; Fri, 21 Jul 2023 08:59:10 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1b8ad9eede0so15758165ad.1; Fri, 21 Jul 2023 08:59:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1689955149; x=1690559949; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=ouosyBPb4dn4HHlTnUJ4FSBNaoZUMLrSaPdnIDz9wuw=; b=Vk2fCFGEwoEdn2x2gzgjtS58Pwt9U01pViJ4ZQYCxi/eRmX4AkBspvWDAHWVmDk7xN n+2D8vXy2mZxQGdXrDv2lS+MrjZFIQcofY7Pwjw53TNZieLT5lObBGn5XVSRAVUv0ZTt Q7xAz/7IeqOMHlruhDE/8h2+agVavciZ9JWsBxClyOMn9k/1eQP+XGEXs+ux+ch4eZdL uubRSfULij8HcYuxURTHh3pZ5mjfXK6wVcDpXraubFagQEBcIulvXvb1ziBCjIJ60/4a gDW7X02wmc08mJbmEFpiGPGUqpBD0w+sUK6REF8VIs6Rq7y8Xi8guYUAK4Dg24xTGZ9X U2EQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689955149; x=1690559949; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ouosyBPb4dn4HHlTnUJ4FSBNaoZUMLrSaPdnIDz9wuw=; b=SaS8gCgfCM9AXyw/C5swX3zIfMiN1zDTlQ3B0D2GpE/JagxXbkUnaQEU7JDZSUkhwT kpLZqmFW4Vxh4J93vEUDibe9zmLVhBKi7K5+9W0d2bO6E6SulxDm75rViD7w4CUhyJka mhxKX4X++h+HeDcTZzWZGX/Srd3jegJsJFOo8lFXFvYljfOxUUn9hDGjxgpJKwg4CTZX cIyz4VbZOcCVZlgrxI5DB/7RlO7f8nskdqeM6nvD4U0rb8VRdG8RuOoA8t69frjMf21t ar6tB7ZnPlmpE9kHAYpQU+ec7b5bf4OaIQyPez0PC3TUNzMntyvQtB8puuCQkCTdQ9Py Czmw== X-Gm-Message-State: ABy/qLY/6lLgqn8tyEJ/ncYm2SxtKF3W8j0eeH6OXSuKgcsxuRPjZTIH jjrEjXPMR9mPLhCQoOEx4Rc= X-Received: by 2002:a17:903:181:b0:1b8:6cae:3570 with SMTP id z1-20020a170903018100b001b86cae3570mr2580302plg.11.1689955149561; Fri, 21 Jul 2023 08:59:09 -0700 (PDT) Received: from [192.168.1.3] (ip72-194-116-95.oc.oc.cox.net. [72.194.116.95]) by smtp.gmail.com with ESMTPSA id n13-20020a170902e54d00b001b9be3b94d3sm3670309plf.140.2023.07.21.08.59.07 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 21 Jul 2023 08:59:08 -0700 (PDT) Message-ID: <7549a014-4f5e-cf87-f07d-c4980ab44dc1@gmail.com> Date: Fri, 21 Jul 2023 08:59:06 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping Content-Language: en-US To: "Ng, Boon Khai" , Krzysztof Kozlowski , "Boon@ecsmtp.png.intel.com" , "Khai@ecsmtp.png.intel.com" , boon.khai.ng@intel.com, Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S . Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maxime Coquelin , "netdev@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Cc: "Shevchenko, Andriy" , "Tham, Mun Yew" , "Swee, Leong Ching" , "G Thomas, Rohan" , Shevchenko Andriy References: <20230721062617.9810-1-boon.khai.ng@intel.com> <20230721062617.9810-3-boon.khai.ng@intel.com> From: Florian Fainelli In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/21/2023 8:30 AM, Ng, Boon Khai wrote: >> -----Original Message----- >> From: Krzysztof Kozlowski >> Sent: Friday, July 21, 2023 6:11 PM >> To: Boon@ecsmtp.png.intel.com; Khai@ecsmtp.png.intel.com; "Ng >> ; >> Alexandre Torgue ; Jose Abreu >> ; David S . Miller ; Eric >> Dumazet ; Jakub Kicinski ; >> Paolo Abeni ; Maxime Coquelin >> ; netdev@vger.kernel.org; linux-stm32@st- >> md-mailman.stormreply.com; linux-arm-kernel@lists.infradead.org; linux- >> kernel@vger.kernel.org >> Cc: Ng, Boon Khai ; Shevchenko, Andriy >> ; Tham, Mun Yew >> ; Swee, Leong Ching >> ; G Thomas, Rohan >> ; Shevchenko Andriy >> >> Subject: Re: [Enable Designware XGMAC VLAN Stripping Feature 2/2] net: >> stmmac: dwxgmac2: Add support for HW-accelerated VLAN Stripping >> >> On 21/07/2023 08:26, Boon@ecsmtp.png.intel.com wrote: >>> From: Boon Khai Ng >>> >>> Currently, VLAN tag stripping is done by software driver in >>> stmmac_rx_vlan(). This patch is to Add support for VLAN tag stripping >>> by the MAC hardware and MAC drivers to support it. >>> This is done by adding rx_hw_vlan() and set_hw_vlan_mode() callbacks >>> at stmmac_ops struct which are called from upper software layer. >> ... >> >>> if (priv->dma_cap.vlhash) { >>> ndev->features |= NETIF_F_HW_VLAN_CTAG_FILTER; >>> ndev->features |= NETIF_F_HW_VLAN_STAG_FILTER; diff -- >> git >>> a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c >>> b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c >>> index 23d53ea04b24..bd7f3326a44c 100644 >>> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c >>> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c >>> @@ -543,6 +543,12 @@ stmmac_probe_config_dt(struct platform_device >> *pdev, u8 *mac) >>> plat->flags |= STMMAC_FLAG_TSO_EN; >>> } >>> >>> + /* Rx VLAN HW Stripping */ >>> + if (of_property_read_bool(np, "snps,rx-vlan-offload")) { >>> + dev_info(&pdev->dev, "RX VLAN HW Stripping\n"); >> >> Why? Drop. >> > > This is an dts option export to dts for user to choose whether or not they > Want a Hardware stripping or a software stripping. > > May I know what is the reason to drop this? Because the networking stack already exposes knobs for drivers to advertise and control VLAN stripping/insertion on RX/TX using ethtool and feature bits (NETIF_F_HW_VLAN_CTAG_RX, NETIF_F_HW_VLAN_CTAG_TX). What you are doing here is encode a policy as a Device Tree property rather than describe whether the hardware supports a given feature and this is frowned upon. -- Florian