DPDK patches and discussions
 help / color / mirror / Atom feed
From: Li Zhang <lizh@nvidia.com>
To: Ori Kam <orika@nvidia.com>,
	"dekelp@nvidia.com" <dekelp@nvidia.com>,
	Slava Ovsiienko <viacheslavo@nvidia.com>,
	Matan Azrad <matan@nvidia.com>,
	Shahaf Shuler <shahafs@nvidia.com>,
	"cristian.dumitrescu@intel.com" <cristian.dumitrescu@intel.com>,
	"lironh@marvell.com" <lironh@marvell.com>,
	Wisam Monther <wisamm@nvidia.com>,
	Xiaoyun Li <xiaoyun.li@intel.com>,
	Jasvinder Singh <jasvinder.singh@intel.com>,
	NBU-Contact-Thomas Monjalon <thomas@monjalon.net>,
	Ferruh Yigit <ferruh.yigit@intel.com>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	Ray Kinsella <mdr@ashroe.eu>, Neil Horman <nhorman@tuxdriver.com>
Cc: "dev@dpdk.org" <dev@dpdk.org>,
	Raslan Darawsheh <rasland@nvidia.com>,
	Roni Bar Yanai <roniba@nvidia.com>,
	Haifei Luo <haifeil@nvidia.com>
Subject: Re: [dpdk-dev] [PATCH v2 1/2] ethdev: add pre-defined meter policy API
Date: Thu, 8 Apr 2021 14:37:41 +0000	[thread overview]
Message-ID: <DM6PR12MB4090716A537D2F1CACA81DE1BF749@DM6PR12MB4090.namprd12.prod.outlook.com> (raw)
In-Reply-To: <DM6PR12MB4987A6D306BA487030500102D6749@DM6PR12MB4987.namprd12.prod.outlook.com>

Hi Ori,

Thank you for your comments.
I will add it into V3 patch.

