From mboxrd@z Thu Jan 1 00:00:00 1970 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 EB2C5C54E41 for ; Wed, 28 Feb 2024 08:23:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=w+zFgr+qCF1euIGh/7gu9DG2mUKzk5V0SCN0EKpQoy8=; b=iWcPzsXhleGQtI sVxjOuvqAXGdorvPnxdC2Szjm1f1hOwKgpdRLwarzQy0iH0mgM02mlyjMj7lRcuVcgU+HCrp6kE83 HIWdi/p/YtcRtVwHWqb7hr4a6/ofGr6ZQMQ+t6T3c+NqFvjx1u/Le7bw8h2zDCiTU6Hdn3di818VX AWNsj2I1xBwSVRBevCI6vXvZlrYIIj9Nmluy26/xrD4uowRbVjAly/gxm2bunwjF/RAzyiiOi/Q8y OAXZFYzAtSQLaoo/aAdZ7DxlGu6g34M6PkQ7O1ToMvZT1FNLSXVQcLy9VcenKdfQBarLeLeQ5O/bI C5UtSepizPerfRymwrBA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfFDd-00000008ST8-3Hqt; Wed, 28 Feb 2024 08:23:13 +0000 Received: from mail-lj1-x236.google.com ([2a00:1450:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rfFDa-00000008SSJ-3f89 for linux-arm-kernel@lists.infradead.org; Wed, 28 Feb 2024 08:23:12 +0000 Received: by mail-lj1-x236.google.com with SMTP id 38308e7fff4ca-2d228a132acso70682921fa.0 for ; Wed, 28 Feb 2024 00:23:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=resnulli-us.20230601.gappssmtp.com; s=20230601; t=1709108588; x=1709713388; darn=lists.infradead.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=cqgLOaVURL67ftXp6v7O92fn39oSUkQDPBYPEe3/YNQ=; b=fBCbDyx+XroomKxj9esniXQNfkwMgNFijZyadUbC0+/0ZGq24FY/AmH0YU8xDMBLEd 2Eu3r6lk3growfy/U0Ku1Kzm8pyna/K3deUj8cuGejTMiYGpODwMuynbzqYW8LQtjHDX hWQRnLeucRTlRrMaKXm1MZO777RKxpQwYFmasX+vEt5kVUmG8NGtJEpdFDOhswm/Iano 5gONUeFW9e/sXxdSJXAvICfhqNo2B8ivfZifWsT57qiBYNBEKaNnl9Ce/tCqkEG5taL4 7kUNkPDEeOLJjGxJQCe/HJjKPn5r+rG6VUaqCX8W2fcihgkY+CFnaYDXTH4I2AZ4rMGH MtkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709108588; x=1709713388; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=cqgLOaVURL67ftXp6v7O92fn39oSUkQDPBYPEe3/YNQ=; b=IzWltOlc5seaay875omWW19HLL0516DR9YWXC6/tGakWTP3frPaWU4LZCsBIgtfWcB B09JTQLMvNbfKpR3NbtvtlCS8wLftYEAg0tUipK8c5y893MBEYIQYWbjZNyyLx0iS7im 6se+smlbyvvH9W/eU0PiB82qUpLWnZtsl1kCvnLGWcdTU0C9SV9//2agYmvWYoqSKmdA rUAoKgyga5A7ZJEf5trmgzwjpJ4DJfDSgv6jTt3+xaLLgtZzgc0mSe/7Pg4OmjzM6UKb /evmATMTQ9TCq843sW4n3XGVHTDz+Cpz/FYTD1GuB/GmfzgCQqs/gm84aMloLlAItusK MRDg== X-Forwarded-Encrypted: i=1; AJvYcCURPONmOaegElNDqFpZ6IzBx6+HeCQzxgLFNTyLquiv8pra86hNw1nVgK66MucW/2nJh7tA/jBYsuJd8IMxDMC2JvKRseK1LNvAcXtR2M2pGx1s6IU= X-Gm-Message-State: AOJu0YyryJR6/l6BmRbweUmtl7BurzjQBHFR64bYOTj86FjBCgYMEpp1 kQs/SwqSEiIWh0aW5xnolSMX+cXYutgLCyQTYhwsBK2h6YSwFt+2F1QZJScC32o= X-Google-Smtp-Source: AGHT+IEdjlYQBynczVxYHirKmQjo0oLu2GibxkoDPhBH6ojuuWCevUu//kVmNR7RzwvBkiXfRmUZVg== X-Received: by 2002:ac2:5ed0:0:b0:512:dfa1:6a1c with SMTP id d16-20020ac25ed0000000b00512dfa16a1cmr7280828lfq.10.1709108588092; Wed, 28 Feb 2024 00:23:08 -0800 (PST) Received: from localhost ([193.47.165.251]) by smtp.gmail.com with ESMTPSA id c3-20020adfe703000000b0033d6fe3f6absm13734962wrm.62.2024.02.28.00.23.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Feb 2024 00:23:07 -0800 (PST) Date: Wed, 28 Feb 2024 09:23:04 +0100 From: Jiri Pirko To: Siddharth Vadapalli Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, rogerq@kernel.org, andrew@lunn.ch, vladimir.oltean@nxp.com, hkallweit1@gmail.com, dan.carpenter@linaro.org, horms@kernel.org, yuehaibing@huawei.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, srk@ti.com Subject: Re: [PATCH net-next] net: ethernet: ti: am65-cpsw: Add priv-flag for Switch VLAN Aware mode Message-ID: References: <20240227082815.2073826-1-s-vadapalli@ti.com> <7d1496da-100a-4336-b744-33e843eba930@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <7d1496da-100a-4336-b744-33e843eba930@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240228_002310_936768_949C5065 X-CRM114-Status: GOOD ( 23.96 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Wed, Feb 28, 2024 at 08:06:39AM CET, s-vadapalli@ti.com wrote: > > >On 27/02/24 18:09, Jiri Pirko wrote: >> Tue, Feb 27, 2024 at 09:28:15AM CET, s-vadapalli@ti.com wrote: >>> The CPSW Ethernet Switch on TI's K3 SoCs can be configured to operate in >>> VLAN Aware or VLAN Unaware modes of operation. This is different from >>> the ALE being VLAN Aware and Unaware. The Ethernet Switch being VLAN Aware >>> results in the addition/removal/replacement of VLAN tag of packets during >>> egress as described in section "12.2.1.4.6.4.1 Transmit VLAN Processing" of >>> the AM65x Technical Reference Manual available at: >>> https://www.ti.com/lit/ug/spruid7e/spruid7e.pdf >>> In VLAN Unaware mode, packets remain unmodified on egress. >>> >>> The driver currently configures the Ethernet Switch in VLAN Aware mode by >>> default and there is no support to toggle this capability of the Ethernet >>> Switch at runtime. Thus, add support to toggle the capability by exporting >>> it via the ethtool "priv-flags" interface. >> >> I don't follow. You have all the means to offload all bridge/vlan >> configurations properly and setup your hw according to that. See mlxsw >> for a reference. I don't see the need for any custom driver knobs. >> > >Thank you for reviewing the patch. Please note that the "VLAN Aware mode" being >referred to here is different from ALE being VLAN aware. The hw offload of >bridge/vlan configurations is already supported in the context of the ALE. The >Ethernet Switch being VLAN Aware is a layer on top of that, which enables >further processing on top of the untagged/VLAN packets. This patch aims to >provide a method to enable the following use-cases: >1. ALE VLAN Aware + CPSW VLAN Aware >2. ALE VLAN Aware + CPSW VLAN Unaware > >All hw offloads of bridge/vlan configurations are w.r.t. ALE VLAN Aware alone. >Currently, only use-case 1 is enabled by the driver by default and there is no >knob to toggle to use-case 2. > >I am quoting sections of the Technical Reference Manual mentioned in my commit >message, in order to clarify the CPSW VLAN Unaware and CPSW VLAN Aware terminology. > >CPSW VLAN Unaware: >Transmit packets are NOT modified during switch egress. > >CPSW VLAN Aware: >1. Untagged Packet Operations >Untagged packets are all packets that are not a VLAN packet or a priority tagged >packet. According to the CPWS0_FORCE_UNTAGGED_EGRESS_REG[1-0] MASK bit in the >packet header the packet may exit the switch with a VLAN tag inserted or the >packet may leave the switch unchanged.... >2. Priority Tagged Packet Operations (VLAN VID == 0 && EN_VID0_MODE ==0h) >Priority tagged packets are packets that contain a VLAN header with VID = 0. >According to the CPSW_ALE_FORCE_UNTAGGED_EGRESS_REG[1-0] MASK bit in the packet >header, priority tagged packets may exit the switch with their VLAN ID and >priority replaced or they may have their priority tag completely removed.... >3. VLAN Tagged Packet Operations (VLAN VID != 0 || (EN_VID0_MODE ==1h && VLAN >VID ==0)) >VLAN tagged packets are packets that contain a VLAN header specifying the VLAN >the packet belongs to >(VID), the packet priority (PRI), and the drop eligibility indicator (CFI). >According to the CPSW_ALE_FORCE_UNTAGGED_EGRESS_REG[1-0] MASK bit in the packet >header, VLAN tagged packets may exit the switch with their VLAN priority >replaced or they may have their VLAN header completely removed... > >I hope that this clarifies that CPSW VLAN Unaware/Aware is a layer on top of the >hw offload-able bridge/vlan configuration. Please let me know if there is >anything specific that could enable this without requiring the "priv-flag" based >implementation of this patch. I have no clue what "ALE" is. But in general. User provided configuration, using ip/bridge/etc tools/uapi. According to this configuration, kernel is bahaving. When you do offload, you should just make sure to mimic/mirror the kernel behaviour. With this in mind, why can't you do it without adding additional knob? And if you really need it because the know does some internal hw/fw tuning, priv flag of netdev is most probably not the correct place to put it. If it is, make sure you advocate for it properly in the patch description. pw-bot: cr > >-- >Regards, >Siddharth. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel