From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: Michael Walle <michael@walle.cc>, <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
Date: Fri, 9 Dec 2022 16:30:10 +0100 [thread overview]
Message-ID: <20221209153010.f4r577ilnlein77e@soft-dev3-1> (raw)
In-Reply-To: <20221209145637.nr6favnsofmwo45s@skbuf>
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
next prev parent reply other threads:[~2022-12-09 15:25 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-03 10:43 [PATCH net-next v3 0/4] net: lan966x: Enable PTP on bridge interfaces Horatiu Vultur
2022-12-03 10:43 ` [PATCH net-next v3 1/4] net: microchip: vcap: Add vcap_get_rule Horatiu Vultur
2022-12-06 12:31 ` Paolo Abeni
2022-12-07 8:30 ` Horatiu Vultur
2022-12-03 10:43 ` [PATCH net-next v3 2/4] net: microchip: vcap: Add vcap_mod_rule Horatiu Vultur
2022-12-03 10:43 ` [PATCH net-next v3 3/4] net: microchip: vcap: Add vcap_rule_get_key_u32 Horatiu Vultur
2022-12-03 10:43 ` [PATCH net-next v3 4/4] net: lan966x: Add ptp trap rules Horatiu Vultur
2022-12-08 9:25 ` Michael Walle
2022-12-08 9:27 ` Michael Walle
2022-12-08 13:04 ` Horatiu Vultur
2022-12-08 13:18 ` Michael Walle
2022-12-09 9:29 ` Horatiu Vultur
2022-12-09 12:10 ` Michael Walle
2022-12-09 12:58 ` Horatiu Vultur
2022-12-09 12:56 ` Vladimir Oltean
2022-12-09 14:05 ` Michael Walle
2022-12-09 14:14 ` Vladimir Oltean
2022-12-09 14:20 ` Horatiu Vultur
2022-12-09 14:23 ` Michael Walle
2022-12-09 14:54 ` Horatiu Vultur
2022-12-09 14:43 ` Vladimir Oltean
2022-12-09 14:47 ` Vladimir Oltean
2022-12-09 14:57 ` Horatiu Vultur
2022-12-09 14:56 ` Vladimir Oltean
2022-12-09 15:30 ` Horatiu Vultur [this message]
2022-12-09 15:27 ` Vladimir Oltean
2022-12-09 23:03 ` Jakub Kicinski
2022-12-12 14:27 ` Horatiu Vultur
2022-12-12 14:20 ` Horatiu Vultur
2023-01-05 15:09 ` Michael Walle
2023-01-05 21:55 ` Horatiu Vultur
2022-12-06 12:40 ` [PATCH net-next v3 0/4] net: lan966x: Enable PTP on bridge interfaces patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221209153010.f4r577ilnlein77e@soft-dev3-1 \
--to=horatiu.vultur@microchip.com \
--cc=Steen.Hegelund@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=daniel.machon@microchip.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=kuba@kernel.org \
--cc=lars.povlsen@microchip.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michael@walle.cc \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).