Regards,
Li Zhang
> -----Original Message-----
> From: Ori Kam <orika@nvidia.com>
> Sent: Thursday, April 8, 2021 9:55 PM
> To: Li Zhang <lizh@nvidia.com>; dekelp@nvidia.com; Slava Ovsiienko
> <viacheslavo@nvidia.com>; Matan Azrad <matan@nvidia.com>; Shahaf
> Shuler <shahafs@nvidia.com>; cristian.dumitrescu@intel.com;
> lironh@marvell.com; Wisam Monther <wisamm@nvidia.com>; Xiaoyun Li
> <xiaoyun.li@intel.com>; Jasvinder Singh <jasvinder.singh@intel.com>; NBU-
> Contact-Thomas Monjalon <thomas@monjalon.net>; Ferruh Yigit
> <ferruh.yigit@intel.com>; Andrew Rybchenko
> <andrew.rybchenko@oktetlabs.ru>; Ray Kinsella <mdr@ashroe.eu>; Neil
> Horman <nhorman@tuxdriver.com>
> Cc: dev@dpdk.org; Raslan Darawsheh <rasland@nvidia.com>; Roni Bar Yanai
> <roniba@nvidia.com>; Haifei Luo <haifeil@nvidia.com>
> Subject: RE: [PATCH v2 1/2] ethdev: add pre-defined meter policy API
> 
> Hi Li,
> 
> > -----Original Message-----
> > From: Li Zhang <lizh@nvidia.com>
> > Sent: Friday, April 2, 2021 1:36 PM
> > Subject: [PATCH v2 1/2] ethdev: add pre-defined meter policy API
> >
> > Currently, the flow meter policy does not support multiple actions per
> > color; also the allowed action types per color are very limited.
> > In addition, the policy cannot be pre-defined.
> >
> > Due to the growing in flow actions offload abilities there is a
> > potential for the user to use variety of actions per color differently.
> > This new meter policy API comes to allow this potential in the most
> > ethdev common way using rte_flow action definition.
> > A list of rte_flow actions will be provided by the user per color in
> > order to create a meter policy.
> > In addition, the API forces to pre-define the policy before the meters
> > creation in order to allow sharing of single policy with multiple
> > meters efficiently.
> >
> > meter_policy_id is added into struct rte_mtr_params.
> > So that it can get the policy during the meters creation.
> >
> > Policy id 0 is default policy. Action per color as below:
> > green - nothing, yellow - nothing, red - drop
> >
> > Allow coloring the packet using a new rte_flow_action_color as could
> > be done by the old policy API,
> >
> > The next API function were added:
> > - rte_mtr_meter_policy_create
> > - rte_mtr_meter_policy_delete
> > - rte_mtr_meter_policy_update
> > - rte_mtr_meter_policy_validate
> > The next struct was changed:
> > - rte_mtr_params
> > - rte_mtr_capabilities
> > The next API was deleted:
> > - rte_mtr_policer_actions_update
> >
> > To support this API the following app were changed:
> > app/test-flow-perf: clean meter policer
> > app/testpmd: clean meter policer
> >
> > To support this API the following drivers were changed:
> > net/softnic: support meter policy API
> > 1. cleans meter rte_mtr_policer_action.
> > 2. Support policy API to get color action as policer action did.
> >    The color action will be mapped into rte_table_action_policer.
> > 3. Create default policy if policy id is RTE_MTR_DEFAULT_POLICY_ID.
> >    default policy actoins:
> >    green - do nothing, yellow - do nothing, red - drop
> >
> > net/mlx5: clean meter creation management Cleans and breaks part of
> > the current meter management in order to allow better design with
> > policy API.
> >
> > Signed-off-by: Li Zhang <lizh@nvidia.com>
> > Signed-off-by: Haifei Luo <haifeil@nvidia.com>
> > ---
> >  app/test-flow-perf/main.c                     |   7 -
> >  app/test-pmd/cmdline.c                        |   1 -
> >  app/test-pmd/cmdline_mtr.c                    | 172 -------
> >  app/test-pmd/cmdline_mtr.h                    |   1 -
> >  doc/guides/nics/mlx5.rst                      |  12 +
> >  doc/guides/prog_guide/rte_flow.rst            |  20 +
> >  .../traffic_metering_and_policing.rst         |   9 +-
> >  doc/guides/rel_notes/release_21_05.rst        |  14 +-
> >  doc/guides/testpmd_app_ug/testpmd_funcs.rst   |  18 -
> >  drivers/net/mlx5/mlx5.h                       |  24 +-
> >  drivers/net/mlx5/mlx5_flow.c                  |  46 --
> >  drivers/net/mlx5/mlx5_flow.h                  |  18 +-
> >  drivers/net/mlx5/mlx5_flow_aso.c              |  15 +-
> >  drivers/net/mlx5/mlx5_flow_dv.c               | 463 +-----------------
> >  drivers/net/mlx5/mlx5_flow_meter.c            | 369 +-------------
> >  drivers/net/softnic/rte_eth_softnic_flow.c    |  19 +-
> >  .../net/softnic/rte_eth_softnic_internals.h   |  18 +-
> >  drivers/net/softnic/rte_eth_softnic_meter.c   | 264 +++++++---
> >  lib/librte_ethdev/rte_flow.h                  |  18 +
> >  lib/librte_ethdev/rte_mtr.c                   |  55 ++-
> >  lib/librte_ethdev/rte_mtr.h                   | 157 ++++--
> >  lib/librte_ethdev/rte_mtr_driver.h            |  44 +-
> >  lib/librte_ethdev/version.map                 |   4 +
> >  23 files changed, 510 insertions(+), 1258 deletions(-)
> >
> > diff --git a/app/test-flow-perf/main.c b/app/test-flow-perf/main.c
> > index 99d0463456..66ec776017 100644
> > --- a/app/test-flow-perf/main.c
> > +++ b/app/test-flow-perf/main.c
> > @@ -924,13 +924,6 @@ create_meter_rule(int port_id, uint32_t counter)
> >
> >  	/*create meter*/
> >  	params.meter_profile_id = default_prof_id;
> > -	params.action[RTE_COLOR_GREEN] =
> > -		MTR_POLICER_ACTION_COLOR_GREEN;
> > -	params.action[RTE_COLOR_YELLOW] =
> > -		MTR_POLICER_ACTION_COLOR_YELLOW;
> > -	params.action[RTE_COLOR_RED] =
> > -		MTR_POLICER_ACTION_DROP;
> > -
> >  	ret = rte_mtr_create(port_id, counter, &params, 1, &error);
> >  	if (ret != 0) {
> >  		printf("Port %u create meter idx(%d) error(%d) message:
> > %s\n",
> ,
> 
> [snip]
> 
> >
> >  	.stats_read = pmd_mtr_stats_read,
> > diff --git a/lib/librte_ethdev/rte_flow.h
> > b/lib/librte_ethdev/rte_flow.h index 6cc57136ac..0c5807deea 100644
> > --- a/lib/librte_ethdev/rte_flow.h
> > +++ b/lib/librte_ethdev/rte_flow.h
> > @@ -32,6 +32,7 @@
> >  #include <rte_ecpri.h>
> >  #include <rte_mbuf.h>
> >  #include <rte_mbuf_dyn.h>
> > +#include <rte_meter.h>
> >
> >  #ifdef __cplusplus
> >  extern "C" {
> > @@ -2267,6 +2268,13 @@ enum rte_flow_action_type {
> >  	 * See struct rte_flow_action_modify_field.
> >  	 */
> >  	RTE_FLOW_ACTION_TYPE_MODIFY_FIELD,
> > +
> > +	/**
> > +	 * Color the packet to reflect the meter color result.
> > +	 *
> > +	 * See struct rte_flow_action_meter_color.
> > +	 */
> > +	RTE_FLOW_ACTION_TYPE_METER_COLOR,
> 
> Following previous discussion in the ML
> I agree to this change with few comments:
> 1. This action will be experimental and we might change it later to adjust to
> other rte_flow actions.
> 2. please make sure in the doc and comment above that it is documented That
> this goes to mbuf field Something like:
> Set the meter color in the mbuf to the selected color.
> Since it doesn't color the packet for the rest of the rte_flow.
> 
> [snip]
> Best
> Ori

  reply	other threads:[~2021-04-08 14:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-01  6:54 [dpdk-dev] [PATCH 0/2] Support " Li Zhang
2021-04-01  6:54 ` [dpdk-dev] [PATCH 1/2] ethdev: add pre-defined " Li Zhang
2021-04-01  6:54 ` [dpdk-dev] [PATCH 2/2] app/testpmd: support policy actions per color Li Zhang
2021-04-02 10:36 ` [dpdk-dev] [PATCH v2 0/2] Support meter policy API Li Zhang
2021-04-02 10:36   ` [dpdk-dev] [PATCH v2 1/2] ethdev: add pre-defined " Li Zhang
2021-04-08 13:55     ` Ori Kam
2021-04-08 14:37       ` Li Zhang [this message]
2021-04-02 10:36   ` [dpdk-dev] [PATCH v2 2/2] app/testpmd: support policy actions per color Li Zhang

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=DM6PR12MB4090716A537D2F1CACA81DE1BF749@DM6PR12MB4090.namprd12.prod.outlook.com \
    --to=lizh@nvidia.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dekelp@nvidia.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=haifeil@nvidia.com \
    --cc=jasvinder.singh@intel.com \
    --cc=lironh@marvell.com \
    --cc=matan@nvidia.com \
    --cc=mdr@ashroe.eu \
    --cc=nhorman@tuxdriver.com \
    --cc=orika@nvidia.com \
    --cc=rasland@nvidia.com \
    --cc=roniba@nvidia.com \
    --cc=shahafs@nvidia.com \
    --cc=thomas@monjalon.net \
    --cc=viacheslavo@nvidia.com \
    --cc=wisamm@nvidia.com \
    --cc=xiaoyun.li@intel.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).