From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: [RFC 3/3] rte_flow: add new action for traffic metering and policing Date: Thu, 1 Jun 2017 17:13:35 +0200 Message-ID: <20170601151335.GJ1758@6wind.com> References: <1496162653-137817-1-git-send-email-cristian.dumitrescu@intel.com> <1496162653-137817-4-git-send-email-cristian.dumitrescu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, declan.doherty@intel.com, keith.wiles@intel.com To: Cristian Dumitrescu Return-path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 8426F7CBB for ; Thu, 1 Jun 2017 17:13:42 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id 7so161704314wmo.1 for ; Thu, 01 Jun 2017 08:13:42 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1496162653-137817-4-git-send-email-cristian.dumitrescu@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Cristian, On Tue, May 30, 2017 at 05:44:13PM +0100, Cristian Dumitrescu wrote: > Signed-off-by: Cristian Dumitrescu > --- > lib/librte_ether/rte_flow.h | 22 ++++++++++++++++++++++ > 1 file changed, 22 insertions(+) > > diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h > index c47edbc..2942ca7 100644 > --- a/lib/librte_ether/rte_flow.h > +++ b/lib/librte_ether/rte_flow.h > @@ -881,6 +881,14 @@ enum rte_flow_action_type { > * See struct rte_flow_action_vf. > */ > RTE_FLOW_ACTION_TYPE_VF, > + > + /** > + * Traffic metering and policing (MTR). > + * > + * See struct rte_flow_action_meter. > + * See file rte_mtr.h for MTR object configuration. > + */ > + RTE_FLOW_ACTION_TYPE_METER, > }; > > /** > @@ -974,6 +982,20 @@ struct rte_flow_action_vf { > }; > > /** > + * RTE_FLOW_ACTION_TYPE_METER > + * > + * Traffic metering and policing (MTR). > + * > + * Packets matched by items of this type can be either dropped or passed to the > + * next item with their color set by the MTR object. > + * > + * Non-terminating by default. > + */ > +struct rte_flow_action_meter { > + uint32_t mtr_id; /**< MTR object ID created with rte_mtr_create(). */ > +}; > + > +/** > * Definition of a single action. > * > * A list of actions is terminated by a END action. Assuming this action is provided to the underlying PMD, can you describe what happens next; what is a PMD supposed to do when creating the flow rule and the impact on its data path? It looks like mtr_id is arbitrarily set by the user calling rte_mtr_create(), which means the PMD has to look up the associated MTR context somehow. How about making the rte_mtr_create() API return an opaque rte_mtr object pointer provided back to all API functions as well as through this action instead, and not leave it up to the user? -- Adrien Mazarguil 6WIND