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 C2FBBA04BB; Tue, 6 Oct 2020 12:34:38 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7C1591E35; Tue, 6 Oct 2020 12:34:36 +0200 (CEST) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by dpdk.org (Postfix) with ESMTP id 7276B1023 for ; Tue, 6 Oct 2020 12:34:34 +0200 (CEST) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 06 Oct 2020 03:32:44 -0700 Received: from HQMAIL111.nvidia.com (172.20.187.18) by HQMAIL105.nvidia.com (172.20.187.12) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 6 Oct 2020 10:34:13 +0000 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.50) by HQMAIL111.nvidia.com (172.20.187.18) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 6 Oct 2020 10:34:13 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VPsY4Yp6r9wvZwi8/1lFb66bPh3NU6wHLBpVffbw+IRXkDDD4IQN6iyXeqql2NTxwm/r+oNI1IZPN2Vq3wHxH0WArIde+1cERAMcOevLdm5hJW7RSdd30q+Q5J3kUZhJKtTKyotgomC+jLQti2bA0Z7zvtaH29JExEzOwkvyPV/5yKYP2Dxgh5yPWpTKqY2WMya2phfxo+U8S+MiZsfWXOLMVRbnPY5HeLl/Oe7QGUMikdsDkTLxApngVMomy6ain926KCcWrKWt5SOeVlRmCK1joJeqKjrh82IAKbUo3CfBk2KtoiZ1LuwrjEdadPkdkinfmCksEMtfwJOLc/CNIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7TjEU8Dmc5f4eb6Fm34xwxio3xI2NqVqKL34nODGRA0=; b=XiWOxtM4ZXz7fWLSCjOrLp20yrP67vLIs9EFScYptk6PpcgBEihHYsl99tS5EDWWMhipkHxnzhhZCgx+HoXuw+cLuP2tK8BZCum/B+erEUDUdOZw959Ej9HhvbpjCdwqCyetEGspBI+hEAIXj7x5Vrq+mPBnffrUnjn1aTA5KLxTVrRqOVTgAX+IeCpeu4JNHZ65YDRPq9YQuPKxlNlJsR+H8Iv8th2IOWoFeToxAxGtoQZwIWnwM/fakCBJfn8/rAlMUQj9saOrpczrRrUxKXbVo/jmZoclc+ktAkfinXHO/SvwyKNASCurmtt4wvcH5WLSAleacVlxCK0op6s1CA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from MWHPR1201MB2525.namprd12.prod.outlook.com (2603:10b6:300:e0::19) by MWHPR1201MB2476.namprd12.prod.outlook.com (2603:10b6:300:de::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3433.38; Tue, 6 Oct 2020 10:34:11 +0000 Received: from MWHPR1201MB2525.namprd12.prod.outlook.com ([fe80::3ccb:ec09:9346:54b1]) by MWHPR1201MB2525.namprd12.prod.outlook.com ([fe80::3ccb:ec09:9346:54b1%7]) with mapi id 15.20.3433.045; Tue, 6 Oct 2020 10:34:11 +0000 From: Andrey Vesnovaty To: Ori Kam , "dev@dpdk.org" CC: "jer@marvell.com" , "jerinjacobk@gmail.com" , NBU-Contact-Thomas Monjalon , "ferruh.yigit@intel.com" , "stephen@networkplumber.org" , "bruce.richardson@intel.com" , Slava Ovsiienko , "andrey.vesnovaty@gmail.com" , "mdr@ashroe.eu" , "nhorman@tuxdriver.com" , "ajit.khaparde@broadcom.com" , "samik.gupta@broadcom.com" , Andrey Vesnovaty , "Marko Kovacevic" , Ori Kam , "Radu Nicolau" , Akhil Goyal , "Tomasz Kantecki" , Sunil Kumar Kori , Pavan Nikhilesh , John McNamara Thread-Topic: [PATCH v3 09/10] examples/flow_filtering: utilize shared RSS action Thread-Index: AQHWmdG89k9qHQonjE+JwCQnMAaaS6mHTX2AgAMV8EA= Date: Tue, 6 Oct 2020 10:34:11 +0000 Message-ID: References: <20201003220619.19231-1-andreyv@nvidia.com> <20201003220619.19231-10-andreyv@nvidia.com> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: nvidia.com; dkim=none (message not signed) header.d=none;nvidia.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [87.71.166.102] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: da593c63-e98c-4614-8fb0-08d869e35d11 x-ms-traffictypediagnostic: MWHPR1201MB2476: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2043; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ok3YhdeBCl3Q7b3wW7fAK6Mv1DJH3ZJDvHDTCFY1jpf50OhWX9952xrQJo01NuZYJoBUVEPMOEIWAx7aO7MIZ02FboWS6es52VVLeycrAUYLe9X3Hj0Ni/lWXQQWj48o8l/kLv+ZEVuAEHt8qejpUcNJWO10Wvm3Aloiyd2C1Hrb2RfXRTircq5DCMVuJyM5pZf0NwsNmNykTtEkZ+yCXU6+VxzyQWLu+tIBrID9x1SulTCjGew3ABYmh0Y3KyRsnK3dl+Xy7EMU/V7zQBT0dJb+qP0C/WCSksr1nx6R/UE4gMGs37bl44ex2epWegygjffjX4dB4g/HJsYs7chxmQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR1201MB2525.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(346002)(376002)(136003)(366004)(110136005)(71200400001)(52536014)(2906002)(478600001)(86362001)(83380400001)(7416002)(30864003)(5660300002)(4326008)(66446008)(76116006)(316002)(66946007)(7696005)(66476007)(64756008)(186003)(54906003)(66556008)(53546011)(6506007)(33656002)(8936002)(9686003)(26005)(8676002)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: HfamwKplxjndIWFZjHzqp6jfCZDfTIPuLwFEv1f1wbW8jjWRIPSfjBEio8pqMx/IPmdhGlZQP7v+LKYIJS5OtH8s4l3Bo1nCefdvR+KjD7pFUFmESyr7FqlLOhtRjH75on7BWHgGFrtQBnOjGWmlh35LTgStuXmdapnkM3gW/u4UUJw1mb25h9myzpnxTROhazq72rFKodPoZ5HZ4xMa6VDeN7jhQoZSoQx/znP1MWjJx52POBPVduZVdJfASp4yT0spZQTBx7+clylHcgotsqJ7ihwE+QV8dk8BugDFtWJxAxdcMsae+xHyJF+GC82QfjO90XXh7BMFGFNJW7hi2tZ461GeusBC0nAnZFp/Eh/+7dKTNf9lsQk6OMjipIcUBz6Xd5SlSv9BFdugpZ2VR/ZLHuegfz4bbbGAvXHqryH+sIGnUNjvBakAdYMCinfnrRjvJ4Ft5yI++1b4s/m69I9mfP8NGDemxYtz5EkS925WjabCjaiIf4F+61FGCK/AXE/VcnKr1JBukNHOSsxGmILZx7Ftekwdol1i3wUBuQ5gAsgdPGcL2Dcrchr2gupjl2rqwCoWG3PZBj3WkKHg1R3nvfhwjHj4jzTzLLfbKxF1Gm8aEHVksc7hUoHHosDlYrz1iQgj8dhF9iiIim+l5w== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR1201MB2525.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: da593c63-e98c-4614-8fb0-08d869e35d11 X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Oct 2020 10:34:11.0680 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ETftCVbfqBiPiPOQkXo3C9QYDbYPNYxnubnhDTMRmy40ZAx9lic26l0CN7m1JDJuohfuHrANuGxOIqCAcpjsNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB2476 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601980364; bh=7TjEU8Dmc5f4eb6Fm34xwxio3xI2NqVqKL34nODGRA0=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-ms-exchange-transport-forked:x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers:x-ms-exchange-senderadcheck: x-microsoft-antispam:x-microsoft-antispam-message-info: x-forefront-antispam-report:x-ms-exchange-antispam-messagedata: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=qKehy2kTBAixqtXNGJGrrn4BbJSnJj2Hu0exn/iw62JKKesbiuW6Romy1yxJkgWs9 HaK1PX+kgN7OcxQUX+NmpePnkHv7yvIJpM4czpT6yUNtwx7bg1mLY0y5PGUMvbODSm /weYW4pz9VNk7OsbRB9vy61oCRWbqMDQYelT1RJp7iEEJzlLs/SOuvvA4ffhXngn7c Yy5QK4GFLxGM7wg9WBN/9AvxC/lFrXbNkTSiCbOlC0+7EzdhRPqiEDXR+7O/040y4Z iY6rsu5CkDlKVp56/3F7OKPU3ptBsW+nvw4fdM0n4ZXdVhN+b+qLnvsDgANSLnme79 0Ez/1Umv9KOuA== Subject: Re: [dpdk-dev] [PATCH v3 09/10] examples/flow_filtering: utilize shared RSS action 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" Hi Ori, PSB Thanks, Andrey > -----Original Message----- > From: Ori Kam > Sent: Sunday, October 4, 2020 2:22 PM > To: Andrey Vesnovaty ; dev@dpdk.org > Cc: jer@marvell.com; jerinjacobk@gmail.com; NBU-Contact-Thomas Monjalon > ; ferruh.yigit@intel.com; > stephen@networkplumber.org; bruce.richardson@intel.com; Slava Ovsiienko > ; andrey.vesnovaty@gmail.com; mdr@ashroe.eu; > nhorman@tuxdriver.com; ajit.khaparde@broadcom.com; > samik.gupta@broadcom.com; Andrey Vesnovaty ; > Marko Kovacevic ; Ori Kam > ; Radu Nicolau ; Akhil Goyal > ; Tomasz Kantecki ; Sunil > Kumar Kori ; Pavan Nikhilesh > ; John McNamara > Subject: RE: [PATCH v3 09/10] examples/flow_filtering: utilize shared RSS= action >=20 > Hi Andrey, >=20 > I don't think this change should be part of the series. Now there is PMD support for shared action & having some example isn't crit= ical For this patch series. Removing it.=20 > After you update this example will only work if the PMD support shared ac= tion. > Not all PMD supports it, and in any case this example is to show basic ru= les and > RSS > your code changes the app that the RSS action can't be checked. There is a fallback for PMDs without shared action support but I that agree, it would be better to provide separate example for shared RSS. >=20 > Best, > Ori >=20 >=20 > > -----Original Message----- > > From: Andrey Vesnovaty > > Sent: Sunday, October 4, 2020 1:06 AM > > Subject: [PATCH v3 09/10] examples/flow_filtering: utilize shared RSS a= ction > > > > From: Andrey Vesnovaty > > > > This commit give very first shared RSS action usage example. > > Queue action used by the flow replaced by shared RSS action > > having single queue. On each RX burst queue switched 0 <-> 1 > > utilizing rte_flow_shared_action_update() API. User supposed > > to observe consistent queue switches on each packet burst. > > > > Signed-off-by: Andrey Vesnovaty > > Signed-off-by: Andrey Vesnovaty > > --- > > doc/guides/sample_app_ug/flow_filtering.rst | 62 +++++++++++++--- > > examples/flow_filtering/flow_blocks.c | 81 +++++++++++++++++---- > > examples/flow_filtering/main.c | 13 +++- > > 3 files changed, 128 insertions(+), 28 deletions(-) > > > > diff --git a/doc/guides/sample_app_ug/flow_filtering.rst > > b/doc/guides/sample_app_ug/flow_filtering.rst > > index 5e5a6cd8a0..cfe9334717 100644 > > --- a/doc/guides/sample_app_ug/flow_filtering.rst > > +++ b/doc/guides/sample_app_ug/flow_filtering.rst > > @@ -106,7 +106,7 @@ following code: > > .. code-block:: c > > > > /* create flow for send packet with */ > > - flow =3D generate_ipv4_flow(port_id, selected_queue, > > + flow =3D generate_ipv4_flow(port_id, shared_action, > > SRC_IP, EMPTY_MASK, > > DEST_IP, FULL_MASK, &error); > > if (!flow) { > > @@ -242,7 +242,7 @@ The Ethernet port is configured with default settin= gs > > using the > > rxq_conf =3D dev_info.default_rxconf; > > rxq_conf.offloads =3D port_conf.rxmode.offloads; > > > > -For this example we are configuring number of rx and tx queues that ar= e > > connected > > +For this example we are configuring 2 rx and 2 tx queues that are conn= ected > > to a single port. > > > > .. code-block:: c > > @@ -270,13 +270,22 @@ to a single port. > > } > > } > > > > +Before we create the flow we create shared action in order to send it = as > > +actions argument when creating a flow. The action is single queue RSS = action > > +similar to action queue with the only difference that shared RSS actio= n > > +provides update capability after action creation. > > + > > +.. code-block:: c > > + > > + shared_action =3D rte_flow_shared_action_create(port_id, &action, &= error); > > + > > In the next step we create and apply the flow rule. which is to send p= ackets > > with destination ip equals to 192.168.1.1 to queue number 1. The detai= l > > explanation of the ``generate_ipv4_flow()`` appears later in this docu= ment: > > > > .. code-block:: c > > > > - flow =3D generate_ipv4_flow(port_id, selected_queue, > > + flow =3D generate_ipv4_flow(port_id, shared_action, > > SRC_IP, EMPTY_MASK, > > DEST_IP, FULL_MASK, &error); > > > > @@ -339,6 +348,21 @@ looks like the following: > > printf("\n"); > > rte_pktmbuf_free(m); > > } > > + if (rss_queue[0] =3D=3D 0) { > > + printf(">>> switching queue= 0 -> 1\n"); > > + rss_queue[0] =3D 1; > > + } else { > > + printf(">>> switching queue= 1 -> 0\n"); > > + rss_queue[0] =3D 0; > > + } > > + ret =3D rte_flow_shared_action_upda= te > > + (port_id, shared_action, &a= ction, > > + &error); > > + if (ret) > > + rte_exit(EXIT_FAILURE, > > + ":: error: RSS act= ion update " > > + "failed: %s\n", > > + rte_strerror(-ret)= ); > > } > > } > > } > > @@ -348,6 +372,8 @@ looks like the following: > > rte_eth_dev_close(port_id); > > } > > > > +On each loop eteration Rx queue switched using > > +``rte_flow_shared_action_update()`` API. > > The main work of the application is reading the packets from all > > queues and printing for each packet the destination queue: > > > > @@ -365,6 +391,21 @@ queues and printing for each packet the destinatio= n > > queue: > > printf(" - queue=3D0x%x", (unsigned int)i= ); > > printf("\n"); > > rte_pktmbuf_free(m); > > + if (rss_queue[0] =3D=3D 0) { > > + printf(">>> switching queue 0 -> = 1\n"); > > + rss_queue[0] =3D 1; > > + } else { > > + printf(">>> switching queue 1 -> = 0\n"); > > + rss_queue[0] =3D 0; > > + } > > + ret =3D rte_flow_shared_action_update > > + (port_id, shared_action, &action, > > + &error); > > + if (ret) > > + rte_exit(EXIT_FAILURE, > > + ":: error: RSS action up= date " > > + "failed: %s\n", > > + rte_strerror(-ret)); > > } > > } > > } > > @@ -378,13 +419,15 @@ The forwarding loop can be interrupted and the > > application closed using > > The generate_ipv4_flow function > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > > > > + > > The generate_ipv4_flow function is responsible for creating the flow r= ule. > > This function is located in the ``flow_blocks.c`` file. > > > > .. code-block:: c > > > > static struct rte_flow * > > - generate_ipv4_flow(uint8_t port_id, uint16_t rx_q, > > + generate_ipv4_flow(uint8_t port_id, > > + cstructrte_flow_shared_action *shared_action, > > uint32_t src_ip, uint32_t src_mask, > > uint32_t dest_ip, uint32_t dest_mask, > > struct rte_flow_error *error) > > @@ -393,7 +436,6 @@ This function is located in the ``flow_blocks.c`` f= ile. > > struct rte_flow_item pattern[MAX_PATTERN_NUM]; > > struct rte_flow_action action[MAX_ACTION_NUM]; > > struct rte_flow *flow =3D NULL; > > - struct rte_flow_action_queue queue =3D { .index =3D rx_q }; > > struct rte_flow_item_ipv4 ip_spec; > > struct rte_flow_item_ipv4 ip_mask; > > > > @@ -411,8 +453,8 @@ This function is located in the ``flow_blocks.c`` f= ile. > > * create the action sequence. > > * one action only, move packet to queue > > */ > > - action[0].type =3D RTE_FLOW_ACTION_TYPE_QUEUE; > > - action[0].conf =3D &queue; > > + action[0].type =3D RTE_FLOW_ACTION_TYPE_SHARED; > > + action[0].conf =3D shared_action; > > action[1].type =3D RTE_FLOW_ACTION_TYPE_END; > > > > /* > > @@ -468,12 +510,12 @@ The following part create the flow attributes, in= our > > case ingress. > > attr.ingress =3D 1; > > > > The third part defines the action to be taken when a packet matches > > -the rule. In this case send the packet to queue. > > +the rule. In this case send the packet to single RSS queue. > > > > .. code-block:: c > > > > - action[0].type =3D RTE_FLOW_ACTION_TYPE_QUEUE; > > - action[0].conf =3D &queue; > > + action[0].type =3D RTE_FLOW_ACTION_TYPE_SHARED; > > + action[0].conf =3D shared_action; > > action[1].type =3D RTE_FLOW_ACTION_TYPE_END; > > > > The fourth part is responsible for creating the pattern and is built f= rom > > diff --git a/examples/flow_filtering/flow_blocks.c > > b/examples/flow_filtering/flow_blocks.c > > index 575d792810..ed17ae073e 100644 > > --- a/examples/flow_filtering/flow_blocks.c > > +++ b/examples/flow_filtering/flow_blocks.c > > @@ -5,12 +5,30 @@ > > #define MAX_PATTERN_NUM 3 > > #define MAX_ACTION_NUM 2 > > > > -struct rte_flow * > > -generate_ipv4_flow(uint16_t port_id, uint16_t rx_q, > > - uint32_t src_ip, uint32_t src_mask, > > - uint32_t dest_ip, uint32_t dest_mask, > > - struct rte_flow_error *error); > > +struct rte_flow_shared_action *shared_action; > > +uint16_t rss_queue[1] =3D {0}; > > + > > +struct rte_flow_action_rss rss_action =3D { > > + .func =3D RTE_ETH_HASH_FUNCTION_DEFAULT, > > + .level =3D 0, > > + .types =3D 0, > > + .key_len =3D 0, > > + .key =3D NULL, > > + .queue =3D rss_queue, > > + .queue_num =3D 1, > > +}; > > > > +struct rte_flow_action flow_action =3D { > > + .type =3D RTE_FLOW_ACTION_TYPE_RSS, > > + .conf =3D &rss_action, > > +}; > > + > > +struct rte_flow * > > +generate_ipv4_flow(uint16_t port_id, > > + uint32_t src_ip, uint32_t src_mask, > > + uint32_t dest_ip, uint32_t dest_mask, > > + struct rte_flow_error *error); > > +int update_rss_action(uint16_t port_id, struct rte_flow_error *error); > > > > /** > > * create a flow rule that sends packets with matching src and dest ip > > @@ -18,8 +36,6 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q, > > * > > * @param port_id > > * The selected port. > > - * @param rx_q > > - * The selected target queue. > > * @param src_ip > > * The src ip value to match the input packet. > > * @param src_mask > > @@ -35,16 +51,15 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q, > > * A flow if the rule could be created else return NULL. > > */ > > struct rte_flow * > > -generate_ipv4_flow(uint16_t port_id, uint16_t rx_q, > > - uint32_t src_ip, uint32_t src_mask, > > - uint32_t dest_ip, uint32_t dest_mask, > > - struct rte_flow_error *error) > > +generate_ipv4_flow(uint16_t port_id, > > + uint32_t src_ip, uint32_t src_mask, > > + uint32_t dest_ip, uint32_t dest_mask, > > + struct rte_flow_error *error) > > { > > struct rte_flow_attr attr; > > struct rte_flow_item pattern[MAX_PATTERN_NUM]; > > struct rte_flow_action action[MAX_ACTION_NUM]; > > struct rte_flow *flow =3D NULL; > > - struct rte_flow_action_queue queue =3D { .index =3D rx_q }; > > struct rte_flow_item_ipv4 ip_spec; > > struct rte_flow_item_ipv4 ip_mask; > > int res; > > @@ -61,10 +76,19 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q, > > > > /* > > * create the action sequence. > > - * one action only, move packet to queue > > + * one action only, move packet to shared RSS queue > > */ > > - action[0].type =3D RTE_FLOW_ACTION_TYPE_QUEUE; > > - action[0].conf =3D &queue; > > + shared_action =3D rte_flow_shared_action_create(port_id, NULL, > > + &flow_action, error); > > + if (shared_action) { > > + action[0].conf =3D shared_action; > > + action[0].type =3D RTE_FLOW_ACTION_TYPE_SHARED; > > + } else { > > + if (rte_errno !=3D ENOSYS) > > + rte_exit(EXIT_FAILURE, ":: action creation failure\n"); > > + printf("PMD doesn't support shared actions.\n"); > > + action[0] =3D flow_action; > > + } > > action[1].type =3D RTE_FLOW_ACTION_TYPE_END; > > > > /* > > @@ -98,3 +122,30 @@ generate_ipv4_flow(uint16_t port_id, uint16_t rx_q, > > > > return flow; > > } > > + > > +/** > > + * updates shared RSS action if flow created with shared action > > + * > > + * @param port_id > > + * The selected port. > > + * @param[out] error > > + * Perform verbose error reporting if not NULL. > > + * > > + * @return > > + * 0 on sccess > > + */ > > +int > > +update_rss_action(uint16_t port_id, struct rte_flow_error *error) > > +{ > > + if (!shared_action) > > + return 0; > > + if (rss_queue[0] =3D=3D 0) { > > + printf(">>> switching queue 0 -> 1\n"); > > + rss_queue[0] =3D 1; > > + } else { > > + printf(">>> switching queue 1 -> 0\n"); > > + rss_queue[0] =3D 0; > > + } > > + return rte_flow_shared_action_update(port_id, shared_action, > > + &flow_action, error); > > +} > > diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/m= ain.c > > index cc9e7e7808..9ef7f099d9 100644 > > --- a/examples/flow_filtering/main.c > > +++ b/examples/flow_filtering/main.c > > @@ -32,8 +32,7 @@ > > static volatile bool force_quit; > > > > static uint16_t port_id; > > -static uint16_t nr_queues =3D 5; > > -static uint8_t selected_queue =3D 1; > > +static uint16_t nr_queues =3D 2; > > struct rte_mempool *mbuf_pool; > > struct rte_flow *flow; > > > > @@ -61,6 +60,7 @@ main_loop(void) > > uint16_t nb_rx; > > uint16_t i; > > uint16_t j; > > + int ret; > > > > while (!force_quit) { > > for (i =3D 0; i < nr_queues; i++) { > > @@ -82,6 +82,12 @@ main_loop(void) > > > > rte_pktmbuf_free(m); > > } > > + ret =3D update_rss_action(port_id, &error); > > + if (ret) > > + rte_exit(EXIT_FAILURE, > > + ":: error: RSS action update " > > + "failed: %s\n", > > + rte_strerror(-ret)); > > } > > } > > } > > @@ -243,8 +249,9 @@ main(int argc, char **argv) > > > > init_port(); > > > > + > > /* create flow for send packet with */ > > - flow =3D generate_ipv4_flow(port_id, selected_queue, > > + flow =3D generate_ipv4_flow(port_id, > > SRC_IP, EMPTY_MASK, > > DEST_IP, FULL_MASK, &error); > > if (!flow) { > > -- > > 2.26.2