DPDK patches and discussions
 help / color / mirror / Atom feed
From: Ori Kam <orika@nvidia.com>
To: Ajit Khaparde <ajit.khaparde@broadcom.com>,
	Alexander Kozyrev <akozyrev@nvidia.com>
Cc: "Dumitrescu, Cristian" <cristian.dumitrescu@intel.com>,
	Jerin Jacob <jerinj@marvell.com>,
	"NBU-Contact-Thomas Monjalon (EXTERNAL)" <thomas@monjalon.net>,
	Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,
	"Vipin.Varghese@amd.com" <Vipin.Varghese@amd.com>,
	Ferruh Yigit <ferruh.yigit@xilinx.com>,
	Ray Kinsella <mdr@ashroe.eu>,
	Sunil Kumar Kori <skori@marvell.com>,
	Ivan Malov <ivan.malov@oktetlabs.ru>,
	"Awal, Mohammad Abdul" <mohammad.abdul.awal@intel.com>,
	"Zhang, Qi Z" <qi.z.zhang@intel.com>,
	 "Richardson, Bruce" <bruce.richardson@intel.com>,
	Konstantin Ananyev <konstantin.ananyev@intel.com>,
	"Singh, Jasvinder" <jasvinder.singh@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: RE: [RFC] ethdev: datapath-focused meter actions, continue
Date: Sun, 22 May 2022 08:03:39 +0000	[thread overview]
Message-ID: <MW2PR12MB4666FF8D6E3FA5368D50B514D6D59@MW2PR12MB4666.namprd12.prod.outlook.com> (raw)
In-Reply-To: <CACZ4nhudx5TGcKzgnX+UTmZ59GhBUPryxTtuZWH4Z_H64Q+aHw@mail.gmail.com>



> -----Original Message-----
> From: Ajit Khaparde <ajit.khaparde@broadcom.com>
> Sent: Sunday, May 22, 2022 8:01 AM
> Subject: Re: [RFC] ethdev: datapath-focused meter actions, continue
> 
> On Sat, May 21, 2022 at 7:49 PM Alexander Kozyrev <akozyrev@nvidia.com> wrote:
> >
> > On Thursday, May 19, 2022 13:35 Dumitrescu, Cristian <cristian.dumitrescu@intel.com>:
> > > Here are a few takeaways of mine, with a few actions for Alex and Ori:
> >
> > Thank you, Cristian, for compiling these takeaways. Great summary of the discussion.
> Agree.
> 
+1

> >
> > > 6. Alexander Kozyrev to provide pseudo-code for the meter operation with
> > > the new proposal:
> 
> I was wondering how the PMD and application can negotiate whether
> to use the old model or the new model.
> Maybe the application can determine if the PMD supports the traditional model or
> the new model by checking rte_mtr_meter_profile_get or rte_mtr_meter_policy_get?
> Or use something else?
> 
Good idea, and it can know if the new API is not supported, like any other rte_flow API validate it.

