All of lore.kernel.org
 help / color / mirror / Atom feed
From: Horatiu Vultur <horatiu.vultur@microchip.com>
To: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
Cc: Vladimir Oltean <vladimir.oltean@nxp.com>,
	"davem@davemloft.net" <davem@davemloft.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"allan.nielsen@microchip.com" <allan.nielsen@microchip.com>,
	"joergen.andreasen@microchip.com"
	<joergen.andreasen@microchip.com>,
	"UNGLinuxDriver@microchip.com" <UNGLinuxDriver@microchip.com>,
	"vinicius.gomes@intel.com" <vinicius.gomes@intel.com>,
	"michael.chan@broadcom.com" <michael.chan@broadcom.com>,
	"vishal@chelsio.com" <vishal@chelsio.com>,
	"saeedm@mellanox.com" <saeedm@mellanox.com>,
	"jiri@mellanox.com" <jiri@mellanox.com>,
	"idosch@mellanox.com" <idosch@mellanox.com>,
	"alexandre.belloni@bootlin.com" <alexandre.belloni@bootlin.com>,
	"kuba@kernel.org" <kuba@kernel.org>, Po Liu <po.liu@nxp.com>,
	Leo Li <leoyang.li@nxp.com>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	"andrew@lunn.ch" <andrew@lunn.ch>,
	"vivien.didelot@gmail.com" <vivien.didelot@gmail.com>,
	Claudiu Manoil <claudiu.manoil@nxp.com>
Subject: Re: [PATCH v4 net-next 7/8] net: mscc: ocelot: use index to set vcap policer
Date: Thu, 23 Sep 2021 09:30:59 +0200	[thread overview]
Message-ID: <20210923073059.wbzukwaiyylel72x@soft-dev3-1.localhost> (raw)
In-Reply-To: <DB8PR04MB578599F04A8764034485CE89F0A39@DB8PR04MB5785.eurprd04.prod.outlook.com>

The 09/23/2021 01:52, Xiaoliang Yang wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> On Wed, Sep 22, 2021 at 13:18:37 +0000, Vladimir Oltean wrote:
> > > Policer was previously automatically assigned from the highest index
> > > to the lowest index from policer pool. But police action of tc flower
> > > now uses index to set an police entry. This patch uses the police
> > > index to set vcap policers, so that one policer can be shared by multiple
> > rules.
> > >
> > > Signed-off-by: Xiaoliang Yang <xiaoliang.yang_1@nxp.com>
> > > ---
> > > +#define VSC9959_VCAP_POLICER_BASE  63
> > > +#define VSC9959_VCAP_POLICER_MAX   383
> > >
> >
> > > +#define VSC7514_VCAP_POLICER_BASE                  128
> > > +#define VSC7514_VCAP_POLICER_MAX                   191
> >
> > I think this deserves an explanation.
> >
> > The VSC7514 driver uses the max number of policers as 383 (0x17f) ever since
> > commit b596229448dd ("net: mscc: ocelot: Add support for tcam"), aka the
> > very beginning.
> >
> > Yet, the documentation at "3.10.1 Policer Allocation"
> > https://ww1.microchip.com/downloads/en/DeviceDoc/VMDS-10491.pdf
> > says very clearly that there are only 192 policers indeed.
> >
> > What's going on?
> 
> In commit commit b596229448dd ("net: mscc: ocelot: Add support for tcam"), Horatiu Vultur define the max number of policers as 383:
> +#define OCELOT_POLICER_DISCARD 0x17f
> VCAP IS2 use this policer to set drop action. I did not change this and set the VCAP policers with 128-191 according to the VSC7514 document.
> 
> I don't know why 383 was used as the maximum value of policer in the original code. Can Microchip people check the code or the documentation for errors?

It was defined as 383 because the HW actually support this number of
policers. But for this SKU it is recomended to use 191, but no one will
stop you from using 383.

> 
> >
> > Also, FWIW, Seville has this policer allocation:
> >
> >       0 ----+----------------------+
> >             |  Port Policers (11)  |
> >      11 ----+----------------------+
> >             |  VCAP Policers (21)  |
> >      32 ----+----------------------+
> >             |   QoS Policers (88)  |
> >     120 ----+----------------------+
> >             |  VCAP Policers (43)  |
> >     162 ----+----------------------+
> 
> I didn't find Seville's document, if this allocation is right, I will add it in Seville driver.
> 
> Thanks,
> Xiaoliang

-- 
/Horatiu

  reply	other threads:[~2021-09-23  7:29 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-22 10:51 [PATCH v4 net-next 0/8] net: dsa: felix: psfp support on vsc9959 Xiaoliang Yang
2021-09-22 10:51 ` [PATCH v4 net-next 1/8] net: mscc: ocelot: export struct ocelot_mact_entry Xiaoliang Yang
2021-09-23  1:57   ` Florian Fainelli
2021-09-22 10:51 ` [PATCH v4 net-next 2/8] net: mscc: ocelot: add MAC table write and lookup operations Xiaoliang Yang
2021-09-23  1:58   ` Florian Fainelli
2021-09-22 10:51 ` [PATCH v4 net-next 3/8] net: mscc: ocelot: set vcap IS2 chain to goto PSFP chain Xiaoliang Yang
2021-09-22 10:51 ` [PATCH v4 net-next 4/8] net: mscc: ocelot: add gate and police action offload to PSFP Xiaoliang Yang
2021-09-22 10:51 ` [PATCH v4 net-next 5/8] net: dsa: felix: support psfp filter on vsc9959 Xiaoliang Yang
2021-09-22 12:47   ` Vladimir Oltean
2021-09-23  2:30     ` Xiaoliang Yang
2021-09-23  9:44       ` Vladimir Oltean
2021-09-23 11:23         ` Xiaoliang Yang
2021-09-23 11:35           ` Vladimir Oltean
2021-09-22 10:52 ` [PATCH v4 net-next 6/8] net: dsa: felix: add stream gate settings for psfp Xiaoliang Yang
2021-09-22 10:52 ` [PATCH v4 net-next 7/8] net: mscc: ocelot: use index to set vcap policer Xiaoliang Yang
2021-09-22 13:18   ` Vladimir Oltean
2021-09-23  1:52     ` Xiaoliang Yang
2021-09-23  7:30       ` Horatiu Vultur [this message]
2021-09-23  9:22         ` Vladimir Oltean
2021-09-23 14:07           ` Horatiu Vultur
2021-09-22 10:52 ` [PATCH v4 net-next 8/8] net: dsa: felix: use vcap policer to set flow meter for psfp Xiaoliang Yang
  -- strict thread matches above, loose matches on Subject: below --
2021-09-07  9:09 [PATCH v4 net-next 0/8] net: dsa: felix: psfp support on vsc9959 Xiaoliang Yang
2021-09-07  9:09 ` [PATCH v4 net-next 7/8] net: mscc: ocelot: use index to set vcap policer Xiaoliang Yang

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=20210923073059.wbzukwaiyylel72x@soft-dev3-1.localhost \
    --to=horatiu.vultur@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=allan.nielsen@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=claudiu.manoil@nxp.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=idosch@mellanox.com \
    --cc=jiri@mellanox.com \
    --cc=joergen.andreasen@microchip.com \
    --cc=kuba@kernel.org \
    --cc=leoyang.li@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=po.liu@nxp.com \
    --cc=saeedm@mellanox.com \
    --cc=vinicius.gomes@intel.com \
    --cc=vishal@chelsio.com \
    --cc=vivien.didelot@gmail.com \
    --cc=vladimir.oltean@nxp.com \
    --cc=xiaoliang.yang_1@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.