From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B9E73A04BA; Wed, 7 Oct 2020 23:23:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 456C71B68A; Wed, 7 Oct 2020 23:23:35 +0200 (CEST) Received: from mail-oo1-f65.google.com (mail-oo1-f65.google.com [209.85.161.65]) by dpdk.org (Postfix) with ESMTP id A41821B677 for ; Wed, 7 Oct 2020 23:23:32 +0200 (CEST) Received: by mail-oo1-f65.google.com with SMTP id c4so986747oou.6 for ; Wed, 07 Oct 2020 14:23:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Lz84JYgptO3z5UdQ/Aw83hVg8d5M4DXBgWeZEPN1jIg=; b=UI0Y/pW4BbRAAXoY0zeZfXHWFCOPgs5eWIXtWcjPmx6nDYMUbLLgk6YbyG1TJ2hY5E PVhkOkPGGF0YS7cvybpi2rhWUJ1hcjDb4p8phYy35HnyijXCslimVepu55u6jnuhFdVi AKyW84Nrt5S7/PaqyxZdTnNrjrlLLTd71AR/U= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Lz84JYgptO3z5UdQ/Aw83hVg8d5M4DXBgWeZEPN1jIg=; b=uDPq0A7zgmL1IBqkv2YoeJpBc1AxjgZ2wg5nURUaNuT+bLQcHpPk+7uWnzaqLfDP4Y KfxqUtHID0wuhXWyYX7FJvTlyGPNZC+UXz24ef3m5eq+1QB7/fsA6W8pt+AX6l0FQykj j3ROkLnL9b6ZYYfa0BRYK2EqPcY0cqT/rBbQc3CuuLS07mA4mS2ECACHlvo67lSqUhS6 dxjoKrbiRDQZHM3hYvJqD70cdmPOrYgnbZqu/ERgkVyp0tW6mIP3BreUU9+4wfa8s1Zw KT3pLS4wH1K2J7ylsXsNISYI43VlJihW8uJDlJkMPLUGNvgD38INKvHGaA6i+X1q6zBF Qqow== X-Gm-Message-State: AOAM532K2I+KKr+jzAZK9wEem+hvxQOgIgrivdl2UiOCecu5HGVlXOzH qprDSAYhycgx3BSg8BrWQlqTDyZmO6ikWgAk64uYww== X-Google-Smtp-Source: ABdhPJzh4G1mMth09MOP/iOQxREhMDfye7Ns5nw6b1wvUZ/JlBPOTv/P+sdbdBQYVSH/YNLIfxC2d1Inu2koNxRuCdM= X-Received: by 2002:a4a:9e87:: with SMTP id u7mr3388038ook.15.1602105811704; Wed, 07 Oct 2020 14:23:31 -0700 (PDT) MIME-Version: 1.0 References: <20200702120511.16315-1-andreyv@mellanox.com> <20201007125612.20579-1-andreyv@nvidia.com> <20201007125612.20579-2-andreyv@nvidia.com> In-Reply-To: <20201007125612.20579-2-andreyv@nvidia.com> From: Ajit Khaparde Date: Wed, 7 Oct 2020 14:23:15 -0700 Message-ID: To: Andrey Vesnovaty Cc: dpdk-dev , jer@marvell.com, Jerin Jacob , Thomas Monjalon , Ferruh Yigit , Stephen Hemminger , Bruce Richardson , Ori Kam , Slava Ovsiienko , andrey.vesnovaty@gmail.com, Ray Kinsella , Neil Horman , Samik Gupta , Andrew Rybchenko Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v5 1/2] ethdev: add flow shared action API 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Please see inline.. On Wed, Oct 7, 2020 at 5:56 AM Andrey Vesnovaty wrote: > > This commit introduces extension of DPDK flow action API enabling > sharing of single rte_flow_action in multiple flows. The API intended for > PMDs, where multiple HW offloaded flows can reuse the same HW > essence/object representing flow action and modification of such an > essence/object affects all the rules using it. > > Motivation and example > === > Adding or removing one or more queues to RSS used by multiple flow rules > imposes per rule toll for current DPDK flow API; the scenario requires > for each flow sharing cloned RSS action: > - call `rte_flow_destroy()` > - call `rte_flow_create()` with modified RSS action > [snip] > Shared action create/use/destroy > === > Shared action may be reused by some or none flow rules at any given > moment, i.e. shared action reside outside of the context of any flow. s/reside/resides [snip] > testpmd > === > In order to utilize introduced API testpmd cli may implement following > extension > create/update/destroy/query shared action accordingly > > flow shared_action (port) create {action_id (id)} (action) / end Same comment as in testpmd patch. Please add the ability to specify and parse direction. > flow shared_action (port) update (id) (action) / end > flow shared_action (port) destroy action_id (id) {action_id (id) [...]} > flow shared_action (port) query (id) > > testpmd example > === > > configure rss to queues 1 & 2 > > > flow shared_action 0 create action_id 100 rss queues 1 2 end / end > > create flow rule utilizing shared action > > > flow create 0 ingress \ > pattern eth dst is 0c:42:a1:15:fd:ac / ipv6 / tcp / end \ > actions shared 100 / end > > add 2 more queues > > > flow shared_action 0 modify 100 rss queues 1 2 3 4 end / end > > example > === > > struct rte_flow_action actions[2]; > struct rte_flow_action action; > /* skipped: initialize action */ > struct rte_flow_shared_action *handle = rte_flow_shared_action_create( > port_id, &action, &error); > actions[0].type = RTE_FLOW_ACTION_TYPE_SHARED; > actions[0].conf = handle; direction? > actions[1].type = RTE_FLOW_ACTION_TYPE_END; > /* skipped: init attr0 & pattern0 args */ [snip] > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index da8bfa5489..383d516fbd 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -1714,7 +1714,8 @@ enum rte_flow_action_type { > /** > * Enables counters for this flow rule. > * > - * These counters can be retrieved and reset through rte_flow_query(), > + * These counters can be retrieved and reset through rte_flow_query() or > + * rte_flow_shared_action_query() if the action provided via handle, > * see struct rte_flow_query_count. > * > * See struct rte_flow_action_count. > @@ -2132,6 +2133,14 @@ enum rte_flow_action_type { > * see enum RTE_ETH_EVENT_FLOW_AGED > */ > RTE_FLOW_ACTION_TYPE_AGE, > + > + /** > + * Describe action shared a cross multiple flow rules. s/a cross/across > + * > + * Allow multiple rules reference the same action by handle (see > + * struct rte_flow_shared_action). > + */ > + RTE_FLOW_ACTION_TYPE_SHARED, > }; > > /** > @@ -2693,6 +2702,20 @@ struct rte_flow_action_set_dscp { > uint8_t dscp; > }; > > + > +/** > + * RTE_FLOW_ACTION_TYPE_SHARED > + * > + * Opaque type returned after successfully creating a shared action. > + * > + * This handle can be used to manage and query the related action: > + * - share it a cross multiple flow rules s/a cross/across > + * - update action configuration > + * - query action data > + * - destroy action > + */ > +struct rte_flow_shared_action; > + > /* Mbuf dynamic field offset for metadata. */ > extern int32_t rte_flow_dynf_metadata_offs; > > @@ -3357,6 +3380,144 @@ int > rte_flow_get_aged_flows(uint16_t port_id, void **contexts, > uint32_t nb_contexts, struct rte_flow_error *error); > > +/** > + * Specify shared action configuration > + */ > +struct rte_flow_shared_action_conf { > + uint32_t ingress:1; > + /**< Action valid for rules applied to ingress traffic. */ > + uint32_t egress:1; > + /**< Action valid for rules applied to egress traffic. */ Add a note to indicate only one of these shall be set. > +}; > + > +/** > + * @warning > + * @b EXPERIMENTAL: this API may change without prior notice. > + * [snip]