Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2888337rwb; Fri, 9 Dec 2022 07:30:29 -0800 (PST) X-Google-Smtp-Source: AA0mqf5uPHRQZzNnczdM687IGjACrCMrke3LtM3YKtgXNQI/zvfarm2329UblT4UBID/xNUU/Q0A X-Received: by 2002:a05:6402:3710:b0:45c:835b:8fb3 with SMTP id ek16-20020a056402371000b0045c835b8fb3mr4681409edb.30.1670599829105; Fri, 09 Dec 2022 07:30:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670599829; cv=none; d=google.com; s=arc-20160816; b=OAhk+MeraFninanTkIbdTDx1JXpaIjdnNyIIqWzHnPivsnidYV+e9SVx7pCDb/uqtb L4pKZD5i/l0cUgehB0Ci9NjIt1uYHkdLhQbkB29FN1N52Tnndwxn93B8kUovHduHo+yN 9If3SgGLQvwJj1u6gp+FQe2ZfAGUuPXZvupFnUKSO+ia5u49FO+gkpWAF+Bgnm3JtO9D FNzwlo4xyEAsg+KctpR1heIgyC+WUSs0tq7h8WSOeVD1Ze9MyM1GKMTFbs7YsvBGQ22R 3Zq54Bnq7kJyx/JeALhqoIiG36IYdljojwqmwaX8J+N94ShxrZ0QhM2OsTLGoUrA9H56 JjUg== 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=sellxn+qpRx1/DuL5IfjB8JPMxjkBaM822IJtvbC2DM=; b=GBp8CTNlzXT2dlKEXUKpzWIdz7p5kyes9p47swyT5wfcssyZiPoTHhtWbpMKsY7290 Mh7Sj7RnVQhqG17sH90m9yaqFjpasktNP2jb4bfL/fzBVLo5L7UlNyvA3YFVbWS/mfNZ exQzirfo+yhI26/2Ddha3++EZYj+7z8qahmwmOcM6yPFxm1bn6KKXCpdAMrbSMJnjETU X6mK1PUNvMlUZjXQJb7nYf5s6oOkZwd/FGAjiZz3SGPybViClpIuw+2NKlzq06JQS+PY sOvyJYVMe3AbJ5Haod7YBH7hrlKhbunuHWkcL+NoNfNHEuiXScwSrbuC/tut4G8leHjG 0MHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Wi5SPhes; 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 y9-20020a056402358900b0046bb35e06e6si1646923edc.149.2022.12.09.07.30.07; Fri, 09 Dec 2022 07:30:29 -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=@gmail.com header.s=20210112 header.b=Wi5SPhes; 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 S230492AbiLIP1j (ORCPT + 75 others); Fri, 9 Dec 2022 10:27:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229710AbiLIP1S (ORCPT ); Fri, 9 Dec 2022 10:27:18 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33C418D195; Fri, 9 Dec 2022 07:27:17 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id x22so12274944ejs.11; Fri, 09 Dec 2022 07:27:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=sellxn+qpRx1/DuL5IfjB8JPMxjkBaM822IJtvbC2DM=; b=Wi5SPhesEAkDMVGSMH37+tQIpLM2sfMQITss1JrwUE7sHDicrUPrcwLwkPZaM10yjQ KO+DQmAJWq74UjmUpY9O7Fs0ABlFLtwjH4/mQN5CbmOpIgSlbjcsZONxjM6ItwxkMDY2 jE1Osv6GPfkFf444xBmUhDNuYa9g4OTWnBHHuIsm5tz9B8+jUhAuQnTROUjYNkCraGAq D5h5pONYRa/OZpvLq1nCbdgJbRLt5ObnLpLneBeuBC2KxzIpsNe4b/el1lbA/0oDolER OEzirp3MWH/jiPNXrVCOdaWibhXRNprjE01ckq2ImKhr86/dl9LVawg29LYazSl6O7wM 3emg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=sellxn+qpRx1/DuL5IfjB8JPMxjkBaM822IJtvbC2DM=; b=ekMvwVGruNc/dPLZ89BMFZsDlmt8U2rKhaPNPbiK3uH2OZ0cpRMDZYHvDuzdX6h0gn ldqLl9Lp5eS7D1EmneXGs1luCiiUYfhmSFnWduXGqpavkBVJYyw88x3FFMtqI/YH8/P3 kJ8jttK7wPAzKKzJYZLrwjjctTt5+gNXGmYNzeH7fIUfR1xIgvIBquz4qx3oCQkzLYm3 YHofUfcp0sVvDKGn1oI7zF0i1cJ4/AkvT2KXc5CMWli3bKWpx81nHBFIVeHzCVCYIJ4G whHhxJ78/cVLX7pvZHHbnivzzlqQhcfMm++G5BlM0/ggViQaiY9+SPuh9C+DaYRADLOR Z5ag== X-Gm-Message-State: ANoB5pnzy4Io7PVuWCoIft1xV+vHRHuh8yf1TZzdjrfnkknMBZVoKPFz /LPY2RWWx5ypp3uU6fb6S/Y= X-Received: by 2002:a17:906:60c9:b0:7c1:b65:14c1 with SMTP id f9-20020a17090660c900b007c10b6514c1mr5395638ejk.10.1670599635589; Fri, 09 Dec 2022 07:27:15 -0800 (PST) Received: from skbuf ([188.27.185.190]) by smtp.gmail.com with ESMTPSA id i11-20020a17090671cb00b007c0c1e18e28sm23868ejk.124.2022.12.09.07.27.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Dec 2022 07:27:15 -0800 (PST) Date: Fri, 9 Dec 2022 17:27:13 +0200 From: Vladimir Oltean To: Horatiu Vultur Cc: Michael Walle , Steen.Hegelund@microchip.com, UNGLinuxDriver@microchip.com, daniel.machon@microchip.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, lars.povlsen@microchip.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, richardcochran@gmail.com Subject: Re: [PATCH net-next v3 4/4] net: lan966x: Add ptp trap rules Message-ID: <20221209152713.qmbnovdookrmzvkx@skbuf> 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> <20221209153010.f4r577ilnlein77e@soft-dev3-1> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221209153010.f4r577ilnlein77e@soft-dev3-1> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,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 On Fri, Dec 09, 2022 at 04:30:10PM +0100, Horatiu Vultur wrote: > 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. Is it too restrictive to only allow adding offloaded filters to a chain that has a valid goto towards it, coming (perhaps indirectly) from chain 0?