From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=WAo5r+3W9LrXoKj/cxYsUAMyClm7JFHCYhO9ZUoj7so=; b=XD78yHGyeuB0WAnQxqQXSBmL3MCmZWtjP2FEYfEXRLaw6vRMZ4gotUmPaJ2od1ruOp qGYA1e5LmYl4sZCK9g85RrWvO1s4IFpr10d+ha62QgZhjyP8pWuPpf3SOSGJCADhkeiB 7E53lxnJBERW5Qbkua0MnWGRuKpGAErmSiYaHCLEF1SSjM2EQv5E7457EiKpgy/rIHH+ BzBilUq2+sqxC0MPoX5WUSEM54RzF1hfg+BzZN7XM9FE3M9Klz13Cb2k9J0K8Mk0Konr jayn0xmqrTT9Au/R3oJDXVU+WEWbHD6DdBsm627I5YoIv5H0nRrVte4Q4KGXr/dzpv94 0+Pw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=WAo5r+3W9LrXoKj/cxYsUAMyClm7JFHCYhO9ZUoj7so=; b=aiXlQDBerlZhaWYzlOK6LcV8Qw4jIyrUdOR1ZuBx6R29zi58W/QvCl5mWSXsmnZuLu tEylRzzAADyFuVdEVaWchUVNE83aO26P57j//BxxbPJP35rb7WUPihmOZjMTAcXegbu/ pnBqVoqX39T4pA0OgnM4pds4Qne+dLlw/Yenv9pdKdockR0MBP1pXhRLWqgAnExdMc2r Ceq4vvyo3bECZJcdcrWmTip/G/DzQ/VQ26sOuESVvsQhz5adbAU4mHizmlecC2pG1wkp fNK7YGGg0ZIXZHWR8z2UgCeGOGckjuWHHBVu4KAmBz//vMqecA2AU6IjCG/0iUa3AB2g R5gg== X-Gm-Message-State: AODbwcCra6qv2LzPh9hRvISDj6gIHkUfYut45ceWnJ8E0e3E4rKw75U2 cRkduXBJFJpMxDoj X-Received: by 10.223.176.214 with SMTP id j22mr2054896wra.32.1496330022166; Thu, 01 Jun 2017 08:13:42 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id i24sm9834144wrc.40.2017.06.01.08.13.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 01 Jun 2017 08:13:41 -0700 (PDT) Date: Thu, 1 Jun 2017 17:13:35 +0200 From: Adrien Mazarguil To: Cristian Dumitrescu Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, declan.doherty@intel.com, keith.wiles@intel.com 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 Content-Disposition: inline In-Reply-To: <1496162653-137817-4-git-send-email-cristian.dumitrescu@intel.com> Subject: Re: [dpdk-dev] [RFC 3/3] rte_flow: add new action for traffic metering and policing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Jun 2017 15:13:42 -0000 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