Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2907775rwb; Fri, 9 Dec 2022 07:43:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf65Tgnh7LCU1z2ZErdjzI/elyQYbhNIvTg20NlXiLmCwKkb7j/tjI6J9FxHvThi2X/C3sfI X-Received: by 2002:a17:906:8290:b0:7c0:e6d7:f8b8 with SMTP id h16-20020a170906829000b007c0e6d7f8b8mr7782593ejx.39.1670600605615; Fri, 09 Dec 2022 07:43:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670600605; cv=none; d=google.com; s=arc-20160816; b=zL2HE6Ye7rauPL3o28w+dEcnnAmyGYIGHHBUIAzXsMGlxb/IiwDHKxlZ6/ktXg8KcC EKssbhjedeS6AC1liJo+7L1CFUmCkpXDccKI7vkltXMAbUgLzxK3QYYU1xofD8LF0wEO 4QcuF9wXz8ZQsLwZGjvnZ7HlYMB44y2UKXP0A2dhusBjwGsIPMFcRk2YdbnBtmh40Qhy PrSGjIAo7sBG4uIv9ieDUO7ycLRAaDv1XcdiBopO0w6q2rxzkpRee657WDLTJV5GnZNA fPQ5GhwlBqobwPKIzyB/X37hVWIXxwBjuPiFpp7T2UsE9qNIPKE2VXwiapmwUXaBValN DtRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=eKpyCB76qexLED/c9aS/zEroMT3dFHRzgtKDLWlby7I=; b=dMjUWF8FZd8UFmXRoV/hATFJPV6n1rt5mGsHdYwP/bg5cPZpeNRlxzod7owrL+aIYD CTSJEcwLRMk1GVkuUC4TftGTqtOXD89/khmwB2j+LMKA9wvLGZpZhmTF8MIIE88DQSf0 U9ftI9+eX9s83pAJj2gr0RMw5O01FwnyPFcXX818GjUB8qJf2JudeT7dYxs18OGYxkWj tS12nMnjmy5B+wodlMTLiksHutCyRl1S8cAFBLRtMOBf73tg1xp87lPta90ZDDPuHv/C f3W+gyppzps7QKgHEzSYcSJyI7MeBRFyLdlKURMpSSvBhO/dfCA+c4vnPw5U1GuO1grI Y9MQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=FHKGNhcF; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs7-20020a1709072d0700b007c10534516csi79492ejc.554.2022.12.09.07.43.06; Fri, 09 Dec 2022 07:43:25 -0800 (PST) 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=@microchip.com header.s=mchp header.b=FHKGNhcF; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230378AbiLIPZL (ORCPT + 76 others); Fri, 9 Dec 2022 10:25:11 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45994 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229696AbiLIPZI (ORCPT ); Fri, 9 Dec 2022 10:25:08 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 37B188B1A6; Fri, 9 Dec 2022 07:25:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1670599504; x=1702135504; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=WmwpTYyxcVQtiW1tL9fJMr4BDXHV7YEW8emRKA6pCLM=; b=FHKGNhcF5a/VoIsDn+xf7QSag4dlUuYqcc9B7X8JHvKzBa+4FQRqWd2D ZPQJluuiEAJc2e5HOwuqIp1N6giVYbSTxv+TWQDknKimEXPf92piFEAck 5zVUUC4U8zPyJ/lp2Y5ZbFgjg6U2/qtVRXdzOZc+gs06kqvxtIdLk6jnU vJSaLF7GPQr/TYxvpCuc3oe5Ug0KVhVK2N+766+zz7HFLhoqu/Ei9OqtM tnpn6Fq6I3tiOHmEbnZjvO3YycLEF9nj9PCP4AFObm6d4M6LUYG60A+Y/ cpb13kEvfWeHtK6fGKBwMy/uX4Tb8SptGTW4BmMMpe+jb56fn3msW+C/z Q==; X-IronPort-AV: E=Sophos;i="5.96,230,1665471600"; d="scan'208";a="190905714" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Dec 2022 08:25:03 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 9 Dec 2022 08:25:02 -0700 Received: from localhost (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 9 Dec 2022 08:25:02 -0700 Date: Fri, 9 Dec 2022 16:30:10 +0100 From: Horatiu Vultur To: Vladimir Oltean CC: Michael Walle , , , , , , , , , , , , Subject: Re: [PATCH net-next v3 4/4] net: lan966x: Add ptp trap rules Message-ID: <20221209153010.f4r577ilnlein77e@soft-dev3-1> References: <20221209092904.asgka7zttvdtijub@soft-dev3-1> <20221209125857.yhsqt4nj5kmavhmc@soft-dev3-1> <20221209125611.m5cp3depjigs7452@skbuf> <20221209142058.ww7aijhsr76y3h2t@soft-dev3-1> <20221209144328.m54ksmoeitmcjo5f@skbuf> <20221209145720.ahjmercylzqo5tla@soft-dev3-1> <20221209145637.nr6favnsofmwo45s@skbuf> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline In-Reply-To: <20221209145637.nr6favnsofmwo45s@skbuf> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS 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 The 12/09/2022 16:56, Vladimir Oltean wrote: > > On Fri, Dec 09, 2022 at 03:57:20PM +0100, Horatiu Vultur wrote: > > The 12/09/2022 16:43, Vladimir Oltean wrote: > > > > > > On Fri, Dec 09, 2022 at 03:20:58PM +0100, Horatiu Vultur wrote: > > > > On ocelot, the vcap is enabled at port initialization, while on other > > > > platforms(lan966x and sparx5) you have the option to enable or disable. > > > > > > Even if that wasn't the case, I'd still consider enabling/disabling VCAP > > > lookups privately in the ocelot driver when there are non-tc users of > > > traps, instead of requiring users to do anything with tc. > > > > I was thinking also about this, such the ptp to enable the VCAP > > privately. But then the issue would be if a user adds entries using tc > > and then start ptp, then suddently the rules that were added using tc > > could be hit. That is the reason why expected the user to enable the > > tcam manually. > > I don't understand, tc rules which do what? Why would those rules only > be hit after PTP is enabled and not before? Because you have not enabled the vcap. For example this rule: tc filter add dev eth0 ingress chain 8000000 prio 1 handle 1 protocol all flower skip_sw dst_mac 00:11:22:33:44:55/ff:ff:ff:ff:ff:ff action trap action goto chain 8100000 This will not be hit until you add this rule: tc filter add dev eth0 ingress prio 1 handle 2 matchall skip_sw action goto chain 8000000 Because this rule will enable the HW. Just to aligned to a SW implementation of the tc, we don't enable the vcap until there is a rule in chain 0 that has an action to go to chain 8000000 were it resides IS2 rules. So for example, on a fresh started lan966x the user will add the following rule: tc filter add dev eth0 ingress chain 8000000 prio 1 handle 1 protocol all flower skip_sw dst_mac 00:11:22:33:44:55/ff:ff:ff:ff:ff:ff action trap action goto chain 8100000 He expects this rule not to be hit as there is no rule in chain 0. Now if PTP is started and it would enable vcap, then suddenly this rule may be hit. I hope this helps a little bit. -- /Horatiu