List patch comments

GET /api/patches/73560/comments/?format=api&order=-id
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Link: 
<https://patches.dpdk.org/api/patches/73560/comments/?format=api&order=-id&page=1>; rel="first",
<https://patches.dpdk.org/api/patches/73560/comments/?format=api&order=-id&page=1>; rel="last"
Vary: Accept
[ { "id": 115621, "web_url": "https://patches.dpdk.org/comment/115621/", "msgid": "<2804239.ReDC0b4mlx@thomas>", "list_archive_url": "https://inbox.dpdk.org/dev/2804239.ReDC0b4mlx@thomas", "date": "2020-07-09T12:39:19", "subject": "Re: [dpdk-dev] [PATCH v2 6/6] examples/flow_filtering: utilize\n\tshared RSS action", "submitter": { "id": 685, "url": "https://patches.dpdk.org/api/people/685/?format=api", "name": "Thomas Monjalon", "email": "thomas@monjalon.net" }, "content": "09/07/2020 14:25, Andrey Vesnovaty:\n> Hi, Jerin and Ferruh\n> \n> First of all it's decided to postpone this effort to 20.11.\n> @jerinj@marvell.com I sincerely believe we can work out great API for\n> - shared action, context\n> - action update / modification / replacement\n> after 20.08 without time pressure & stress.\n> \n> I'm fully committed and will continue to work on this PATCH.\n> I'll resend improved version of this patch once 20.08 is out & we will\n> continue our discussion from here to make it even better.\n\nI don't think you should wait 20.08 (one month) to progress.\nIdeally, it should be ready to be merged in the first day of 20.11 cycle.\n\nPlease add the feature in the release notes (even in 20.08 one\nin the meantime).", "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 63579A0528;\n\tThu, 9 Jul 2020 14:39:24 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 41FE51E8A4;\n\tThu, 9 Jul 2020 14:39:24 +0200 (CEST)", "from new4-smtp.messagingengine.com (new4-smtp.messagingengine.com\n [66.111.4.230]) by dpdk.org (Postfix) with ESMTP id 7B5221E8A1\n for <dev@dpdk.org>; Thu, 9 Jul 2020 14:39:23 +0200 (CEST)", "from compute7.internal (compute7.nyi.internal [10.202.2.47])\n by mailnew.nyi.internal (Postfix) with ESMTP id D7FB558042E;\n Thu, 9 Jul 2020 08:39:22 -0400 (EDT)", "from mailfrontend1 ([10.202.2.162])\n by compute7.internal (MEProxy); Thu, 09 Jul 2020 08:39:22 -0400", "from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184])\n by mail.messagingengine.com (Postfix) with ESMTPA id 6314D3280060;\n Thu, 9 Jul 2020 08:39:20 -0400 (EDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=\n from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding:content-type; s=fm1; bh=\n oDBLcNXydIWQzGX2B/E/L363AnsIghne6CF0vq6p4/I=; b=Uel79Qqo8wjs0Nh1\n ZgS4RE3eHSmZQZREXSNbbTQPavQKp+3ixPDdCriZA9aEsl65XNPJ19JLcryPeMO0\n yHe6Zpf5XWqKGUHaBzL+5zKpCmd7T29a4EbRQfKE99IxEHLujv+PFGp/HuhX9fTj\n g697NOlj8cJcrctsVYsIFYh4LJjx47Itm0MwpcKrlh3cs9tIvoM/X/UJ6dWk5YYJ\n q3UdOiaa4Jgohv8C3bzjV1DrR79CUhTVaNYGMhf0+pTp8WO8n/NJ9frUWxWnbzcc\n eMM3gU5vHpzwhtZmUlDjaUaloLC9W/3EH1vvVH1pMz07Cshe8F/XcfhK03iYujcV\n b+n/Vg==", "v=1; a=rsa-sha256; c=relaxed/relaxed; d=\n messagingengine.com; h=cc:content-transfer-encoding:content-type\n :date:from:in-reply-to:message-id:mime-version:references\n :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender\n :x-sasl-enc; s=fm3; bh=oDBLcNXydIWQzGX2B/E/L363AnsIghne6CF0vq6p4\n /I=; b=HZyJ/heynDMExcXkRMZ4u336CXb3tEB5ZdGTWYnhGRCwDhLD7Ly5dCLuc\n CiLynMMKuhLWoxEeDa5hBaPDyS9UQvR8Y8CwGpAdGWNT+4OV6sjpXNoMcl38hrql\n r1YNvCmMvO2wQjl4QiUjgJCb5TI4PSFWvpf9wo9XNPj3ltYNgCF/Le9KbBYSokc8\n QAaLcFNm8M5O2DsRXzZeQ1x+8Sh4JQ9Y2xbBrP/2CSC9+RGfgt9fAEtMbD0DtIfm\n BVOSMdvxodMhO0EIQYh8W8PUwCu+U4jUL9dtZHIYcPDy2UF8maSalp8tiAYbZVA1\n QRXGMdTxyYZSjlq9q3z5R+H1HeihA==" ], "X-ME-Sender": "<xms:-g8HXztq0-fUaw_LTrJTVfqiyzAJg00FC6697Mh57DUifC8zwLgV2w>", "X-ME-Proxy-Cause": "\n gggruggvucftvghtrhhoucdtuddrgeduiedrudelgdehhecutefuodetggdotefrodftvf\n curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu\n uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc\n fjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghs\n ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf\n frrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdejueei\n iedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih\n iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho\n nhdrnhgvth", "X-ME-Proxy": "<xmx:-g8HX0dZzwbEVWmg9rSm5P2O2Op-dFOwcK9vyulCk9nFTYYbEjaY7w>\n <xmx:-g8HX2wlUwf6OmJlyXnd-ZM3Dh9oMzYS7wWjQI78IdDaurS-yuw7BQ>\n <xmx:-g8HXyNjeT7aiTmXRbJ3FwBn64XSS-A_Yxkk1ZGMXXjkknLoIgoErA>\n <xmx:-g8HX5cM7Mu-OIyK0E4HBho_G-0I-xcnhw3lrWPdsT3P8rufOJwLQA>", "From": "Thomas Monjalon <thomas@monjalon.net>", "To": "Andrey Vesnovaty <andreyv@mellanox.com>", "Cc": "Ori Kam <orika@mellanox.com>, \"jerinj@marvell.com\" <jerinj@marvell.com>,\n Ferruh Yigit <ferruh.yigit@intel.com>, dev@dpdk.org,\n \"jer@marvell.com\" <jer@marvell.com>, Ferruh Yigit <ferruh.yigit@intel.com>,\n Stephen Hemminger <stephen@networkplumber.org>, \"Richardson,\n Bruce\" <bruce.richardson@intel.com>,\n Slava Ovsiienko <viacheslavo@mellanox.com>,\n Andrey Vesnovaty <andrey.vesnovaty@gmail.com>,\n Marko Kovacevic <marko.kovacevic@intel.com>,\n Radu Nicolau <radu.nicolau@intel.com>, Akhil Goyal <akhil.goyal@nxp.com>,\n Tomasz Kantecki <tomasz.kantecki@intel.com>,\n Sunil Kumar Kori <skori@marvell.com>,\n Pavan Nikhilesh <pbhagavatula@marvell.com>,\n John McNamara <john.mcnamara@intel.com>", "Date": "Thu, 09 Jul 2020 14:39:19 +0200", "Message-ID": "<2804239.ReDC0b4mlx@thomas>", "In-Reply-To": "\n <AM6PR0502MB3989D3E1CEFD2E2161554749D6640@AM6PR0502MB3989.eurprd05.prod.outlook.com>", "References": "<20200702120511.16315-1-andreyv@mellanox.com>\n <AM6PR05MB5176DEEE335959314B3949F5DB640@AM6PR05MB5176.eurprd05.prod.outlook.com>\n <AM6PR0502MB3989D3E1CEFD2E2161554749D6640@AM6PR0502MB3989.eurprd05.prod.outlook.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "7Bit", "Content-Type": "text/plain; charset=\"us-ascii\"", "Subject": "Re: [dpdk-dev] [PATCH v2 6/6] examples/flow_filtering: utilize\n\tshared RSS action", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "addressed": null }, { "id": 115619, "web_url": "https://patches.dpdk.org/comment/115619/", "msgid": "<AM6PR0502MB3989D3E1CEFD2E2161554749D6640@AM6PR0502MB3989.eurprd05.prod.outlook.com>", "list_archive_url": "https://inbox.dpdk.org/dev/AM6PR0502MB3989D3E1CEFD2E2161554749D6640@AM6PR0502MB3989.eurprd05.prod.outlook.com", "date": "2020-07-09T12:25:23", "subject": "Re: [dpdk-dev] [PATCH v2 6/6] examples/flow_filtering: utilize\n\tshared RSS action", "submitter": { "id": 1809, "url": "https://patches.dpdk.org/api/people/1809/?format=api", "name": "Andrey Vesnovaty", "email": "andreyv@mellanox.com" }, "content": "Hi, Jerin and Ferruh\n\nFirst of all it's decided to postpone this effort to 20.11.\n@jerinj@marvell.com I sincerely believe we can work out great API for\n- shared action, context\n- action update / modification / replacement\nafter 20.08 without time pressure & stress.\n\nI'm fully committed and will continue to work on this PATCH.\nI'll resend improved version of this patch once 20.08 is out & we will\ncontinue our discussion from here to make it even better.\n\nMany thanks to all participants of this discussion,\nAndrey\n\n\n-----Original Message-----\nFrom: Ori Kam <orika@mellanox.com> \nSent: Thursday, July 9, 2020 9:09 AM\nTo: Jerin Jacob <jerinjacobk@gmail.com>; Andrey Vesnovaty <andreyv@mellanox.com>\nCc: dpdk-dev <dev@dpdk.org>; jer@marvell.com; Thomas Monjalon <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@intel.com>; Stephen Hemminger <stephen@networkplumber.org>; Richardson, Bruce <bruce.richardson@intel.com>; Slava Ovsiienko <viacheslavo@mellanox.com>; Andrey Vesnovaty <andrey.vesnovaty@gmail.com>; Marko Kovacevic <marko.kovacevic@intel.com>; Radu Nicolau <radu.nicolau@intel.com>; Akhil Goyal <akhil.goyal@nxp.com>; Tomasz Kantecki <tomasz.kantecki@intel.com>; Sunil Kumar Kori <skori@marvell.com>; Pavan Nikhilesh <pbhagavatula@marvell.com>; John McNamara <john.mcnamara@intel.com>\nSubject: RE: [PATCH v2 6/6] examples/flow_filtering: utilize shared RSS action\n\nHi Andrey,\n\n> -----Original Message-----\n> From: Jerin Jacob <jerinjacobk@gmail.com>\n> Sent: Thursday, July 9, 2020 7:44 AM\n> To: Andrey Vesnovaty <andreyv@mellanox.com>\n> Cc: dpdk-dev <dev@dpdk.org>; jer@marvell.com; Thomas Monjalon\n> <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@intel.com>; Stephen\n> Hemminger <stephen@networkplumber.org>; Richardson, Bruce\n> <bruce.richardson@intel.com>; Ori Kam <orika@mellanox.com>; Slava\n> Ovsiienko <viacheslavo@mellanox.com>; Andrey Vesnovaty\n> <andrey.vesnovaty@gmail.com>; Marko Kovacevic\n> <marko.kovacevic@intel.com>; Radu Nicolau <radu.nicolau@intel.com>; Akhil\n> Goyal <akhil.goyal@nxp.com>; Tomasz Kantecki <tomasz.kantecki@intel.com>;\n> Sunil Kumar Kori <skori@marvell.com>; Pavan Nikhilesh\n> <pbhagavatula@marvell.com>; John McNamara <john.mcnamara@intel.com>\n> Subject: Re: [PATCH v2 6/6] examples/flow_filtering: utilize shared RSS action\n> \n> On Thu, Jul 9, 2020 at 3:09 AM Andrey Vesnovaty <andreyv@mellanox.com>\n> wrote:\n> >\n> > This commit gives very first shared RSS action usage example and\n> > demonstrates shared action capability for in-place update.\n> >\n> > First application creates shared action during initialization phase.\n> \n> What if PMD does not support a shared context, Then this application\n> fails to run?\n> if so, have a mode or probe the capability(if capability present then\n> switches to new mode else fall back to old mode) before changing the\n> application behavior.\n> \n+1 the new action should be added as a new case and should run only if it is \nthe shared action is supported.\n\n> \n> > Later on the flow object created by application uses previously created\n> > shared RSS action with 1 queue configured instead of queue action in\n> > original application.\n> >\n> > On each RX queue burst shared RSS action reconfigured via\n> > rte_flow_shared_action_update() API to switch queue 0 to 1 & 1 to 0.\n> > User supposed to observe consistent queue switches on each packet burst.\n> >\n> > Signed-off-by: Andrey Vesnovaty <andreyv@mellanox.com>\n> > ---\n> > doc/guides/sample_app_ug/flow_filtering.rst | 62 +++++++++++++++++----\n> > examples/flow_filtering/flow_blocks.c | 30 +++++-----\n> > examples/flow_filtering/main.c | 41 +++++++++++++-\n> > 3 files changed, 105 insertions(+), 28 deletions(-)\n> >\n> > diff --git a/doc/guides/sample_app_ug/flow_filtering.rst\n> b/doc/guides/sample_app_ug/flow_filtering.rst\n> > index 5e5a6cd8a0..cfe9334717 100644\n> > --- a/doc/guides/sample_app_ug/flow_filtering.rst\n> > +++ b/doc/guides/sample_app_ug/flow_filtering.rst\n> > @@ -106,7 +106,7 @@ following code:\n> > .. code-block:: c\n> >\n> > /* create flow for send packet with */\n> > - flow = generate_ipv4_flow(port_id, selected_queue,\n> > + flow = generate_ipv4_flow(port_id, shared_action,\n> > SRC_IP, EMPTY_MASK,\n> > DEST_IP, FULL_MASK, &error);\n> > if (!flow) {\n> > @@ -242,7 +242,7 @@ The Ethernet port is configured with default settings\n> using the\n> > rxq_conf = dev_info.default_rxconf;\n> > rxq_conf.offloads = port_conf.rxmode.offloads;\n> >\n> > -For this example we are configuring number of rx and tx queues that are\n> connected\n> > +For this example we are configuring 2 rx and 2 tx queues that are connected\n> > to a single port.\n> >\n> > .. code-block:: c\n> > @@ -270,13 +270,22 @@ to a single port.\n> > }\n> > }\n> >\n> > +Before we create the flow we create shared action in order to send it as\n> > +actions argument when creating a flow. The action is single queue RSS\n> action\n> > +similar to action queue with the only difference that shared RSS action\n> > +provides update capability after action creation.\n> > +\n> > +.. code-block:: c\n> > +\n> > + shared_action = rte_flow_shared_action_create(port_id, &action, &error);\n> > +\n> > In the next step we create and apply the flow rule. which is to send packets\n> > with destination ip equals to 192.168.1.1 to queue number 1. The detail\n> > explanation of the ``generate_ipv4_flow()`` appears later in this document:\n> >\n> > .. code-block:: c\n> >\n> > - flow = generate_ipv4_flow(port_id, selected_queue,\n> > + flow = generate_ipv4_flow(port_id, shared_action,\n> > SRC_IP, EMPTY_MASK,\n> > DEST_IP, FULL_MASK, &error);\n> >\n> > @@ -339,6 +348,21 @@ looks like the following:\n> > printf(\"\\n\");\n> > rte_pktmbuf_free(m);\n> > }\n> > + if (rss_queue[0] == 0) {\n> > + printf(\">>> switching queue 0 -> 1\\n\");\n> > + rss_queue[0] = 1;\n> > + } else {\n> > + printf(\">>> switching queue 1 -> 0\\n\");\n> > + rss_queue[0] = 0;\n> > + }\n> > + ret = rte_flow_shared_action_update\n> > + (port_id, shared_action, &action,\n> > + &error);\n> > + if (ret)\n> > + rte_exit(EXIT_FAILURE,\n> > + \":: error: RSS action update \"\n> > + \"failed: %s\\n\",\n> > + rte_strerror(-ret));\n> > }\n> > }\n> > }\n> > @@ -348,6 +372,8 @@ looks like the following:\n> > rte_eth_dev_close(port_id);\n> > }\n> >\n> > +On each loop eteration Rx queue switched using\n> > +``rte_flow_shared_action_update()`` API.\n> > The main work of the application is reading the packets from all\n> > queues and printing for each packet the destination queue:\n> >\n> > @@ -365,6 +391,21 @@ queues and printing for each packet the destination\n> queue:\n> > printf(\" - queue=0x%x\", (unsigned int)i);\n> > printf(\"\\n\");\n> > rte_pktmbuf_free(m);\n> > + if (rss_queue[0] == 0) {\n> > + printf(\">>> switching queue 0 -> 1\\n\");\n> > + rss_queue[0] = 1;\n> > + } else {\n> > + printf(\">>> switching queue 1 -> 0\\n\");\n> > + rss_queue[0] = 0;\n> > + }\n> > + ret = rte_flow_shared_action_update\n> > + (port_id, shared_action, &action,\n> > + &error);\n> > + if (ret)\n> > + rte_exit(EXIT_FAILURE,\n> > + \":: error: RSS action update \"\n> > + \"failed: %s\\n\",\n> > + rte_strerror(-ret));\n> > }\n> > }\n> > }\n> > @@ -378,13 +419,15 @@ The forwarding loop can be interrupted and the\n> application closed using\n> > The generate_ipv4_flow function\n> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n> >\n> > +\n> > The generate_ipv4_flow function is responsible for creating the flow rule.\n> > This function is located in the ``flow_blocks.c`` file.\n> >\n> > .. code-block:: c\n> >\n> > static struct rte_flow *\n> > - generate_ipv4_flow(uint8_t port_id, uint16_t rx_q,\n> > + generate_ipv4_flow(uint8_t port_id,\n> > + cstructrte_flow_shared_action *shared_action,\n> > uint32_t src_ip, uint32_t src_mask,\n> > uint32_t dest_ip, uint32_t dest_mask,\n> > struct rte_flow_error *error)\n> > @@ -393,7 +436,6 @@ This function is located in the ``flow_blocks.c`` file.\n> > struct rte_flow_item pattern[MAX_PATTERN_NUM];\n> > struct rte_flow_action action[MAX_ACTION_NUM];\n> > struct rte_flow *flow = NULL;\n> > - struct rte_flow_action_queue queue = { .index = rx_q };\n> > struct rte_flow_item_ipv4 ip_spec;\n> > struct rte_flow_item_ipv4 ip_mask;\n> >\n> > @@ -411,8 +453,8 @@ This function is located in the ``flow_blocks.c`` file.\n> > * create the action sequence.\n> > * one action only, move packet to queue\n> > */\n> > - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;\n> > - action[0].conf = &queue;\n> > + action[0].type = RTE_FLOW_ACTION_TYPE_SHARED;\n> > + action[0].conf = shared_action;\n> > action[1].type = RTE_FLOW_ACTION_TYPE_END;\n> >\n> > /*\n> > @@ -468,12 +510,12 @@ The following part create the flow attributes, in\n> our case ingress.\n> > attr.ingress = 1;\n> >\n> > The third part defines the action to be taken when a packet matches\n> > -the rule. In this case send the packet to queue.\n> > +the rule. In this case send the packet to single RSS queue.\n> >\n> > .. code-block:: c\n> >\n> > - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;\n> > - action[0].conf = &queue;\n> > + action[0].type = RTE_FLOW_ACTION_TYPE_SHARED;\n> > + action[0].conf = shared_action;\n> > action[1].type = RTE_FLOW_ACTION_TYPE_END;\n> >\n> > The fourth part is responsible for creating the pattern and is built from\n> > diff --git a/examples/flow_filtering/flow_blocks.c\n> b/examples/flow_filtering/flow_blocks.c\n> > index 575d792810..99bfed3172 100644\n> > --- a/examples/flow_filtering/flow_blocks.c\n> > +++ b/examples/flow_filtering/flow_blocks.c\n> > @@ -6,11 +6,11 @@\n> > #define MAX_ACTION_NUM 2\n> >\n> > struct rte_flow *\n> > -generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> > - uint32_t src_ip, uint32_t src_mask,\n> > - uint32_t dest_ip, uint32_t dest_mask,\n> > - struct rte_flow_error *error);\n> > -\n> > +generate_ipv4_flow(uint16_t port_id,\n> > + struct rte_flow_shared_action *shared_action,\n> > + uint32_t src_ip, uint32_t src_mask,\n> > + uint32_t dest_ip, uint32_t dest_mask,\n> > + struct rte_flow_error *error);\n> >\n> > /**\n> > * create a flow rule that sends packets with matching src and dest ip\n> > @@ -18,8 +18,8 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> > *\n> > * @param port_id\n> > * The selected port.\n> > - * @param rx_q\n> > - * The selected target queue.\n> > + * @param shared_action\n> > + * The shared RSS action with single queue\n> > * @param src_ip\n> > * The src ip value to match the input packet.\n> > * @param src_mask\n> > @@ -35,16 +35,16 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> > * A flow if the rule could be created else return NULL.\n> > */\n> > struct rte_flow *\n> > -generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> > - uint32_t src_ip, uint32_t src_mask,\n> > - uint32_t dest_ip, uint32_t dest_mask,\n> > - struct rte_flow_error *error)\n> > +generate_ipv4_flow(uint16_t port_id,\n> > + struct rte_flow_shared_action *shared_action,\n> > + uint32_t src_ip, uint32_t src_mask,\n> > + uint32_t dest_ip, uint32_t dest_mask,\n> > + struct rte_flow_error *error)\n> > {\n> > struct rte_flow_attr attr;\n> > struct rte_flow_item pattern[MAX_PATTERN_NUM];\n> > struct rte_flow_action action[MAX_ACTION_NUM];\n> > struct rte_flow *flow = NULL;\n> > - struct rte_flow_action_queue queue = { .index = rx_q };\n> > struct rte_flow_item_ipv4 ip_spec;\n> > struct rte_flow_item_ipv4 ip_mask;\n> > int res;\n> > @@ -61,10 +61,10 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> >\n> > /*\n> > * create the action sequence.\n> > - * one action only, move packet to queue\n> > + * one action only, move packet to shared RSS queue\n> > */\n> > - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;\n> > - action[0].conf = &queue;\n> > + action[0].type = RTE_FLOW_ACTION_TYPE_SHARED;\n> > + action[0].conf = shared_action;\n> > action[1].type = RTE_FLOW_ACTION_TYPE_END;\n> >\n> > /*\n> > diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c\n> > index cc9e7e7808..d6b18d95fc 100644\n> > --- a/examples/flow_filtering/main.c\n> > +++ b/examples/flow_filtering/main.c\n> > @@ -32,8 +32,7 @@\n> > static volatile bool force_quit;\n> >\n> > static uint16_t port_id;\n> > -static uint16_t nr_queues = 5;\n> > -static uint8_t selected_queue = 1;\n> > +static uint16_t nr_queues = 2;\n> > struct rte_mempool *mbuf_pool;\n> > struct rte_flow *flow;\n> >\n> > @@ -42,6 +41,24 @@ struct rte_flow *flow;\n> > #define FULL_MASK 0xffffffff /* full mask */\n> > #define EMPTY_MASK 0x0 /* empty mask */\n> >\n> > +struct rte_flow_shared_action *shared_action;\n> > +uint16_t rss_queue[1] = {0};\n> > +\n> > +struct rte_flow_action_rss action_rss = {\n> > + .func = RTE_ETH_HASH_FUNCTION_DEFAULT,\n> > + .level = 0,\n> > + .types = 0,\n> > + .key_len = 0,\n> > + .key = NULL,\n> > + .queue = rss_queue,\n> > + .queue_num = 1,\n> > +};\n> > +\n> > +struct rte_flow_action action = {\n> > + .type = RTE_FLOW_ACTION_TYPE_RSS,\n> > + .conf = &action_rss,\n> > +};\n> > +\n> > #include \"flow_blocks.c\"\n> >\n> > static inline void\n> > @@ -61,6 +78,7 @@ main_loop(void)\n> > uint16_t nb_rx;\n> > uint16_t i;\n> > uint16_t j;\n> > + int ret;\n> >\n> > while (!force_quit) {\n> > for (i = 0; i < nr_queues; i++) {\n> > @@ -82,6 +100,21 @@ main_loop(void)\n> >\n> > rte_pktmbuf_free(m);\n> > }\n> > + if (rss_queue[0] == 0) {\n> > + printf(\">>> switching queue 0 -> 1\\n\");\n> > + rss_queue[0] = 1;\n> > + } else {\n> > + printf(\">>> switching queue 1 -> 0\\n\");\n> > + rss_queue[0] = 0;\n> > + }\n> > + ret = rte_flow_shared_action_update\n> > + (port_id, shared_action, &action,\n> > + &error);\n> > + if (ret)\n> > + rte_exit(EXIT_FAILURE,\n> > + \":: error: RSS action update \"\n> > + \"failed: %s\\n\",\n> > + rte_strerror(-ret));\n> > }\n> > }\n> > }\n> > @@ -243,8 +276,10 @@ main(int argc, char **argv)\n> >\n> > init_port();\n> >\n> > + shared_action = rte_flow_shared_action_create(port_id, &action,\n> &error);\n> > +\n> > /* create flow for send packet with */\n> > - flow = generate_ipv4_flow(port_id, selected_queue,\n> > + flow = generate_ipv4_flow(port_id, shared_action,\n> > SRC_IP, EMPTY_MASK,\n> > DEST_IP, FULL_MASK, &error);\n> > if (!flow) {\n> > --\n> > 2.26.2\n> >", "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 8ABC0A0528;\n\tThu, 9 Jul 2020 14:25:27 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 66B701E87B;\n\tThu, 9 Jul 2020 14:25:26 +0200 (CEST)", "from EUR04-DB3-obe.outbound.protection.outlook.com\n (mail-eopbgr60064.outbound.protection.outlook.com [40.107.6.64])\n by dpdk.org (Postfix) with ESMTP id 0386A1E877\n for <dev@dpdk.org>; Thu, 9 Jul 2020 14:25:25 +0200 (CEST)", "from AM6PR0502MB3989.eurprd05.prod.outlook.com\n (2603:10a6:209:23::10) by AM7PR05MB6806.eurprd05.prod.outlook.com\n (2603:10a6:20b:140::19) with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Thu, 9 Jul\n 2020 12:25:23 +0000", "from AM6PR0502MB3989.eurprd05.prod.outlook.com\n ([fe80::7402:f0d8:dcf8:d0ef]) by AM6PR0502MB3989.eurprd05.prod.outlook.com\n ([fe80::7402:f0d8:dcf8:d0ef%6]) with mapi id 15.20.3153.031; Thu, 9 Jul 2020\n 12:25:23 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=WLSLL0DmuYFupjMNqsig8MLOjtDYIdUiK6tsBsRTtEqncfObH90DInvRpJkQusEjjVDUPysW/OxO8KTbsfO5bPgMTGXTzTuFDTPEfh8iCYoEKjSEqRwntLcLadtmRk/7n6Lh1yZxYSbMJz54bbsRLwHqTVtFhlN7oZ5aHXgbkk9OMV7FOQLGkhyBNRoZLvae5kMISV5Z4NL1V3d/JyZVIdKI8ZeqnqOXw99J8888Xr0gD2pD47RwnomFyVD+nO+5kRSHXOr0oVrDuT4eMMF/tODSlSC81NxAPAHvZyDv63Kw4SkLNDcAZMNqIVZOFe4RDEuXSRjyCo+5Ms9vpCNT6A==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=nh7BV7eiogNgPi/cwVm0YZW7Nab1rWfYHXtkwqX+Kjs=;\n b=W8vHf52CFJ5gwX+rZ8N9gKwEoj4IipX2rlbrpTdwIT4qYbJCWoEkntoywfZADLbOHnbP//I6YsDcYDjLFLaCkpyqd5WBuXPKRJ2DJzo49szTk00LTeXmR2VX1LyxufRYOPzTf4CixcoG/L9cOuhtAZNNiW+ql2ED09vDuvZiaMCwuTevSjUIZNVCSjIQ3utf4hF5eQ7vspu+5mz2tKKPm1RhfJSRcUI7+x1h21VHKByFiMQhKoCW4LjIrzaGAeCO8C0spbGU4hsCEua04wwZs+cTVzATVFvTe+7nEuzTSVFHRhGkcpYY4NsYIzj0+yNZTK4awntsbFcqZn0k0/aqBA==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com;\n dkim=pass header.d=mellanox.com; arc=none", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=nh7BV7eiogNgPi/cwVm0YZW7Nab1rWfYHXtkwqX+Kjs=;\n b=bwGOjm98c8gyHb3ilp1ORa/0W5RqG5gx+a1saY7cMZifpHRSoNgbl7w/chqzRpTmcF+jgaCFRtTL27+CmQi9rFKG/WLHUa//w4Z25CYDGxTLi0RUe60pjpSYI7SggTa9cwe8cu49YT2MhO7go4et9ZFi6BFbfFlsHRVKocQavSQ=", "From": "Andrey Vesnovaty <andreyv@mellanox.com>", "To": "Ori Kam <orika@mellanox.com>, \"jerinj@marvell.com\" <jerinj@marvell.com>,\n Ferruh Yigit <ferruh.yigit@intel.com>", "CC": "dpdk-dev <dev@dpdk.org>, \"jer@marvell.com\" <jer@marvell.com>, Thomas\n Monjalon <thomas@monjalon.net>, Ferruh Yigit <ferruh.yigit@intel.com>,\n Stephen Hemminger <stephen@networkplumber.org>, \"Richardson, Bruce\"\n <bruce.richardson@intel.com>, Slava Ovsiienko <viacheslavo@mellanox.com>,\n Andrey Vesnovaty <andrey.vesnovaty@gmail.com>, Marko Kovacevic\n <marko.kovacevic@intel.com>, Radu Nicolau <radu.nicolau@intel.com>, Akhil\n Goyal <akhil.goyal@nxp.com>, Tomasz Kantecki <tomasz.kantecki@intel.com>,\n Sunil Kumar Kori <skori@marvell.com>, Pavan Nikhilesh\n <pbhagavatula@marvell.com>, John McNamara <john.mcnamara@intel.com>", "Thread-Topic": "[PATCH v2 6/6] examples/flow_filtering: utilize shared RSS\n action", "Thread-Index": "AQHWVaudLC9kqaSKb0SgGSNO2kd9wqj+w2aAgABj/5A=", "Date": "Thu, 9 Jul 2020 12:25:23 +0000", "Message-ID": "\n <AM6PR0502MB3989D3E1CEFD2E2161554749D6640@AM6PR0502MB3989.eurprd05.prod.outlook.com>", "References": "<20200702120511.16315-1-andreyv@mellanox.com>\n <20200708213946.30108-1-andreyv@mellanox.com>\n <20200708213946.30108-7-andreyv@mellanox.com>\n <CALBAE1NQHPheit9ZN9-bC69nmkwTxAwjRWHL9ZnXi=dTKH8Z3w@mail.gmail.com>\n <AM6PR05MB5176DEEE335959314B3949F5DB640@AM6PR05MB5176.eurprd05.prod.outlook.com>", "In-Reply-To": "\n <AM6PR05MB5176DEEE335959314B3949F5DB640@AM6PR05MB5176.eurprd05.prod.outlook.com>", "Accept-Language": "en-US", "Content-Language": "en-US", "X-MS-Has-Attach": "", "X-MS-TNEF-Correlator": "", "authentication-results": "mellanox.com; dkim=none (message not signed)\n header.d=none;mellanox.com; dmarc=none action=none header.from=mellanox.com;", "x-originating-ip": "[79.176.79.26]", "x-ms-publictraffictype": "Email", "x-ms-office365-filtering-ht": "Tenant", "x-ms-office365-filtering-correlation-id": "928a12f2-b538-4265-7c44-08d82403272a", "x-ms-traffictypediagnostic": "AM7PR05MB6806:", "x-ld-processed": "a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr", "x-ms-exchange-transport-forked": "True", "x-microsoft-antispam-prvs": "\n <AM7PR05MB68063CD93698A76010F27D74D6640@AM7PR05MB6806.eurprd05.prod.outlook.com>", "x-ms-oob-tlc-oobclassifiers": "OLM:106;", "x-ms-exchange-senderadcheck": "1", "x-microsoft-antispam": "BCL:0;", "x-microsoft-antispam-message-info": "\n YRneFVl9VWPGetGt0QT/B6EtamOc/HZW8jQCLuOYkWb6M3oPmoaC9fA9qsym3YtBKXzDObhRiGMd8dLLBWvALosKpAlH037uWEhm1/V3ZJAWlZFPgYjEg3AiqHx+Vo4K1xHw6EBF5DJm8eMbBTJU96Dk+nTscgi27OFTB1le+cxOxMSk/o23tT7UDAX7bzfJzs2cCZRRaCXfg62gGU3+qesG3/Y7ItY9RFkFlZtJy7fCd0ju6DfTIWQkjDZK2RQCN8KqIkjkyviImkAMU8H3O12EDKfMAnzz/jFINqlLHJjAQo1DnqUNrMLTEGVoBPBu+CEP8qgoGvoDjrFjcqyfew==", "x-forefront-antispam-report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:AM6PR0502MB3989.eurprd05.prod.outlook.com; PTR:;\n CAT:NONE;\n SFTY:;\n SFS:(4636009)(136003)(366004)(39860400002)(376002)(346002)(396003)(5660300002)(83380400001)(66946007)(478600001)(66476007)(7696005)(26005)(66556008)(66446008)(64756008)(76116006)(2906002)(8936002)(186003)(71200400001)(54906003)(86362001)(33656002)(9686003)(30864003)(53546011)(55016002)(4326008)(7416002)(6506007)(110136005)(316002)(52536014)(8676002);\n DIR:OUT; SFP:1101;", "x-ms-exchange-antispam-messagedata": "\n j77NK3fsAgUuIKo6tKVZzcNbWyelSuqseWYf4mgYvjY5WwJAbq7DKVu1lRV0d7V3JY/Tp6ehLlMg1RFubqgWyz0trBGGstKMGCeWTOy1vWVW+C0l9SEWfX2Vf2RXOnsqJXg/W2F8iwJ+zNKN3WaDBqNCBTSipb6fGLlT4IMfa3LaSKgFSCRliJGxeH1H7cLsE/MKTKCzNhFNU6gPt89vGmOyduyLCDhJoYpZgCBWBLG2Jln5gAHmQUsWoLGF8DCXr6puBr2Wk5GxG2phOlkY0DdIGRUu8qi1PSwnwxD8xBEkPrG1By5uBA6+HuIc9PKUs4g89/SYiC2glE0mYd+X6eCBS/ERE8ySMhUt6xp+xmmUVArMI/ijfuBShAbYA1H9xVxqQkR4LaU39RUwioBQe7SjnLXQm2LNp+uH2odIY4wLM2CR4/87St7fc4DIhB3BnqMRgTNPAjXhogaJ/XFo0keJ1ica3P86IxBai30h2Q8=", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "MIME-Version": "1.0", "X-OriginatorOrg": "Mellanox.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-AuthSource": "\n AM6PR0502MB3989.eurprd05.prod.outlook.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 928a12f2-b538-4265-7c44-08d82403272a", "X-MS-Exchange-CrossTenant-originalarrivaltime": "09 Jul 2020 12:25:23.1933 (UTC)", "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted", "X-MS-Exchange-CrossTenant-id": "a652971c-7d2e-4d9b-a6a4-d149256f461b", "X-MS-Exchange-CrossTenant-mailboxtype": "HOSTED", "X-MS-Exchange-CrossTenant-userprincipalname": "\n eIOnHZdFj5ucNxwId6x9JqOJShDgxn1U5hW4qVhdj0ntV0pntitNQ5oM4vfOgeGQe7Q8Y/omQc9jy73tRonEiA==", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM7PR05MB6806", "Subject": "Re: [dpdk-dev] [PATCH v2 6/6] examples/flow_filtering: utilize\n\tshared RSS action", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "addressed": null }, { "id": 115587, "web_url": "https://patches.dpdk.org/comment/115587/", "msgid": "<AM6PR05MB5176DEEE335959314B3949F5DB640@AM6PR05MB5176.eurprd05.prod.outlook.com>", "list_archive_url": "https://inbox.dpdk.org/dev/AM6PR05MB5176DEEE335959314B3949F5DB640@AM6PR05MB5176.eurprd05.prod.outlook.com", "date": "2020-07-09T06:08:31", "subject": "Re: [dpdk-dev] [PATCH v2 6/6] examples/flow_filtering: utilize\n\tshared RSS action", "submitter": { "id": 795, "url": "https://patches.dpdk.org/api/people/795/?format=api", "name": "Ori Kam", "email": "orika@mellanox.com" }, "content": "Hi Andrey,\n\n> -----Original Message-----\n> From: Jerin Jacob <jerinjacobk@gmail.com>\n> Sent: Thursday, July 9, 2020 7:44 AM\n> To: Andrey Vesnovaty <andreyv@mellanox.com>\n> Cc: dpdk-dev <dev@dpdk.org>; jer@marvell.com; Thomas Monjalon\n> <thomas@monjalon.net>; Ferruh Yigit <ferruh.yigit@intel.com>; Stephen\n> Hemminger <stephen@networkplumber.org>; Richardson, Bruce\n> <bruce.richardson@intel.com>; Ori Kam <orika@mellanox.com>; Slava\n> Ovsiienko <viacheslavo@mellanox.com>; Andrey Vesnovaty\n> <andrey.vesnovaty@gmail.com>; Marko Kovacevic\n> <marko.kovacevic@intel.com>; Radu Nicolau <radu.nicolau@intel.com>; Akhil\n> Goyal <akhil.goyal@nxp.com>; Tomasz Kantecki <tomasz.kantecki@intel.com>;\n> Sunil Kumar Kori <skori@marvell.com>; Pavan Nikhilesh\n> <pbhagavatula@marvell.com>; John McNamara <john.mcnamara@intel.com>\n> Subject: Re: [PATCH v2 6/6] examples/flow_filtering: utilize shared RSS action\n> \n> On Thu, Jul 9, 2020 at 3:09 AM Andrey Vesnovaty <andreyv@mellanox.com>\n> wrote:\n> >\n> > This commit gives very first shared RSS action usage example and\n> > demonstrates shared action capability for in-place update.\n> >\n> > First application creates shared action during initialization phase.\n> \n> What if PMD does not support a shared context, Then this application\n> fails to run?\n> if so, have a mode or probe the capability(if capability present then\n> switches to new mode else fall back to old mode) before changing the\n> application behavior.\n> \n+1 the new action should be added as a new case and should run only if it is \nthe shared action is supported.\n\n> \n> > Later on the flow object created by application uses previously created\n> > shared RSS action with 1 queue configured instead of queue action in\n> > original application.\n> >\n> > On each RX queue burst shared RSS action reconfigured via\n> > rte_flow_shared_action_update() API to switch queue 0 to 1 & 1 to 0.\n> > User supposed to observe consistent queue switches on each packet burst.\n> >\n> > Signed-off-by: Andrey Vesnovaty <andreyv@mellanox.com>\n> > ---\n> > doc/guides/sample_app_ug/flow_filtering.rst | 62 +++++++++++++++++----\n> > examples/flow_filtering/flow_blocks.c | 30 +++++-----\n> > examples/flow_filtering/main.c | 41 +++++++++++++-\n> > 3 files changed, 105 insertions(+), 28 deletions(-)\n> >\n> > diff --git a/doc/guides/sample_app_ug/flow_filtering.rst\n> b/doc/guides/sample_app_ug/flow_filtering.rst\n> > index 5e5a6cd8a0..cfe9334717 100644\n> > --- a/doc/guides/sample_app_ug/flow_filtering.rst\n> > +++ b/doc/guides/sample_app_ug/flow_filtering.rst\n> > @@ -106,7 +106,7 @@ following code:\n> > .. code-block:: c\n> >\n> > /* create flow for send packet with */\n> > - flow = generate_ipv4_flow(port_id, selected_queue,\n> > + flow = generate_ipv4_flow(port_id, shared_action,\n> > SRC_IP, EMPTY_MASK,\n> > DEST_IP, FULL_MASK, &error);\n> > if (!flow) {\n> > @@ -242,7 +242,7 @@ The Ethernet port is configured with default settings\n> using the\n> > rxq_conf = dev_info.default_rxconf;\n> > rxq_conf.offloads = port_conf.rxmode.offloads;\n> >\n> > -For this example we are configuring number of rx and tx queues that are\n> connected\n> > +For this example we are configuring 2 rx and 2 tx queues that are connected\n> > to a single port.\n> >\n> > .. code-block:: c\n> > @@ -270,13 +270,22 @@ to a single port.\n> > }\n> > }\n> >\n> > +Before we create the flow we create shared action in order to send it as\n> > +actions argument when creating a flow. The action is single queue RSS\n> action\n> > +similar to action queue with the only difference that shared RSS action\n> > +provides update capability after action creation.\n> > +\n> > +.. code-block:: c\n> > +\n> > + shared_action = rte_flow_shared_action_create(port_id, &action, &error);\n> > +\n> > In the next step we create and apply the flow rule. which is to send packets\n> > with destination ip equals to 192.168.1.1 to queue number 1. The detail\n> > explanation of the ``generate_ipv4_flow()`` appears later in this document:\n> >\n> > .. code-block:: c\n> >\n> > - flow = generate_ipv4_flow(port_id, selected_queue,\n> > + flow = generate_ipv4_flow(port_id, shared_action,\n> > SRC_IP, EMPTY_MASK,\n> > DEST_IP, FULL_MASK, &error);\n> >\n> > @@ -339,6 +348,21 @@ looks like the following:\n> > printf(\"\\n\");\n> > rte_pktmbuf_free(m);\n> > }\n> > + if (rss_queue[0] == 0) {\n> > + printf(\">>> switching queue 0 -> 1\\n\");\n> > + rss_queue[0] = 1;\n> > + } else {\n> > + printf(\">>> switching queue 1 -> 0\\n\");\n> > + rss_queue[0] = 0;\n> > + }\n> > + ret = rte_flow_shared_action_update\n> > + (port_id, shared_action, &action,\n> > + &error);\n> > + if (ret)\n> > + rte_exit(EXIT_FAILURE,\n> > + \":: error: RSS action update \"\n> > + \"failed: %s\\n\",\n> > + rte_strerror(-ret));\n> > }\n> > }\n> > }\n> > @@ -348,6 +372,8 @@ looks like the following:\n> > rte_eth_dev_close(port_id);\n> > }\n> >\n> > +On each loop eteration Rx queue switched using\n> > +``rte_flow_shared_action_update()`` API.\n> > The main work of the application is reading the packets from all\n> > queues and printing for each packet the destination queue:\n> >\n> > @@ -365,6 +391,21 @@ queues and printing for each packet the destination\n> queue:\n> > printf(\" - queue=0x%x\", (unsigned int)i);\n> > printf(\"\\n\");\n> > rte_pktmbuf_free(m);\n> > + if (rss_queue[0] == 0) {\n> > + printf(\">>> switching queue 0 -> 1\\n\");\n> > + rss_queue[0] = 1;\n> > + } else {\n> > + printf(\">>> switching queue 1 -> 0\\n\");\n> > + rss_queue[0] = 0;\n> > + }\n> > + ret = rte_flow_shared_action_update\n> > + (port_id, shared_action, &action,\n> > + &error);\n> > + if (ret)\n> > + rte_exit(EXIT_FAILURE,\n> > + \":: error: RSS action update \"\n> > + \"failed: %s\\n\",\n> > + rte_strerror(-ret));\n> > }\n> > }\n> > }\n> > @@ -378,13 +419,15 @@ The forwarding loop can be interrupted and the\n> application closed using\n> > The generate_ipv4_flow function\n> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n> >\n> > +\n> > The generate_ipv4_flow function is responsible for creating the flow rule.\n> > This function is located in the ``flow_blocks.c`` file.\n> >\n> > .. code-block:: c\n> >\n> > static struct rte_flow *\n> > - generate_ipv4_flow(uint8_t port_id, uint16_t rx_q,\n> > + generate_ipv4_flow(uint8_t port_id,\n> > + cstructrte_flow_shared_action *shared_action,\n> > uint32_t src_ip, uint32_t src_mask,\n> > uint32_t dest_ip, uint32_t dest_mask,\n> > struct rte_flow_error *error)\n> > @@ -393,7 +436,6 @@ This function is located in the ``flow_blocks.c`` file.\n> > struct rte_flow_item pattern[MAX_PATTERN_NUM];\n> > struct rte_flow_action action[MAX_ACTION_NUM];\n> > struct rte_flow *flow = NULL;\n> > - struct rte_flow_action_queue queue = { .index = rx_q };\n> > struct rte_flow_item_ipv4 ip_spec;\n> > struct rte_flow_item_ipv4 ip_mask;\n> >\n> > @@ -411,8 +453,8 @@ This function is located in the ``flow_blocks.c`` file.\n> > * create the action sequence.\n> > * one action only, move packet to queue\n> > */\n> > - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;\n> > - action[0].conf = &queue;\n> > + action[0].type = RTE_FLOW_ACTION_TYPE_SHARED;\n> > + action[0].conf = shared_action;\n> > action[1].type = RTE_FLOW_ACTION_TYPE_END;\n> >\n> > /*\n> > @@ -468,12 +510,12 @@ The following part create the flow attributes, in\n> our case ingress.\n> > attr.ingress = 1;\n> >\n> > The third part defines the action to be taken when a packet matches\n> > -the rule. In this case send the packet to queue.\n> > +the rule. In this case send the packet to single RSS queue.\n> >\n> > .. code-block:: c\n> >\n> > - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;\n> > - action[0].conf = &queue;\n> > + action[0].type = RTE_FLOW_ACTION_TYPE_SHARED;\n> > + action[0].conf = shared_action;\n> > action[1].type = RTE_FLOW_ACTION_TYPE_END;\n> >\n> > The fourth part is responsible for creating the pattern and is built from\n> > diff --git a/examples/flow_filtering/flow_blocks.c\n> b/examples/flow_filtering/flow_blocks.c\n> > index 575d792810..99bfed3172 100644\n> > --- a/examples/flow_filtering/flow_blocks.c\n> > +++ b/examples/flow_filtering/flow_blocks.c\n> > @@ -6,11 +6,11 @@\n> > #define MAX_ACTION_NUM 2\n> >\n> > struct rte_flow *\n> > -generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> > - uint32_t src_ip, uint32_t src_mask,\n> > - uint32_t dest_ip, uint32_t dest_mask,\n> > - struct rte_flow_error *error);\n> > -\n> > +generate_ipv4_flow(uint16_t port_id,\n> > + struct rte_flow_shared_action *shared_action,\n> > + uint32_t src_ip, uint32_t src_mask,\n> > + uint32_t dest_ip, uint32_t dest_mask,\n> > + struct rte_flow_error *error);\n> >\n> > /**\n> > * create a flow rule that sends packets with matching src and dest ip\n> > @@ -18,8 +18,8 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> > *\n> > * @param port_id\n> > * The selected port.\n> > - * @param rx_q\n> > - * The selected target queue.\n> > + * @param shared_action\n> > + * The shared RSS action with single queue\n> > * @param src_ip\n> > * The src ip value to match the input packet.\n> > * @param src_mask\n> > @@ -35,16 +35,16 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> > * A flow if the rule could be created else return NULL.\n> > */\n> > struct rte_flow *\n> > -generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> > - uint32_t src_ip, uint32_t src_mask,\n> > - uint32_t dest_ip, uint32_t dest_mask,\n> > - struct rte_flow_error *error)\n> > +generate_ipv4_flow(uint16_t port_id,\n> > + struct rte_flow_shared_action *shared_action,\n> > + uint32_t src_ip, uint32_t src_mask,\n> > + uint32_t dest_ip, uint32_t dest_mask,\n> > + struct rte_flow_error *error)\n> > {\n> > struct rte_flow_attr attr;\n> > struct rte_flow_item pattern[MAX_PATTERN_NUM];\n> > struct rte_flow_action action[MAX_ACTION_NUM];\n> > struct rte_flow *flow = NULL;\n> > - struct rte_flow_action_queue queue = { .index = rx_q };\n> > struct rte_flow_item_ipv4 ip_spec;\n> > struct rte_flow_item_ipv4 ip_mask;\n> > int res;\n> > @@ -61,10 +61,10 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> >\n> > /*\n> > * create the action sequence.\n> > - * one action only, move packet to queue\n> > + * one action only, move packet to shared RSS queue\n> > */\n> > - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;\n> > - action[0].conf = &queue;\n> > + action[0].type = RTE_FLOW_ACTION_TYPE_SHARED;\n> > + action[0].conf = shared_action;\n> > action[1].type = RTE_FLOW_ACTION_TYPE_END;\n> >\n> > /*\n> > diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c\n> > index cc9e7e7808..d6b18d95fc 100644\n> > --- a/examples/flow_filtering/main.c\n> > +++ b/examples/flow_filtering/main.c\n> > @@ -32,8 +32,7 @@\n> > static volatile bool force_quit;\n> >\n> > static uint16_t port_id;\n> > -static uint16_t nr_queues = 5;\n> > -static uint8_t selected_queue = 1;\n> > +static uint16_t nr_queues = 2;\n> > struct rte_mempool *mbuf_pool;\n> > struct rte_flow *flow;\n> >\n> > @@ -42,6 +41,24 @@ struct rte_flow *flow;\n> > #define FULL_MASK 0xffffffff /* full mask */\n> > #define EMPTY_MASK 0x0 /* empty mask */\n> >\n> > +struct rte_flow_shared_action *shared_action;\n> > +uint16_t rss_queue[1] = {0};\n> > +\n> > +struct rte_flow_action_rss action_rss = {\n> > + .func = RTE_ETH_HASH_FUNCTION_DEFAULT,\n> > + .level = 0,\n> > + .types = 0,\n> > + .key_len = 0,\n> > + .key = NULL,\n> > + .queue = rss_queue,\n> > + .queue_num = 1,\n> > +};\n> > +\n> > +struct rte_flow_action action = {\n> > + .type = RTE_FLOW_ACTION_TYPE_RSS,\n> > + .conf = &action_rss,\n> > +};\n> > +\n> > #include \"flow_blocks.c\"\n> >\n> > static inline void\n> > @@ -61,6 +78,7 @@ main_loop(void)\n> > uint16_t nb_rx;\n> > uint16_t i;\n> > uint16_t j;\n> > + int ret;\n> >\n> > while (!force_quit) {\n> > for (i = 0; i < nr_queues; i++) {\n> > @@ -82,6 +100,21 @@ main_loop(void)\n> >\n> > rte_pktmbuf_free(m);\n> > }\n> > + if (rss_queue[0] == 0) {\n> > + printf(\">>> switching queue 0 -> 1\\n\");\n> > + rss_queue[0] = 1;\n> > + } else {\n> > + printf(\">>> switching queue 1 -> 0\\n\");\n> > + rss_queue[0] = 0;\n> > + }\n> > + ret = rte_flow_shared_action_update\n> > + (port_id, shared_action, &action,\n> > + &error);\n> > + if (ret)\n> > + rte_exit(EXIT_FAILURE,\n> > + \":: error: RSS action update \"\n> > + \"failed: %s\\n\",\n> > + rte_strerror(-ret));\n> > }\n> > }\n> > }\n> > @@ -243,8 +276,10 @@ main(int argc, char **argv)\n> >\n> > init_port();\n> >\n> > + shared_action = rte_flow_shared_action_create(port_id, &action,\n> &error);\n> > +\n> > /* create flow for send packet with */\n> > - flow = generate_ipv4_flow(port_id, selected_queue,\n> > + flow = generate_ipv4_flow(port_id, shared_action,\n> > SRC_IP, EMPTY_MASK,\n> > DEST_IP, FULL_MASK, &error);\n> > if (!flow) {\n> > --\n> > 2.26.2\n> >", "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id CC746A0526;\n\tThu, 9 Jul 2020 08:08:35 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 0C1C21DA58;\n\tThu, 9 Jul 2020 08:08:35 +0200 (CEST)", "from EUR04-DB3-obe.outbound.protection.outlook.com\n (mail-eopbgr60062.outbound.protection.outlook.com [40.107.6.62])\n by dpdk.org (Postfix) with ESMTP id EF0AF1DA56\n for <dev@dpdk.org>; Thu, 9 Jul 2020 08:08:32 +0200 (CEST)", "from AM6PR05MB5176.eurprd05.prod.outlook.com (2603:10a6:20b:63::30)\n by AM6PR05MB5349.eurprd05.prod.outlook.com (2603:10a6:20b:69::21)\n with Microsoft SMTP Server (version=TLS1_2,\n cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.28; Thu, 9 Jul\n 2020 06:08:31 +0000", "from AM6PR05MB5176.eurprd05.prod.outlook.com\n ([fe80::9024:accb:4d6b:805f]) by AM6PR05MB5176.eurprd05.prod.outlook.com\n ([fe80::9024:accb:4d6b:805f%3]) with mapi id 15.20.3153.031; Thu, 9 Jul 2020\n 06:08:31 +0000" ], "ARC-Seal": "i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;\n b=i1GRE8C7spD+ZNlE08yGB2wgQyX/gFdZpOshXXB9ESL8Xi9wloiZccf31GpJfDuk09riT2qD1jk1aqX2yN3yWoyQMdQZgOFAecMNRDDYVyI/WCb92bDhZh8LywN9EcVCPs1YW6j+FQY+n80II3j+A1PazeFJ2t8LXhru6apqvEcXhmdVzWlL36ydf1mjsgnlzZIw71nJXYru5l8hcRwbxgimNbtA7R20X8LSkLZPPS8F+xVorcDbdPgelutOKpaBAQSZ/MNasLecpOzbXMq67xgZ2JR4ndX4i9xJtcsC2Vk3VhUMfhoaDat5550rXeb8gClbrkz10gGCnMI7pjEH9g==", "ARC-Message-Signature": "i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;\n s=arcselector9901;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=VKrk6VLaoHMfLVhC19d4CE/QaeSbaCGpIVIlPUAXvvI=;\n b=RQai265avMjoJ0EWfl2EJVYd+XqVAr4JI9Xc/ckKAStI2SdX5Ke/ImAVHBGKxPG0iyGWS1FeVXeXSpyUrnNWmNdTps+iC9dXMLfgN1iH0jGlqr8N2aYRj34BdSZXkPXyVympBwss45E2GQIoE1z5gG6ntmIsKStpKLDS6BEAmnr5SpUovBT7tZmKcc9e9Ua3+cAw7OiRPDPWl4eVip5P9K2TxWpszsYqNjNrrLG+rpsE1bc3vuSUt4csDKbg1tDCsArwcyz+QEHTpeLVrW+Q1ziKCrgXuUbNL8TV+LxkHhTa+ZkktcWwppE+aW/0YBJziQyOFkmIcuXc58PyIzbEIg==", "ARC-Authentication-Results": "i=1; mx.microsoft.com 1; spf=pass\n smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com;\n dkim=pass header.d=mellanox.com; arc=none", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com;\n s=selector1;\n h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n bh=VKrk6VLaoHMfLVhC19d4CE/QaeSbaCGpIVIlPUAXvvI=;\n b=RwPbrmtQkYWhyEr19/wom44KPriJOZK71GPm5FSZdTyyYuwCqklvxk/g5g8+KGm3w8X97CPpxt3tPGCPkkNOCSTpfJW6Ed9K8pn7JmG2ELw0vho+gdnVQ82u/4i8G/5XCP449wzx50jTDKIiwupot7EdvEKa+mbMMPKAdAp2/h0=", "From": "Ori Kam <orika@mellanox.com>", "To": "Jerin Jacob <jerinjacobk@gmail.com>, Andrey Vesnovaty\n <andreyv@mellanox.com>", "CC": "dpdk-dev <dev@dpdk.org>, \"jer@marvell.com\" <jer@marvell.com>, Thomas\n Monjalon <thomas@monjalon.net>, Ferruh Yigit <ferruh.yigit@intel.com>,\n Stephen Hemminger <stephen@networkplumber.org>, \"Richardson, Bruce\"\n <bruce.richardson@intel.com>, Slava Ovsiienko <viacheslavo@mellanox.com>,\n Andrey Vesnovaty <andrey.vesnovaty@gmail.com>, Marko Kovacevic\n <marko.kovacevic@intel.com>, Radu Nicolau <radu.nicolau@intel.com>, Akhil\n Goyal <akhil.goyal@nxp.com>, Tomasz Kantecki <tomasz.kantecki@intel.com>,\n Sunil Kumar Kori <skori@marvell.com>, Pavan Nikhilesh\n <pbhagavatula@marvell.com>, John McNamara <john.mcnamara@intel.com>", "Thread-Topic": "[PATCH v2 6/6] examples/flow_filtering: utilize shared RSS\n action", "Thread-Index": "AQHWVXBVlkgtWNmf5EO73WmcGbp47Kj+rECAgAAXR0A=", "Date": "Thu, 9 Jul 2020 06:08:31 +0000", "Message-ID": "\n <AM6PR05MB5176DEEE335959314B3949F5DB640@AM6PR05MB5176.eurprd05.prod.outlook.com>", "References": "<20200702120511.16315-1-andreyv@mellanox.com>\n <20200708213946.30108-1-andreyv@mellanox.com>\n <20200708213946.30108-7-andreyv@mellanox.com>\n <CALBAE1NQHPheit9ZN9-bC69nmkwTxAwjRWHL9ZnXi=dTKH8Z3w@mail.gmail.com>", "In-Reply-To": "\n <CALBAE1NQHPheit9ZN9-bC69nmkwTxAwjRWHL9ZnXi=dTKH8Z3w@mail.gmail.com>", "Accept-Language": "en-US", "Content-Language": "en-US", "X-MS-Has-Attach": "", "X-MS-TNEF-Correlator": "", "authentication-results": "gmail.com; dkim=none (message not signed)\n header.d=none;gmail.com; dmarc=none action=none header.from=mellanox.com;", "x-originating-ip": "[147.236.152.129]", "x-ms-publictraffictype": "Email", "x-ms-office365-filtering-ht": "Tenant", "x-ms-office365-filtering-correlation-id": "65d68940-f5b9-48c2-dbe0-08d823ce814d", "x-ms-traffictypediagnostic": "AM6PR05MB5349:", "x-ld-processed": "a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr", "x-ms-exchange-transport-forked": "True", "x-microsoft-antispam-prvs": "\n <AM6PR05MB5349BB41581819E8E0B222CEDB640@AM6PR05MB5349.eurprd05.prod.outlook.com>", "x-ms-oob-tlc-oobclassifiers": "OLM:99;", "x-forefront-prvs": "04599F3534", "x-ms-exchange-senderadcheck": "1", "x-microsoft-antispam": "BCL:0;", "x-microsoft-antispam-message-info": "\n QNgNUjS6YHklT09Lt8jHYwwaxaoDLVwHHQzHF3TQBwBMAuHAd6JRYzt77mjkyzcI7bxMmOyMIsIK/l4/G9goOKUgry0eFLduj5lLDICttBwBNDqT3S4dA77D5fO3tQH0iTIHJuLkP1cDpcBh3pjA8HdGq/hWcKWs6ckure6PpsWv626xbeVYdUWzcdQjWC8ro+L7hlEFOZz2NOuqxs7TcUiQ1FXOzYgQEGxDJZO+76OuoDXD/8rrMjumWYD4YZFLk52aVgMVSvRYISqQGk+4DYCG3teDD4ej330amXx1/et90c3UYa23DGp+HtLhfnnH6zJHLBufXx8TzhrBuyNhsg==", "x-forefront-antispam-report": "CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;\n IPV:NLI; SFV:NSPM; H:AM6PR05MB5176.eurprd05.prod.outlook.com; PTR:; CAT:NONE;\n SFTY:;\n SFS:(4636009)(396003)(346002)(376002)(136003)(39860400002)(366004)(33656002)(5660300002)(6636002)(4326008)(76116006)(30864003)(66946007)(64756008)(66476007)(66556008)(66446008)(2906002)(316002)(83380400001)(54906003)(7696005)(110136005)(186003)(7416002)(53546011)(86362001)(8676002)(52536014)(6506007)(26005)(55016002)(9686003)(478600001)(8936002)(71200400001);\n DIR:OUT; SFP:1101;", "x-ms-exchange-antispam-messagedata": "\n WVOsqoGfJL1y84kKMFiWPR4RPP8/8ez+7xA8fhaghF2dgqAG+CPAVaAPPSLMxYuPkBjZ/SpXMkupaewRodqBeP/uplb7jDShR5WQ6fZaKb0JKW9S7O04NaAxPhZxMzY98m+xtiyf8rHmMoGSH8ZxwjXzna2ScX0aio3CWwNMheK0aOG5N74zHsIPe16srQkM0I7F/tcdbh3rrUhgSQjxcZ50ZQ32gUi7Zeq71DjKGw3t2G+Uimul2IQdPZP5ByhMyAqM6Gktwu1u7w/JS0EuZxXo36l7WrJh8ALJhTkKk0YwDItHoIxSt9E6RZLJRfwiZyGpgT2yYJRguDgYnPUr4/LYqMcfV13W+OYb9UeTn+SOid+SqDS7484mLRwYByfjqDejJYv32oYKmggjEwg7QACdi5Hj9c159Pl2DLPCX5X7gAHqHerQHEjlUAQZQ2r7BaKJHnLqeJAlifTwfQqUAGxvChBx8aQeg7/Z40nsaRxbIPGm6HN0eGZEyS4Qna+O", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "MIME-Version": "1.0", "X-OriginatorOrg": "Mellanox.com", "X-MS-Exchange-CrossTenant-AuthAs": "Internal", "X-MS-Exchange-CrossTenant-AuthSource": "AM6PR05MB5176.eurprd05.prod.outlook.com", "X-MS-Exchange-CrossTenant-Network-Message-Id": "\n 65d68940-f5b9-48c2-dbe0-08d823ce814d", "X-MS-Exchange-CrossTenant-originalarrivaltime": "09 Jul 2020 06:08:31.0764 (UTC)", "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted", "X-MS-Exchange-CrossTenant-id": "a652971c-7d2e-4d9b-a6a4-d149256f461b", "X-MS-Exchange-CrossTenant-mailboxtype": "HOSTED", "X-MS-Exchange-CrossTenant-userprincipalname": "\n YC6R2n7hGHcrtdoVKASM8N+fldc8T0xK3yrWqsSLUglW4p7ykWeBZ9i+j+5N6tLsh/xl0dkQuJER7UEgNzM3jA==", "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "AM6PR05MB5349", "Subject": "Re: [dpdk-dev] [PATCH v2 6/6] examples/flow_filtering: utilize\n\tshared RSS action", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "addressed": null }, { "id": 115579, "web_url": "https://patches.dpdk.org/comment/115579/", "msgid": "<CALBAE1NQHPheit9ZN9-bC69nmkwTxAwjRWHL9ZnXi=dTKH8Z3w@mail.gmail.com>", "list_archive_url": "https://inbox.dpdk.org/dev/CALBAE1NQHPheit9ZN9-bC69nmkwTxAwjRWHL9ZnXi=dTKH8Z3w@mail.gmail.com", "date": "2020-07-09T04:44:01", "subject": "Re: [dpdk-dev] [PATCH v2 6/6] examples/flow_filtering: utilize\n\tshared RSS action", "submitter": { "id": 1270, "url": "https://patches.dpdk.org/api/people/1270/?format=api", "name": "Jerin Jacob", "email": "jerinjacobk@gmail.com" }, "content": "On Thu, Jul 9, 2020 at 3:09 AM Andrey Vesnovaty <andreyv@mellanox.com> wrote:\n>\n> This commit gives very first shared RSS action usage example and\n> demonstrates shared action capability for in-place update.\n>\n> First application creates shared action during initialization phase.\n\nWhat if PMD does not support a shared context, Then this application\nfails to run?\nif so, have a mode or probe the capability(if capability present then\nswitches to new mode else fall back to old mode) before changing the\napplication behavior.\n\n\n> Later on the flow object created by application uses previously created\n> shared RSS action with 1 queue configured instead of queue action in\n> original application.\n>\n> On each RX queue burst shared RSS action reconfigured via\n> rte_flow_shared_action_update() API to switch queue 0 to 1 & 1 to 0.\n> User supposed to observe consistent queue switches on each packet burst.\n>\n> Signed-off-by: Andrey Vesnovaty <andreyv@mellanox.com>\n> ---\n> doc/guides/sample_app_ug/flow_filtering.rst | 62 +++++++++++++++++----\n> examples/flow_filtering/flow_blocks.c | 30 +++++-----\n> examples/flow_filtering/main.c | 41 +++++++++++++-\n> 3 files changed, 105 insertions(+), 28 deletions(-)\n>\n> diff --git a/doc/guides/sample_app_ug/flow_filtering.rst b/doc/guides/sample_app_ug/flow_filtering.rst\n> index 5e5a6cd8a0..cfe9334717 100644\n> --- a/doc/guides/sample_app_ug/flow_filtering.rst\n> +++ b/doc/guides/sample_app_ug/flow_filtering.rst\n> @@ -106,7 +106,7 @@ following code:\n> .. code-block:: c\n>\n> /* create flow for send packet with */\n> - flow = generate_ipv4_flow(port_id, selected_queue,\n> + flow = generate_ipv4_flow(port_id, shared_action,\n> SRC_IP, EMPTY_MASK,\n> DEST_IP, FULL_MASK, &error);\n> if (!flow) {\n> @@ -242,7 +242,7 @@ The Ethernet port is configured with default settings using the\n> rxq_conf = dev_info.default_rxconf;\n> rxq_conf.offloads = port_conf.rxmode.offloads;\n>\n> -For this example we are configuring number of rx and tx queues that are connected\n> +For this example we are configuring 2 rx and 2 tx queues that are connected\n> to a single port.\n>\n> .. code-block:: c\n> @@ -270,13 +270,22 @@ to a single port.\n> }\n> }\n>\n> +Before we create the flow we create shared action in order to send it as\n> +actions argument when creating a flow. The action is single queue RSS action\n> +similar to action queue with the only difference that shared RSS action\n> +provides update capability after action creation.\n> +\n> +.. code-block:: c\n> +\n> + shared_action = rte_flow_shared_action_create(port_id, &action, &error);\n> +\n> In the next step we create and apply the flow rule. which is to send packets\n> with destination ip equals to 192.168.1.1 to queue number 1. The detail\n> explanation of the ``generate_ipv4_flow()`` appears later in this document:\n>\n> .. code-block:: c\n>\n> - flow = generate_ipv4_flow(port_id, selected_queue,\n> + flow = generate_ipv4_flow(port_id, shared_action,\n> SRC_IP, EMPTY_MASK,\n> DEST_IP, FULL_MASK, &error);\n>\n> @@ -339,6 +348,21 @@ looks like the following:\n> printf(\"\\n\");\n> rte_pktmbuf_free(m);\n> }\n> + if (rss_queue[0] == 0) {\n> + printf(\">>> switching queue 0 -> 1\\n\");\n> + rss_queue[0] = 1;\n> + } else {\n> + printf(\">>> switching queue 1 -> 0\\n\");\n> + rss_queue[0] = 0;\n> + }\n> + ret = rte_flow_shared_action_update\n> + (port_id, shared_action, &action,\n> + &error);\n> + if (ret)\n> + rte_exit(EXIT_FAILURE,\n> + \":: error: RSS action update \"\n> + \"failed: %s\\n\",\n> + rte_strerror(-ret));\n> }\n> }\n> }\n> @@ -348,6 +372,8 @@ looks like the following:\n> rte_eth_dev_close(port_id);\n> }\n>\n> +On each loop eteration Rx queue switched using\n> +``rte_flow_shared_action_update()`` API.\n> The main work of the application is reading the packets from all\n> queues and printing for each packet the destination queue:\n>\n> @@ -365,6 +391,21 @@ queues and printing for each packet the destination queue:\n> printf(\" - queue=0x%x\", (unsigned int)i);\n> printf(\"\\n\");\n> rte_pktmbuf_free(m);\n> + if (rss_queue[0] == 0) {\n> + printf(\">>> switching queue 0 -> 1\\n\");\n> + rss_queue[0] = 1;\n> + } else {\n> + printf(\">>> switching queue 1 -> 0\\n\");\n> + rss_queue[0] = 0;\n> + }\n> + ret = rte_flow_shared_action_update\n> + (port_id, shared_action, &action,\n> + &error);\n> + if (ret)\n> + rte_exit(EXIT_FAILURE,\n> + \":: error: RSS action update \"\n> + \"failed: %s\\n\",\n> + rte_strerror(-ret));\n> }\n> }\n> }\n> @@ -378,13 +419,15 @@ The forwarding loop can be interrupted and the application closed using\n> The generate_ipv4_flow function\n> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n>\n> +\n> The generate_ipv4_flow function is responsible for creating the flow rule.\n> This function is located in the ``flow_blocks.c`` file.\n>\n> .. code-block:: c\n>\n> static struct rte_flow *\n> - generate_ipv4_flow(uint8_t port_id, uint16_t rx_q,\n> + generate_ipv4_flow(uint8_t port_id,\n> + cstructrte_flow_shared_action *shared_action,\n> uint32_t src_ip, uint32_t src_mask,\n> uint32_t dest_ip, uint32_t dest_mask,\n> struct rte_flow_error *error)\n> @@ -393,7 +436,6 @@ This function is located in the ``flow_blocks.c`` file.\n> struct rte_flow_item pattern[MAX_PATTERN_NUM];\n> struct rte_flow_action action[MAX_ACTION_NUM];\n> struct rte_flow *flow = NULL;\n> - struct rte_flow_action_queue queue = { .index = rx_q };\n> struct rte_flow_item_ipv4 ip_spec;\n> struct rte_flow_item_ipv4 ip_mask;\n>\n> @@ -411,8 +453,8 @@ This function is located in the ``flow_blocks.c`` file.\n> * create the action sequence.\n> * one action only, move packet to queue\n> */\n> - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;\n> - action[0].conf = &queue;\n> + action[0].type = RTE_FLOW_ACTION_TYPE_SHARED;\n> + action[0].conf = shared_action;\n> action[1].type = RTE_FLOW_ACTION_TYPE_END;\n>\n> /*\n> @@ -468,12 +510,12 @@ The following part create the flow attributes, in our case ingress.\n> attr.ingress = 1;\n>\n> The third part defines the action to be taken when a packet matches\n> -the rule. In this case send the packet to queue.\n> +the rule. In this case send the packet to single RSS queue.\n>\n> .. code-block:: c\n>\n> - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;\n> - action[0].conf = &queue;\n> + action[0].type = RTE_FLOW_ACTION_TYPE_SHARED;\n> + action[0].conf = shared_action;\n> action[1].type = RTE_FLOW_ACTION_TYPE_END;\n>\n> The fourth part is responsible for creating the pattern and is built from\n> diff --git a/examples/flow_filtering/flow_blocks.c b/examples/flow_filtering/flow_blocks.c\n> index 575d792810..99bfed3172 100644\n> --- a/examples/flow_filtering/flow_blocks.c\n> +++ b/examples/flow_filtering/flow_blocks.c\n> @@ -6,11 +6,11 @@\n> #define MAX_ACTION_NUM 2\n>\n> struct rte_flow *\n> -generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> - uint32_t src_ip, uint32_t src_mask,\n> - uint32_t dest_ip, uint32_t dest_mask,\n> - struct rte_flow_error *error);\n> -\n> +generate_ipv4_flow(uint16_t port_id,\n> + struct rte_flow_shared_action *shared_action,\n> + uint32_t src_ip, uint32_t src_mask,\n> + uint32_t dest_ip, uint32_t dest_mask,\n> + struct rte_flow_error *error);\n>\n> /**\n> * create a flow rule that sends packets with matching src and dest ip\n> @@ -18,8 +18,8 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> *\n> * @param port_id\n> * The selected port.\n> - * @param rx_q\n> - * The selected target queue.\n> + * @param shared_action\n> + * The shared RSS action with single queue\n> * @param src_ip\n> * The src ip value to match the input packet.\n> * @param src_mask\n> @@ -35,16 +35,16 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> * A flow if the rule could be created else return NULL.\n> */\n> struct rte_flow *\n> -generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n> - uint32_t src_ip, uint32_t src_mask,\n> - uint32_t dest_ip, uint32_t dest_mask,\n> - struct rte_flow_error *error)\n> +generate_ipv4_flow(uint16_t port_id,\n> + struct rte_flow_shared_action *shared_action,\n> + uint32_t src_ip, uint32_t src_mask,\n> + uint32_t dest_ip, uint32_t dest_mask,\n> + struct rte_flow_error *error)\n> {\n> struct rte_flow_attr attr;\n> struct rte_flow_item pattern[MAX_PATTERN_NUM];\n> struct rte_flow_action action[MAX_ACTION_NUM];\n> struct rte_flow *flow = NULL;\n> - struct rte_flow_action_queue queue = { .index = rx_q };\n> struct rte_flow_item_ipv4 ip_spec;\n> struct rte_flow_item_ipv4 ip_mask;\n> int res;\n> @@ -61,10 +61,10 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q,\n>\n> /*\n> * create the action sequence.\n> - * one action only, move packet to queue\n> + * one action only, move packet to shared RSS queue\n> */\n> - action[0].type = RTE_FLOW_ACTION_TYPE_QUEUE;\n> - action[0].conf = &queue;\n> + action[0].type = RTE_FLOW_ACTION_TYPE_SHARED;\n> + action[0].conf = shared_action;\n> action[1].type = RTE_FLOW_ACTION_TYPE_END;\n>\n> /*\n> diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c\n> index cc9e7e7808..d6b18d95fc 100644\n> --- a/examples/flow_filtering/main.c\n> +++ b/examples/flow_filtering/main.c\n> @@ -32,8 +32,7 @@\n> static volatile bool force_quit;\n>\n> static uint16_t port_id;\n> -static uint16_t nr_queues = 5;\n> -static uint8_t selected_queue = 1;\n> +static uint16_t nr_queues = 2;\n> struct rte_mempool *mbuf_pool;\n> struct rte_flow *flow;\n>\n> @@ -42,6 +41,24 @@ struct rte_flow *flow;\n> #define FULL_MASK 0xffffffff /* full mask */\n> #define EMPTY_MASK 0x0 /* empty mask */\n>\n> +struct rte_flow_shared_action *shared_action;\n> +uint16_t rss_queue[1] = {0};\n> +\n> +struct rte_flow_action_rss action_rss = {\n> + .func = RTE_ETH_HASH_FUNCTION_DEFAULT,\n> + .level = 0,\n> + .types = 0,\n> + .key_len = 0,\n> + .key = NULL,\n> + .queue = rss_queue,\n> + .queue_num = 1,\n> +};\n> +\n> +struct rte_flow_action action = {\n> + .type = RTE_FLOW_ACTION_TYPE_RSS,\n> + .conf = &action_rss,\n> +};\n> +\n> #include \"flow_blocks.c\"\n>\n> static inline void\n> @@ -61,6 +78,7 @@ main_loop(void)\n> uint16_t nb_rx;\n> uint16_t i;\n> uint16_t j;\n> + int ret;\n>\n> while (!force_quit) {\n> for (i = 0; i < nr_queues; i++) {\n> @@ -82,6 +100,21 @@ main_loop(void)\n>\n> rte_pktmbuf_free(m);\n> }\n> + if (rss_queue[0] == 0) {\n> + printf(\">>> switching queue 0 -> 1\\n\");\n> + rss_queue[0] = 1;\n> + } else {\n> + printf(\">>> switching queue 1 -> 0\\n\");\n> + rss_queue[0] = 0;\n> + }\n> + ret = rte_flow_shared_action_update\n> + (port_id, shared_action, &action,\n> + &error);\n> + if (ret)\n> + rte_exit(EXIT_FAILURE,\n> + \":: error: RSS action update \"\n> + \"failed: %s\\n\",\n> + rte_strerror(-ret));\n> }\n> }\n> }\n> @@ -243,8 +276,10 @@ main(int argc, char **argv)\n>\n> init_port();\n>\n> + shared_action = rte_flow_shared_action_create(port_id, &action, &error);\n> +\n> /* create flow for send packet with */\n> - flow = generate_ipv4_flow(port_id, selected_queue,\n> + flow = generate_ipv4_flow(port_id, shared_action,\n> SRC_IP, EMPTY_MASK,\n> DEST_IP, FULL_MASK, &error);\n> if (!flow) {\n> --\n> 2.26.2\n>", "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 9DBC4A0526;\n\tThu, 9 Jul 2020 06:44:20 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id D885D1DA46;\n\tThu, 9 Jul 2020 06:44:19 +0200 (CEST)", "from mail-il1-f196.google.com (mail-il1-f196.google.com\n [209.85.166.196]) by dpdk.org (Postfix) with ESMTP id 3801F1DA45\n for <dev@dpdk.org>; Thu, 9 Jul 2020 06:44:18 +0200 (CEST)", "by mail-il1-f196.google.com with SMTP id x9so945726ila.3\n for <dev@dpdk.org>; Wed, 08 Jul 2020 21:44:18 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n h=mime-version:references:in-reply-to:from:date:message-id:subject:to\n :cc; bh=R94dWFWcLfGzGGvynjHH+mvMxgA2bZF7cNqxdQSaa9U=;\n b=aDnkReC7LY2bkxIx3D+1ZPHmwkIwvy0tuoBu8+nAba2fePJNaooMnIBJQFx5N7zkmN\n 6pqAQgI+XnbQJZkDyM8bqQEiV6C7p1HD22GvXFy6FLohxnFJxzg8aVLs5DvECAI8WtYi\n oadnWF2eGHhTd6g15/qEht9+few2kfd2L9PGX+0FPWfxmFlU40be3yme0N6Ni8OW+ACw\n dEIo1unLjT79Mw/HAT2Z5gREABxpped5PzGCTiU8mKooPyXAtwO6hWSImQx17OCNR3up\n U3clLxCHXlQzXrIY/ct9WRQ2nsbwqhutQQTSwG7dBtciMijGXK91prbFfcgjA+KPV1ZV\n JGPg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:mime-version:references:in-reply-to:from:date\n :message-id:subject:to:cc;\n bh=R94dWFWcLfGzGGvynjHH+mvMxgA2bZF7cNqxdQSaa9U=;\n b=W6AHwFQj0C4aV48K5wmHCpzm+MpJ3xcILetClnmZ4+ZOSWZpBm2lpkRfHujZJhWgdc\n i/oTbzt5co9/kc0HvY42FnZn6evNk24jhPOexUxj8e2AQqZbC+pidGc/iJhWPMf8VdS0\n GGCrRsPFQsQAqgjJ15POgLCl88F4n4YWP6NsTaeXXdlxBYw3cuvXVyjeDBfWAXjLonfc\n ZNwAf79/CF0t+gXRcr4ta92GJhWsiMgVe4/SzmZ6XYiSedbr4p0rVQn5U0J54Q3yu0Us\n t+3ANzj4Sv6bZmCUvRjWu5ba4HrfpeIazHgR8/tBMUOU8jaazqtk2hkIcx9giwPNSwU7\n BKwg==", "X-Gm-Message-State": "AOAM532ebqCcPiGhvbKi8T/IMKXrNP2lr/rSn7crbKU7fE5xeHM1GS0h\n hXd6ksSTr6PwSYW7wHMXdUGCEG2jE92+rWn/XEA=", "X-Google-Smtp-Source": "\n ABdhPJw3BrZivZdYm+QEalriLCo5hSUfiSAqlngkr9PUOG2c2/vvI5fBweilwkOD013RWTU2LRtiXbkucG36PSdiscs=", "X-Received": "by 2002:a92:d206:: with SMTP id y6mr24196786ily.162.1594269857422;\n Wed, 08 Jul 2020 21:44:17 -0700 (PDT)", "MIME-Version": "1.0", "References": "<20200702120511.16315-1-andreyv@mellanox.com>\n <20200708213946.30108-1-andreyv@mellanox.com>\n <20200708213946.30108-7-andreyv@mellanox.com>", "In-Reply-To": "<20200708213946.30108-7-andreyv@mellanox.com>", "From": "Jerin Jacob <jerinjacobk@gmail.com>", "Date": "Thu, 9 Jul 2020 10:14:01 +0530", "Message-ID": "\n <CALBAE1NQHPheit9ZN9-bC69nmkwTxAwjRWHL9ZnXi=dTKH8Z3w@mail.gmail.com>", "To": "Andrey Vesnovaty <andreyv@mellanox.com>", "Cc": "dpdk-dev <dev@dpdk.org>, jer@marvell.com,\n Thomas Monjalon <thomas@monjalon.net>,\n Ferruh Yigit <ferruh.yigit@intel.com>,\n Stephen Hemminger <stephen@networkplumber.org>,\n \"Richardson, Bruce\" <bruce.richardson@intel.com>,\n Ori Kam <orika@mellanox.com>,\n Slava Ovsiienko <viacheslavo@mellanox.com>,\n Andrey Vesnovaty <andrey.vesnovaty@gmail.com>,\n Marko Kovacevic <marko.kovacevic@intel.com>,\n Radu Nicolau <radu.nicolau@intel.com>,\n Akhil Goyal <akhil.goyal@nxp.com>,\n Tomasz Kantecki <tomasz.kantecki@intel.com>,\n Sunil Kumar Kori <skori@marvell.com>,\n Pavan Nikhilesh <pbhagavatula@marvell.com>,\n John McNamara <john.mcnamara@intel.com>", "Content-Type": "text/plain; charset=\"UTF-8\"", "Subject": "Re: [dpdk-dev] [PATCH v2 6/6] examples/flow_filtering: utilize\n\tshared RSS action", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "addressed": null } ]