[dpdk-dev] [PATCH v3 1/2] ethdev: add pre-defined meter policy API

Li Zhang lizh at nvidia.com
Wed Apr 14 18:21:07 CEST 2021


Hi Cristian,

Thank you for giving suggestion.
Will add in V7 patch.

Regards,
Li Zhang
> -----Original Message-----
> From: Dumitrescu, Cristian <cristian.dumitrescu at intel.com>
> Sent: Wednesday, April 14, 2021 10:01 PM
> To: Asaf Penso <asafp at nvidia.com>; NBU-Contact-Thomas Monjalon
> <thomas at monjalon.net>; Li Zhang <lizh at nvidia.com>
> Cc: Ori Kam <orika at nvidia.com>; Slava Ovsiienko
> <viacheslavo at nvidia.com>; Matan Azrad <matan at nvidia.com>;
> lironh at marvell.com; Wisam Monther <wisamm at nvidia.com>; Li, Xiaoyun
> <xiaoyun.li at intel.com>; Singh, Jasvinder <jasvinder.singh at intel.com>; Yigit,
> Ferruh <ferruh.yigit at intel.com>; Andrew Rybchenko
> <andrew.rybchenko at oktetlabs.ru>; Ray Kinsella <mdr at ashroe.eu>; Jerin
> Jacob <jerinjacobk at gmail.com>; Hemant Agrawal
> <hemant.agrawal at nxp.com>; dev at dpdk.org; Raslan Darawsheh
> <rasland at nvidia.com>; Roni Bar Yanai <roniba at nvidia.com>; Haifei Luo
> <haifeil at nvidia.com>; Jiawei(Jonny) Wang <jiaweiw at nvidia.com>
> Subject: RE: [dpdk-dev] [PATCH v3 1/2] ethdev: add pre-defined meter policy
> API
> 
> External email: Use caution opening links or attachments
> 
> 
> > >14/04/2021 06:55, Li Zhang:
> > >> > > + * Example #2: GREEN - Do nothing, YELLOW - Do nothing, RED -
> > DROP
> > >> > > + *   struct rte_mtr_meter_policy_params policy_1 =
> > >> > > + *                                   (struct
> > >> > > rte_mtr_meter_policy_params) {
> > >> > > + *           .actions[RTE_COLOR_GREEN] = NULL,
> > >> > > + *           .actions[RTE_COLOR_YELLOW] = NULL,
> > >> > > + *           .actions[RTE_COLOR_RED] = (struct rte_flow_action[]) {
> > >> > > + *                   {
> > >> > > + *                           .type = RTE_FLOW_ACTION_TYPE_DROP,
> > >> > > + *                   },
> > >> > > + *                   {
> > >> > > + *                           .type = RTE_FLOW_ACTION_TYPE_END,
> > >> > > + *                   },
> > >> > > + *           },
> > >> > > + *   };
> > >> > > + *
> > >> >
> > >> > These two example policies should be available to be used
> > >> > straight away, please make them real data structures, not comments.
> > >
> > >Wait, you are giving code examples as part of doxygen?
> > >It's really too long, we don't do that.
> > >
> > >> > I suggest their names as: pass_color_policy_params and
> > >> > drop_red_policy_params.
> > >> >
> > >> Thanks. Will change the names. But it can not be real data
> > >> structures,
> > since it
> > >just one example define and no use code.
> > >> It will bring build as below:
> > >> error: 'drop_red_policy_params' defined but not used.
> > >>  User can copy these example to his .c file when it using
> > >rte_mtr_meter_policy_add().
> > >
> 
> Although these could be looked at as examples, they are really more than
> examples: they are expected to be frequent policies that users would require,
> so it would be good to have them with the API itself.
> 
> Li, I agree we cannot instantiate structs in the header file, how about we
> place them as macros in the header file:
> 
> #define rte_mtr_policy_pass_color struct { \ ...
> 
> #define rte_mtr_policy_drop_red struct { \ ...
> 
> Regards,
> Cristian


More information about the dev mailing list