From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B3D2BCA9EAF for ; Sun, 27 Oct 2019 16:38:14 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 187FB21726 for ; Sun, 27 Oct 2019 16:38:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=Mellanox.com header.i=@Mellanox.com header.b="VViEIYJA" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 187FB21726 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mellanox.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 918391BF06; Sun, 27 Oct 2019 17:38:12 +0100 (CET) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-eopbgr150085.outbound.protection.outlook.com [40.107.15.85]) by dpdk.org (Postfix) with ESMTP id 37DDE1BEF6 for ; Sun, 27 Oct 2019 17:38:10 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e3CEkZWlxW3B2uqVIaYYMzvWTr3rhG1KTYpswtNUVrERfYxFeMHZ6mQvVa9+yu6BpfYJRUAvFKcoZBDqxXltoZboBUh4HSb2imBG6bAr9s4abGuhN7B4i/Dro2Gf4kyZnlxj6SMIxfBxwuyFVAOH35SFnmJ0T9nTUeAi2qN5lW85dSQUcWDJpc36ekRYDxSCTT07uTcBWj3v8vW+NpO5s3qZh2qvkJDEs39rcxyipYsbznPbyUdwlU/iJ3iZi4hooqG4OBJQ2HRFkSV6qs+rP6kpNwqn1lpBSCbpkB4u4aJ4RkHHYww8fBzIDltjjAne+07GYVwRgTKaX4udK5ERJw== 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=37jh6G+wmguK3a1gYgpEceGYZISFa9uV0roS+z9MvXI=; b=bvpWiw1vBR+Kz4QL9GYCrDO9FPVrT9oG9nVYhVV2NWW7mmMzV/u7PxACj/GTTPzB3VC6kPnC7+W8cNcrH0Of++nj0pQSnB3/wJVz4k2nED4Okev9u9G8ii8In00e0Wghp2qp4Xfu9/iwZ5dUKAGZHvmeArk5maNBu4ClusSKUMRPnXGWLjVqDl2HT9D3fkVfNMNqgY1WKoBQDEDWJPjzoU5jDzsejcWqrg/RVpkIwxlh4Q7Ktn03Rlvq+fdhPc6ZL6mYPwD7fxPbn0P+llqch1INANpvb4w/Wjf63zO6Wn3HB3oqdtkp0g139AKFpWs/4Do+XvCuSsUs3swVp1TKkg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=37jh6G+wmguK3a1gYgpEceGYZISFa9uV0roS+z9MvXI=; b=VViEIYJAX4n6sJk0EYNMz7bjhWsIO3Jnu3EiefkAO5rbTDk1siE+K169tXQ4fbDayScQUJi9d0aim/XRUW3+tUgMb+a/i/rV7Z9hKoyk3bEDvhMkXvmbRdFoJU7wApXiSkbDE1SHuLcabeukNdLMrZSDyzeL3bb82Yvb/DlWXwQ= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.190.15) by AM4PR05MB3505.eurprd05.prod.outlook.com (10.171.188.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2387.20; Sun, 27 Oct 2019 16:38:08 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::70a7:a312:cbc6:d178]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::70a7:a312:cbc6:d178%7]) with mapi id 15.20.2387.025; Sun, 27 Oct 2019 16:38:08 +0000 From: Ori Kam To: Slava Ovsiienko , "dev@dpdk.org" CC: Thomas Monjalon , "arybchenko@solarflare.com" , Matan Azrad , Raslan Darawsheh , Yongseok Koh Thread-Topic: [dpdk-dev] [PATCH v3] ethdev: add flow tag Thread-Index: AQHVimyv67oDGX6XPkicks4XWkzfVKdurw8Q Date: Sun, 27 Oct 2019 16:38:08 +0000 Message-ID: References: <1570723757-25016-1-git-send-email-viacheslavo@mellanox.com> <1571922738-5069-1-git-send-email-viacheslavo@mellanox.com> In-Reply-To: <1571922738-5069-1-git-send-email-viacheslavo@mellanox.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=orika@mellanox.com; x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 6a822bc0-5b45-4595-cb0e-08d75afc0c70 x-ms-traffictypediagnostic: AM4PR05MB3505:|AM4PR05MB3505: x-ms-exchange-purlcount: 1 x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtFwd,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:538; x-forefront-prvs: 0203C93D51 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(376002)(366004)(136003)(346002)(396003)(39860400002)(13464003)(189003)(199004)(229853002)(66476007)(14454004)(6506007)(316002)(86362001)(966005)(26005)(74316002)(305945005)(7736002)(486006)(11346002)(6246003)(8936002)(76176011)(107886003)(186003)(476003)(30864003)(33656002)(8676002)(81156014)(81166006)(54906003)(4326008)(446003)(5660300002)(55016002)(3846002)(14444005)(6116002)(71190400001)(25786009)(256004)(6306002)(110136005)(478600001)(9686003)(66556008)(66066001)(76116006)(2906002)(66946007)(66446008)(45080400002)(102836004)(52536014)(6436002)(7696005)(53546011)(71200400001)(99286004)(64756008)(2501003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB3505; H:AM4PR05MB3425.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: oiAxTO6CVX/DeL90gdrxcjLA/W0yHflpyB/MVC1SfaKbgsa6qUzTWJmb6PMMWsiy5FR/8lV7XfFO8xxL5mKGiXOVSps4JpQRMxXI2kpu6+qii4CqWVjR/7detMTTyFQgjGF5PNpyjZccJrjdUEoc/EZiSWCinky+Nrw/qDjzEbRsu9QBDh5Fd1LIwF72JTNoCbS8s169k7qLh+hvnIAhHlifZiK1i/8aM4Io5Msor93+ruMRcWAosqsdT1ulCDn76ic3LKdc2Arm5yUd1VZZtkRjS2QJGPuOF0piR8TLZhQgeTPLNgJJaq5MyLaNSB3KTmD42gB42apYVtB/Zc+qqJlAuctcq4x172ZaKLMCGbR06vFb2+MDKqfX3tfWNbWx868L8afyXoLrfAXu8S5UviWdCP+QzXL4naZYCFuFgU/YFLbxmFUw/CYh7W3tJ/xfeL+/WubktnU8EbWwmhYHVQFGS2UrUnKC0mIpOBOd3vw= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6a822bc0-5b45-4595-cb0e-08d75afc0c70 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Oct 2019 16:38:08.1252 (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: +duKS6sswfdubZPqsP6ryFhlRnzFeVQAgPdn7ha5NoFVRLdbp5UdzYLN4k8fTAXv+lfLfdseW0qGa3rLb3EG9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB3505 Subject: Re: [dpdk-dev] [PATCH v3] ethdev: add flow tag 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" > -----Original Message----- > From: dev On Behalf Of Viacheslav Ovsiienko > Sent: Thursday, October 24, 2019 4:12 PM > To: dev@dpdk.org > Cc: Thomas Monjalon ; arybchenko@solarflare.com; > Matan Azrad ; Raslan Darawsheh > ; Yongseok Koh > Subject: [dpdk-dev] [PATCH v3] ethdev: add flow tag >=20 > A tag is a transient data which can be used during flow match. This can b= e > used to store match result from a previous table so that the same pattern > need not be matched again on the next table. Even if outer header is > decapsulated on the previous match, the match result can be kept. >=20 > Some device expose internal registers of its flow processing pipeline and > those registers are quite useful for stateful connection tracking as it > keeps status of flow matching. Multiple tags are supported by specifying > index. >=20 > Example testpmd commands are: >=20 > flow create 0 ingress pattern ... / end > actions set_tag index 2 value 0xaa00bb mask 0xffff00ff / > set_tag index 3 value 0x123456 mask 0xffffff / > vxlan_decap / jump group 1 / end >=20 > flow create 0 ingress pattern ... / end > actions set_tag index 2 value 0xcc00 mask 0xff00 / > set_tag index 3 value 0x123456 mask 0xffffff / > vxlan_decap / jump group 1 / end >=20 > flow create 0 ingress group 1 > pattern tag index is 2 value spec 0xaa00bb value mask 0xffff00ff / > eth ... / end > actions ... jump group 2 / end >=20 > flow create 0 ingress group 1 > pattern tag index is 2 value spec 0xcc00 value mask 0xff00 / > tag index is 3 value spec 0x123456 value mask 0xffffff / > eth ... / end > actions ... / end >=20 > flow create 0 ingress group 2 > pattern tag index is 3 value spec 0x123456 value mask 0xffffff / > eth ... / end > actions ... / end >=20 > Signed-off-by: Yongseok Koh > Signed-off-by: Viacheslav Ovsiienko > --- > v3: rebased, neat updates > v2: > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s.dp > dk.org%2Fpatch%2F60909%2F&data=3D02%7C01%7Corika%40mellanox.com > %7Cd91f4ba88d40409aac5a08d75883d0f2%7Ca652971c7d2e4d9ba6a4d14925 > 6f461b%7C0%7C0%7C637075195487679773&sdata=3DXrzhgAa2H%2BuWV% > 2FxZu3XBnYkFv%2FVauLkjN7fAA0ROSss%3D&reserved=3D0 > v1: > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s.dp > dk.org%2Fpatch%2F56104%2F&data=3D02%7C01%7Corika%40mellanox.com > %7Cd91f4ba88d40409aac5a08d75883d0f2%7Ca652971c7d2e4d9ba6a4d14925 > 6f461b%7C0%7C0%7C637075195487689768&sdata=3De9C9LHb3b%2Fnif%2F > 8S5ypeGDoEeVH%2FBayN3mX1q4p0arA%3D&reserved=3D0 > rfc: > https://eur03.safelinks.protection.outlook.com/?url=3Dhttp%3A%2F%2Fpatche= s.dp > dk.org%2Fpatch%2F54271%2F&data=3D02%7C01%7Corika%40mellanox.com > %7Cd91f4ba88d40409aac5a08d75883d0f2%7Ca652971c7d2e4d9ba6a4d14925 > 6f461b%7C0%7C0%7C637075195487689768&sdata=3D3uP4UubC%2BpoDdtk > iwSMwu2AwHm7yyBAJhItA%2Be9Q5co%3D&reserved=3D0 >=20 > app/test-pmd/cmdline_flow.c | 75 > ++++++++++++++++++++++++++++++++++ > doc/guides/prog_guide/rte_flow.rst | 50 +++++++++++++++++++++++ > doc/guides/rel_notes/release_19_11.rst | 5 +++ > lib/librte_ethdev/rte_flow.c | 2 + > lib/librte_ethdev/rte_flow.h | 61 +++++++++++++++++++++++++++ > 5 files changed, 193 insertions(+) >=20 > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index bc89bf9..35852bd 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -206,6 +206,9 @@ enum index { > ITEM_HIGIG2, > ITEM_HIGIG2_CLASSIFICATION, > ITEM_HIGIG2_VID, > + ITEM_TAG, > + ITEM_TAG_DATA, > + ITEM_TAG_INDEX, >=20 > /* Validate/create actions. */ > ACTIONS, > @@ -311,6 +314,10 @@ enum index { > ACTION_SET_META, > ACTION_SET_META_DATA, > ACTION_SET_META_MASK, > + ACTION_SET_TAG, > + ACTION_SET_TAG_INDEX, > + ACTION_SET_TAG_DATA, > + ACTION_SET_TAG_MASK, > }; >=20 Can you please add them alphabetic , (data,index,mask) what do you think? > /** Maximum size for pattern in struct rte_flow_item_raw. */ > @@ -682,6 +689,7 @@ struct parse_action_priv { > ITEM_PPPOED, > ITEM_PPPOE_PROTO_ID, > ITEM_HIGIG2, > + ITEM_TAG, > END_SET, > ZERO, > }; > @@ -953,6 +961,13 @@ struct parse_action_priv { > ZERO, > }; >=20 > +static const enum index item_tag[] =3D { > + ITEM_TAG_DATA, > + ITEM_TAG_INDEX, > + ITEM_NEXT, > + ZERO, > +}; > + > static const enum index next_action[] =3D { > ACTION_END, > ACTION_VOID, > @@ -1009,6 +1024,7 @@ struct parse_action_priv { > ACTION_RAW_ENCAP, > ACTION_RAW_DECAP, > ACTION_SET_META, > + ACTION_SET_TAG, > ZERO, > }; >=20 > @@ -1202,6 +1218,14 @@ struct parse_action_priv { > ZERO, > }; >=20 > +static const enum index action_set_tag[] =3D { > + ACTION_SET_TAG_INDEX, > + ACTION_SET_TAG_DATA, > + ACTION_SET_TAG_MASK, > + ACTION_NEXT, > + ZERO, > +}; > + Again maybe order of the defines according. > static int parse_set_raw_encap_decap(struct context *, const struct toke= n *, > const char *, unsigned int, > void *, unsigned int); > @@ -2467,6 +2491,26 @@ static int comp_vc_action_rss_queue(struct context > *, const struct token *, > .args =3D ARGS(ARGS_ENTRY_HTON(struct > rte_flow_item_higig2_hdr, > hdr.ppt1.vid)), > }, > + [ITEM_TAG] =3D { > + .name =3D "tag", > + .help =3D "match tag value", > + .priv =3D PRIV_ITEM(TAG, sizeof(struct rte_flow_item_tag)), > + .next =3D NEXT(item_tag), > + .call =3D parse_vc, > + }, > + [ITEM_TAG_DATA] =3D { > + .name =3D "data", > + .help =3D "tag value to match", > + .next =3D NEXT(item_tag, NEXT_ENTRY(UNSIGNED), > item_param), > + .args =3D ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_tag, > data)), > + }, > + [ITEM_TAG_INDEX] =3D { > + .name =3D "index", > + .help =3D "index of tag array to match", > + .next =3D NEXT(item_tag, NEXT_ENTRY(UNSIGNED), > + NEXT_ENTRY(ITEM_PARAM_IS)), > + .args =3D ARGS(ARGS_ENTRY(struct rte_flow_item_tag, index)), > + }, I think you are missing mask. > /* Validate/create actions. */ > [ACTIONS] =3D { > .name =3D "actions", > @@ -3295,6 +3339,37 @@ static int comp_vc_action_rss_queue(struct context > *, const struct token *, > (struct rte_flow_action_set_meta, mask)), > .call =3D parse_vc_conf, > }, > + [ACTION_SET_TAG] =3D { > + .name =3D "set_tag", > + .help =3D "set tag", > + .priv =3D PRIV_ACTION(SET_TAG, > + sizeof(struct rte_flow_action_set_tag)), > + .next =3D NEXT(action_set_tag), > + .call =3D parse_vc, > + }, > + [ACTION_SET_TAG_INDEX] =3D { > + .name =3D "index", > + .help =3D "index of tag array", > + .next =3D NEXT(action_set_tag, NEXT_ENTRY(UNSIGNED)), > + .args =3D ARGS(ARGS_ENTRY(struct rte_flow_action_set_tag, > index)), > + .call =3D parse_vc_conf, > + }, > + [ACTION_SET_TAG_DATA] =3D { > + .name =3D "data", > + .help =3D "tag value", > + .next =3D NEXT(action_set_tag, NEXT_ENTRY(UNSIGNED)), > + .args =3D ARGS(ARGS_ENTRY_HTON > + (struct rte_flow_action_set_tag, data)), > + .call =3D parse_vc_conf, > + }, > + [ACTION_SET_TAG_MASK] =3D { > + .name =3D "mask", > + .help =3D "mask for tag value", > + .next =3D NEXT(action_set_tag, NEXT_ENTRY(UNSIGNED)), > + .args =3D ARGS(ARGS_ENTRY_HTON > + (struct rte_flow_action_set_tag, mask)), > + .call =3D parse_vc_conf, > + }, > }; >=20 > /** Remove and return last entry from argument stack. */ > diff --git a/doc/guides/prog_guide/rte_flow.rst > b/doc/guides/prog_guide/rte_flow.rst > index 2b49baa..89a29b9 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -684,6 +684,34 @@ action sets metadata for a packet and the metadata > will be reported via > | ``mask`` | ``data`` | bit-mask applies to "spec" and "last" | > +----------+----------+---------------------------------------+ >=20 > +Item: ``TAG`` > +^^^^^^^^^^^^^ > + > +Matches tag item set by other flows. Multiple tags are supported by spec= ifying > +``index``. > + > +- Default ``mask`` matches the specified tag value and index. > + > +.. _table_rte_flow_item_tag: > + > +.. table:: TAG > + > + +----------+----------+----------------------------------------+ > + | Field | Subfield | Value | > + > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > + | ``spec`` | ``data`` | 32 bit flow tag value | > + | +-----------+---------------------------------------+ > + | | ``index`` | index of flow tag | > + +----------+-----------+---------------------------------------+ > + | ``last`` | ``data`` | upper range value | > + | +-----------+ | > + | | ``index`` | | > + +----------+-----------+---------------------------------------+ I don't think last is relevant for this. Maybe is should be documented as i= gnored. > + | ``mask`` | ``data`` | bit-mask applies to "spec" and "last" | > + | +-----------+ | > + | | ``index`` | | Should set index as ignored. > + +----------+-----------+---------------------------------------+ > + > Data matching item types > ~~~~~~~~~~~~~~~~~~~~~~~~ >=20 > @@ -2508,6 +2536,28 @@ the other path depending on HW capability. > | ``mask`` | bit-mask applies to "data" | > +----------+----------------------------+ >=20 > +Action: ``SET_TAG`` > +^^^^^^^^^^^^^^^^^^^ > + > +Set Tag. > + > +Tag is a transient data used during flow matching. This is not delivered= to > +application. Multiple tags are supported by specifying index. > + > +.. _table_rte_flow_action_set_tag: > + > +.. table:: SET_TAG > + > + +-----------+----------------------------+ > + | Field | Value | > + +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ > + | ``data`` | 32 bit tag value | > + +-----------+----------------------------+ > + | ``mask`` | bit-mask applies to "data" | > + +-----------+----------------------------+ > + | ``index`` | index of tag to set | > + +-----------+----------------------------+ > + > Negative types > ~~~~~~~~~~~~~~ >=20 > diff --git a/doc/guides/rel_notes/release_19_11.rst > b/doc/guides/rel_notes/release_19_11.rst > index 2c51426..610191b 100644 > --- a/doc/guides/rel_notes/release_19_11.rst > +++ b/doc/guides/rel_notes/release_19_11.rst > @@ -208,6 +208,11 @@ New Features > * Rx metadata is delivered to host via a dynamic field of ``rte_mbuf``= with > PKT_RX_DYNF_METADATA. >=20 > +* **Added flow tag in rte_flow.** > + SET_TAG action and TAG item have been added to support transient flow > + tag. > + > + > Removed Items > ------------- >=20 > diff --git a/lib/librte_ethdev/rte_flow.c b/lib/librte_ethdev/rte_flow.c > index 6090177..ec1d11d 100644 > --- a/lib/librte_ethdev/rte_flow.c > +++ b/lib/librte_ethdev/rte_flow.c > @@ -82,6 +82,7 @@ struct rte_flow_desc_data { > sizeof(struct rte_flow_item_icmp6_nd_opt_tla_eth)), > MK_FLOW_ITEM(MARK, sizeof(struct rte_flow_item_mark)), > MK_FLOW_ITEM(META, sizeof(struct rte_flow_item_meta)), > + MK_FLOW_ITEM(TAG, sizeof(struct rte_flow_item_tag)), > MK_FLOW_ITEM(GRE_KEY, sizeof(rte_be32_t)), > MK_FLOW_ITEM(GTP_PSC, sizeof(struct rte_flow_item_gtp_psc)), > MK_FLOW_ITEM(PPPOES, sizeof(struct rte_flow_item_pppoe)), > @@ -166,6 +167,7 @@ struct rte_flow_desc_data { > MK_FLOW_ACTION(INC_TCP_ACK, sizeof(rte_be32_t)), > MK_FLOW_ACTION(DEC_TCP_ACK, sizeof(rte_be32_t)), > MK_FLOW_ACTION(SET_META, sizeof(struct > rte_flow_action_set_meta)), > + MK_FLOW_ACTION(SET_TAG, sizeof(struct rte_flow_action_set_tag)), > }; >=20 > int > diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h > index b821557..4d56954 100644 > --- a/lib/librte_ethdev/rte_flow.h > +++ b/lib/librte_ethdev/rte_flow.h > @@ -501,6 +501,15 @@ enum rte_flow_item_type { > * see struct rte_flow_item_higig2_hdr. > */ > RTE_FLOW_ITEM_TYPE_HIGIG2, > + > + /* > + * [META] > + * Please remove the [META] > + * Matches a tag value. > + * > + * See struct rte_flow_item_tag. > + */ > + RTE_FLOW_ITEM_TYPE_TAG, > }; >=20 > /** > @@ -1350,6 +1359,27 @@ struct rte_flow_item_pppoe_proto_id { > * @warning > * @b EXPERIMENTAL: this structure may change without prior notice > * > + * RTE_FLOW_ITEM_TYPE_TAG > + * > + * Matches a specified tag value at the specified index. > + */ > +struct rte_flow_item_tag { > + uint32_t data; > + uint8_t index; > +}; > + > +/** Default mask for RTE_FLOW_ITEM_TYPE_TAG. */ > +#ifndef __cplusplus > +static const struct rte_flow_item_tag rte_flow_item_tag_mask =3D { > + .data =3D 0xffffffff, > + .index =3D 0xff, > +}; > +#endif > + > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > * RTE_FLOW_ITEM_TYPE_MARK > * > * Matches an arbitrary integer value which was set using the ``MARK`` a= ction > @@ -1368,6 +1398,13 @@ struct rte_flow_item_mark { > uint32_t id; /**< Integer value to match against. */ > }; >=20 > +/** Default mask for RTE_FLOW_ITEM_TYPE_MARK. */ > +#ifndef __cplusplus > +static const struct rte_flow_item_mark rte_flow_item_mark_mask =3D { > + .id =3D 0xffffffff, > +}; > +#endif > + > /** > * @warning > * @b EXPERIMENTAL: this structure may change without prior notice > @@ -1960,6 +1997,15 @@ enum rte_flow_action_type { > * See struct rte_flow_action_set_meta. > */ > RTE_FLOW_ACTION_TYPE_SET_META, > + > + /** > + * Set Tag. > + * > + * Tag is not delivered to application. > + * I think we should think positive. Something like tag is for internal flow o= nly and is not delivered to the application. What do you think? > + * See struct rte_flow_action_set_tag. > + */ > + RTE_FLOW_ACTION_TYPE_SET_TAG, > }; >=20 > /** > @@ -2496,6 +2542,21 @@ struct rte_flow_action_set_meta { > *RTE_FLOW_DYNF_METADATA(m) =3D v; > } >=20 > +/** > + * @warning > + * @b EXPERIMENTAL: this structure may change without prior notice > + * > + * RTE_FLOW_ACTION_TYPE_SET_TAG > + * > + * Set a tag which is a transient data used during flow matching. This i= s not > + * delivered to application. Multiple tags are supported by specifying i= ndex. > + */ > +struct rte_flow_action_set_tag { > + uint32_t data; > + uint32_t mask; > + uint8_t index; > +}; > + > /* > * Definition of a single action. > * > -- > 1.8.3.1