[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <DB8PR04MB5785B9263290981AC1AB6A0EF0BE0@DB8PR04MB5785.eurprd04.prod.outlook.com>
Date: Tue, 12 May 2020 09:17:59 +0000
From: Xiaoliang Yang <xiaoliang.yang_1@....com>
To: Vinicius Costa Gomes <vinicius.gomes@...el.com>,
Po Liu <po.liu@....com>,
Claudiu Manoil <claudiu.manoil@....com>,
Alexandru Marginean <alexandru.marginean@....com>,
Vladimir Oltean <vladimir.oltean@....com>,
Leo Li <leoyang.li@....com>, Mingkai Hu <mingkai.hu@....com>,
"andrew@...n.ch" <andrew@...n.ch>,
"f.fainelli@...il.com" <f.fainelli@...il.com>,
"vivien.didelot@...il.com" <vivien.didelot@...il.com>,
"davem@...emloft.net" <davem@...emloft.net>,
"jiri@...nulli.us" <jiri@...nulli.us>,
"idosch@...sch.org" <idosch@...sch.org>,
"kuba@...nel.org" <kuba@...nel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"horatiu.vultur@...rochip.com" <horatiu.vultur@...rochip.com>,
"alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>,
"allan.nielsen@...rochip.com" <allan.nielsen@...rochip.com>,
"joergen.andreasen@...rochip.com" <joergen.andreasen@...rochip.com>,
"UNGLinuxDriver@...rochip.com" <UNGLinuxDriver@...rochip.com>,
"nikolay@...ulusnetworks.com" <nikolay@...ulusnetworks.com>,
"roopa@...ulusnetworks.com" <roopa@...ulusnetworks.com>,
"linux-devel@...ux.nxdi.nxp.com" <linux-devel@...ux.nxdi.nxp.com>
Subject: RE: [EXT] Re: [PATCH v1 net-next 3/3] net: dsa: felix: add support
Credit Based Shaper(CBS) for hardware offload
Hi Vinicius,
On Tue, 12 May 2020 9:42:23 Vinicius Costa Gomes wrote:
> > +
> > + /* Rate unit is 100 kbps */
> > + cir = DIV_ROUND_UP(cbs_qopt->idleslope, 100);
> > + cir = (cir ? cir : 1);
> > + cir = min_t(u32, GENMASK(14, 0), cir);
>
> Please rename 'cir' to "rate" or "idleslope".
>
> Also consider using clamp_t here and below (I just found out about it).
>
> > + /* Burst unit is 4kB */
> > + cbs = DIV_ROUND_UP(cbs_qopt->hicredit, 4096);
> > + /* Avoid using zero burst size */
> > + cbs = (cbs ? cbs : 1);
> > + cbs = min_t(u32, GENMASK(5, 0), cbs);
>
> And please(!) rename 'cbs' to "burst" or "hicredit". Re-using the name "cbs" with a completely different meaning here is confusing.
>
I will update this, using clamp_t seems more concise in the codes.
Regards,
Xiaoliang
Powered by blists - more mailing lists