Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2383908rbb; Tue, 27 Feb 2024 23:07:28 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWwgdoYs9o0sW4woReqcXLydyYak5u8URxooHgk5xSd6P6kpe6Y3QPGlSZLQJABHNJiw/3f1acrAROLvbU8ucHHaN7LezxWEwhpTVTy0g== X-Google-Smtp-Source: AGHT+IEpqhEz3ttKoNyGpFjPIfPivwxpOFV1I+Z1Pzus/1yCo+cF6ij9HlVfCGKf4l6ik8GxpRNe X-Received: by 2002:aa7:c70f:0:b0:566:777:af4f with SMTP id i15-20020aa7c70f000000b005660777af4fmr5161023edq.1.1709104048702; Tue, 27 Feb 2024 23:07:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709104048; cv=pass; d=google.com; s=arc-20160816; b=p52YEzwzmd/sUZKg3apYUSSlEiSlutL4qSt92mBlTJfBf3YQAXtolP4s7hM0sm/Tlz DGJvjaQAJpIXeogRH7VFNt34WDGmy+x5iMhGPhdz4yn5esUf03ifcRlqSGkvOPSJzu8C pGG8UuEFYZvaAwKTHjmvPvXd6kjFvQdC5sjD3Uuf4q8974z7kCvioQpQnZmUmZblZiTZ 3EJFCyG1hXLWN9M+uDMArlQqDoUWgwGlNr6BQnHBkWkQ8JcT0yECxjpTGQpINkrEtSlu Bl1RV7CbDcfkMQLUnuAHqw8xPpA2GnCQ72TlE8HH6MS5GlP2GWJGcmMO+ErD8cDDlZxz 0I2Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:cc:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=bWnuJSOtHFTdxNvHrznUXkm+6A6rrZIwSqOFLyy0mkc=; fh=DFNZA3hNw7NY09pWqfFNGsKpEA3H7MV+5LihtwAveqY=; b=RzcP7eLagoAQHytVU7syem6u+fPKXb/QkUZlqErEIuS1Cw6qWuF8X1xs7Mcv1tKJGI ktM5x/1ffMkuxBygw+CMI1wzO40kSKRKyr4lfSeu75usHsVdZ7fNfMFXamMm/MUiP80o B5RKgHOcBn0gFwHAyJTKdszA7LjwBvk6ZDzU+FUcBY3EHVaa8I2VGD7wK/yFQU6prucF NHiXIrTfRVF9A1E8EIa1E6GVlDAqXW3MpAwB9sYeKwHGE7ZVhmDGZaU0FQpuT8BOiKZf +fleedeFBsUNQoeMyZs0pMHnGD8D/CtEkFYvcMutMcU1ynP/NQwn1O4l4hEj3gPv3Ee6 HLZg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DrlJyQ1H; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-84587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u14-20020a50950e000000b0056633eb152csi1468797eda.642.2024.02.27.23.07.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 23:07:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-84587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=DrlJyQ1H; arc=pass (i=1 spf=pass spfdomain=ti.com dkim=pass dkdomain=ti.com dmarc=pass fromdomain=ti.com); spf=pass (google.com: domain of linux-kernel+bounces-84587-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-84587-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 4C10D1F227E3 for ; Wed, 28 Feb 2024 07:07:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 889FB2375A; Wed, 28 Feb 2024 07:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="DrlJyQ1H" Received: from fllv0015.ext.ti.com (fllv0015.ext.ti.com [198.47.19.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBC051EEFC; Wed, 28 Feb 2024 07:07:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.141 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709104036; cv=none; b=pVatGwv+862gsE8AgeO+nm6Es26u7HTRe4+hCvofwxZKRm06HcpFQsuGZKOLlbvUgRZC6xdbIL67eJXrHIX5ZS+jsZu2VuJUBjU7h6RcdofXJdsSeDE2EAgeu1eVdTRW8Ay0oBsTLIi4b7QBS2/mmU3tMieJOnRpI51xHklJEak= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709104036; c=relaxed/simple; bh=rH8a1xlgSv8otqY3V1Ueh3S5uKql5Tp5aIc70RVoy20=; h=Message-ID:Date:MIME-Version:CC:Subject:To:References:From: In-Reply-To:Content-Type; b=G52MeyJwyCaZKrAhN0zENiEdjYj/ycKzpozFWKtH/2ze9u6S03yRJ0FQMJ3ot5dlFeCNYkNhNxTJRO7vcDfPDRnMo4MiLumQ0MZj+q3I+WgKJpVNTjXh3KYMCvnFGvFS+LXy9PxCsYG/qbhpUvTBLk+KwWtGYc7fPgm/W1IOOx8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=DrlJyQ1H; arc=none smtp.client-ip=198.47.19.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Received: from fllv0034.itg.ti.com ([10.64.40.246]) by fllv0015.ext.ti.com (8.15.2/8.15.2) with ESMTP id 41S76kAx006101; Wed, 28 Feb 2024 01:06:46 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1709104006; bh=bWnuJSOtHFTdxNvHrznUXkm+6A6rrZIwSqOFLyy0mkc=; h=Date:CC:Subject:To:References:From:In-Reply-To; b=DrlJyQ1HBXpuwXzCVufloMOj4zWmZAxB5kl2/wZSCqGRQAWWMchOBexH7FiJcVvfh G3tntlhbo+gR+L4SD5eWHktIOc2X3m/9HpAgjLXSVcMrxCgfVLsbcTSY9XYEx/abS8 8RoAKyhbVG6jtuw4kOfVkHu0xcChZ/tcDNXjhIfc= Received: from DFLE101.ent.ti.com (dfle101.ent.ti.com [10.64.6.22]) by fllv0034.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 41S76kR8106225 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 28 Feb 2024 01:06:46 -0600 Received: from DFLE114.ent.ti.com (10.64.6.35) by DFLE101.ent.ti.com (10.64.6.22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23; Wed, 28 Feb 2024 01:06:45 -0600 Received: from lelvsmtp5.itg.ti.com (10.180.75.250) by DFLE114.ent.ti.com (10.64.6.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.23 via Frontend Transport; Wed, 28 Feb 2024 01:06:45 -0600 Received: from [172.24.227.9] (uda0492258.dhcp.ti.com [172.24.227.9]) by lelvsmtp5.itg.ti.com (8.15.2/8.15.2) with ESMTP id 41S76eQ3016464; Wed, 28 Feb 2024 01:06:41 -0600 Message-ID: <7d1496da-100a-4336-b744-33e843eba930@ti.com> Date: Wed, 28 Feb 2024 12:36:39 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird CC: , , , , , , , , , , , , , , , Subject: Re: [PATCH net-next] net: ethernet: ti: am65-cpsw: Add priv-flag for Switch VLAN Aware mode To: Jiri Pirko References: <20240227082815.2073826-1-s-vadapalli@ti.com> Content-Language: en-US From: Siddharth Vadapalli In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 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. -- Regards, Siddharth.