> 
> > >       (1) meter creation;
> > >       (2) meter sharing;
> > >       (3) meter reconfiguration: do we need to remove the flow/flows
> > > using the meter and re-add them with a new meter object that has updated
> > > configuration, or can we update the meter object itself (what API?);
> > >       (4) meter free.
> >
> > Traditional Meter Usage:
> >
> > profile_id = rte_mtr_meter_profile_add(RFC_params);
> > policy_id = rte_mtr_meter_policy_add(actions[RED/YELLOW/GREEN]);
> > meter_id = rte_mtr_create(profile_id, policy_id);
> > rte_flow_create(pattern=5-tuple,actions=METER(meter_id));
> >
> > The METER action effectively translates to the following:
> > 1. Metering a packet stream.
> > 2. Marking packets with an appropriate color.
> > 3. Jump to a policy group.
> > 4. Match on a color.
> > 5. Execute assigned policy actions for the color.
> >
> > New Meter Usage Model:
> > profile_id = rte_mtr_meter_profile_add(RFC_params);
> > *profile_obj_ptr = rte_mtr_meter_profile_get(profile_id);
> > rte_flow_create(pattern=5-tuple,
> >                 actions=METER_MARK(profile_obj_ptr),JUMP);
> > rte_flow_create(pattern=COLOR, actions=...);
> >
> > The METER_MARK action effectively translates to the following:
> > 1. Metering a packet stream.
> > 2. Marking packets with an appropriate color.
> >
> > A user is able to match the color later with the COLOR item.
> > In order to do this we add the JUMP action after the METER action.
> >
> > 3. Jump to a policy group.
> > 4. Match on a color.
> > 5. Execute actions for the color.
> >
> > Here we decoupled the meter profile usage from the meter policy usage
> > for greater flexibility and got rid of any locks related to meter_id lookup.
> >
> > Another example of the meter creation to mimic the old model entirely:
> > profile_id = rte_mtr_meter_profile_add(RFC_params);
> > *profile_obj_ptr = rte_mtr_meter_profile_get(profile_id);
> > policy_id = rte_mtr_meter_policy_add(actions[RED/YELLOW/GREEN]);
> > *policy_obj_ptr = rte_mtr_meter_policy_get(policy_id);
> > rte_flow_create(pattern=5-tuple,
> >                 actions= METER_MARK(profile_obj_ptr, policy_obj_ptr));
> >
> >
> > In this case, we define the policy actions right away.
> > The main advantage is not having to lookup for profile_id/policy_id.
> >
> > To free the meter obects we need to do the following:
> > rte_flow_destroy(flow_handle);
> > rte_mtr_meter_policy_delete(policy_id);
> > rte_mtr_meter_profile_delete(profile_id);.
> > profile_obj_ptr and policy_obj_ptr are no longer valid after that.
> >
> > The meter profile configuration cannot be updated dynamically
> > with the current set of patches, but can be supported later on.
> > Now you have to destroy flows and profiles and recreate them.
> > But rte_mtr_meter_profile_update()/rte_mtr_meter_policy_update()
> > can have the corresponding siblings without mtr_id parameters.
> > In this case, we can update the config and all the flows using them.
> >
> > The meter sharing is done via the indirect action Flow API:
> > profile_id = rte_mtr_meter_profile_add(RFC_params);
> > *profile_obj_ptr = rte_mtr_meter_profile_get(profile_id);
> > handle = rte_flow_action_handle_create(action= METER_MARK(profile_obj_ptr, NULL));
> > flow1 = rte_flow_create(pattern=5-tuple-1, actions=INDIRECT(handle));
> > flow2 = rte_flow_create(pattern=5-tuple-2, actions=INDIRECT(handle));
> >
> > Once we are done with the flow rules we can free everything.
> > rte_flow_destroy(flow1);
> > rte_flow_destroy(flow2);
> > rte_flow_action_handle_destroy(handle);
> > rte_mtr_meter_profile_delete(profile_id);

  reply	other threads:[~2022-05-22  8:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <DM8PR11MB56700A79B2A579AD7A743A3DEBCA9@DM8PR11MB5670.namprd11.prod.outlook.com>
2022-05-19 17:34 ` Dumitrescu, Cristian
2022-05-22  2:49   ` Alexander Kozyrev
2022-05-22  5:00     ` Ajit Khaparde
2022-05-22  8:03       ` Ori Kam [this message]
2022-05-16 18:15 Alexander Kozyrev
2022-05-18 16:51 ` Andrew Rybchenko
2022-05-19  2:17   ` Alexander Kozyrev
2022-05-19  6:44     ` Andrew Rybchenko
2022-05-19  8:41       ` Ori Kam
2022-05-19  9:42         ` Andrew Rybchenko
2022-05-19 13:55 ` Jerin Jacob
2022-05-19 14:34   ` Dumitrescu, Cristian

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=MW2PR12MB4666FF8D6E3FA5368D50B514D6D59@MW2PR12MB4666.namprd12.prod.outlook.com \
    --to=orika@nvidia.com \
    --cc=Vipin.Varghese@amd.com \
    --cc=ajit.khaparde@broadcom.com \
    --cc=akozyrev@nvidia.com \
    --cc=andrew.rybchenko@oktetlabs.ru \
    --cc=bruce.richardson@intel.com \
    --cc=cristian.dumitrescu@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@xilinx.com \
    --cc=ivan.malov@oktetlabs.ru \
    --cc=jasvinder.singh@intel.com \
    --cc=jerinj@marvell.com \
    --cc=konstantin.ananyev@intel.com \
    --cc=mdr@ashroe.eu \
    --cc=mohammad.abdul.awal@intel.com \
    --cc=qi.z.zhang@intel.com \
    --cc=skori@marvell.com \
    --cc=thomas@monjalon.net \
    /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).