linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vladimir Oltean <vladimir.oltean@nxp.com>
To: Horatiu Vultur <horatiu.vultur@microchip.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: Thu, 11 Mar 2021 20:02:30 +0000	[thread overview]
Message-ID: <20210311200230.k4jzp44lcphhtuor@skbuf> (raw)
In-Reply-To: <20210311193008.vasrdiephy36fnxa@soft-dev3-1.localhost>

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?

  reply	other threads:[~2021-03-11 20:03 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 [this message]
2021-03-12 16:08       ` Horatiu Vultur

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=20210311200230.k4jzp44lcphhtuor@skbuf \
    --to=vladimir.oltean@nxp.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=horatiu.vultur@microchip.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=olteanv@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).