From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: Vladimir Oltean <olteanv@gmail.com>,
"davem@davemloft.net" <davem@davemloft.net>,
"kuba@kernel.org" <kuba@kernel.org>,
Claudiu Manoil <claudiu.manoil@nxp.com>,
"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next] net: ocelot: Extend MRP
Date: Fri, 12 Mar 2021 17:08:37 +0100 [thread overview]
Message-ID: <20210312160837.ilib6auj4q6sskp4@soft-dev3-1.localhost> (raw)
In-Reply-To: <20210311200230.k4jzp44lcphhtuor@skbuf>
The 03/11/2021 20:02, Vladimir Oltean wrote:
>
> On Thu, Mar 11, 2021 at 08:30:08PM +0100, Horatiu Vultur wrote:
> > > > +static void ocelot_mrp_save_mac(struct ocelot *ocelot,
> > > > + struct ocelot_port *port)
> > > > +{
> > > > + ocelot_mact_learn(ocelot, PGID_MRP, mrp_test_dmac,
> > > > + port->pvid_vlan.vid, ENTRYTYPE_LOCKED);
> > > > + ocelot_mact_learn(ocelot, PGID_MRP, mrp_control_dmac,
> > > > + port->pvid_vlan.vid, ENTRYTYPE_LOCKED);
> > >
> > > Let me make sure I understand.
> > > By learning these multicast addresses, you mark them as 'not unknown' in
> > > the MAC table, because otherwise they will be flooded, including to the
> > > CPU port module, and there's no way you can remove the CPU from the
> > > flood mask, even if the packets get later redirected through VCAP IS2?
> >
> > Yes, so far you are right.
> >
> > > I mean that's the reason why we have the policer on the CPU port for the
> > > drop action in ocelot_vcap_init, no?
> >
> > I am not sure that would work because I want the action to be redirect
> > and not policy. Or maybe I am missing something?
>
> Yes, it is not the same context as for tc-drop. The problem for tc-drop
> was that the packets would get removed from the hardware datapath, but
> they would still get copied to the CPU nonetheless. A policer there was
> an OK solution because we wanted to kill those packets completely. Here,
> the problem is the same, but we cannot use the same solution, since a
> policer will also prevent the frames from being redirected.
>
> > >
> > > > diff --git a/include/soc/mscc/ocelot.h b/include/soc/mscc/ocelot.h
> > > > index 425ff29d9389..c41696d2e82b 100644
> > > > --- a/include/soc/mscc/ocelot.h
> > > > +++ b/include/soc/mscc/ocelot.h
> > > > @@ -51,6 +51,7 @@
> > > > */
> > > >
> > > > /* Reserve some destination PGIDs at the end of the range:
> > > > + * PGID_MRP: used for not flooding MRP frames to CPU
> > >
> > > Could this be named PGID_BLACKHOLE or something? It isn't specific to
> > > MRP if I understand correctly. We should also probably initialize it
> > > with zero.
> >
> > It shouldn't matter the value, what is important that the CPU port not
> > to be set. Because the value of this PGID will not be used in the
> > fowarding decision.
> > Currently only MRP is using it so that is the reason for naming it like
> > that but I can rename it and initialized it to 0 to be more clear.
>
> So tell me more about this behavior.
> Is there no way to suppress the flooding to CPU action, even if the
> frame was hit by a TCAM rule? Let's forget about MRP, assume this is an
> broadcast IPv4 packet, and we have a matching src_ip rule to perform
> mirred egress redirect to another port.
> Would the CPU be flooded with this traffic too? What would you do to
> avoid that situation?
I think so, I need to ask around to be able to answer your question.
You have to think about CPU port as a special port. If at any point
while the frame goes through the switch, there is a decision to copy the
frame to CPU, the frame will be copied to CPU regardless of the previous
or next decisions. That is at least my understanding.
--
/Horatiu
prev parent reply other threads:[~2021-03-12 16:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-10 20:51 [PATCH net-next] net: ocelot: Extend MRP Horatiu Vultur
2021-03-11 0:25 ` Vladimir Oltean
2021-03-11 19:30 ` Horatiu Vultur
2021-03-11 20:02 ` Vladimir Oltean
2021-03-12 16:08 ` Horatiu Vultur [this message]
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=20210312160837.ilib6auj4q6sskp4@soft-dev3-1.localhost \
--to=horatiu.vultur@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=alexandre.belloni@bootlin.com \
--cc=claudiu.manoil@nxp.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=vladimir.oltean@nxp.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