From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on0051.outbound.protection.outlook.com [104.47.1.51]) by dpdk.org (Postfix) with ESMTP id 1A0B85F14 for ; Thu, 18 Oct 2018 14:26:28 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=oIw4snhVb+QQTS0MNb5ADqYbfoOy2KNYvMwfso1mFWU=; b=To5DVsyqY8ARKmZf1smvzQsR/l2wOH1suZJx4xnqUFg5Ks7b5xvKM0n60+3PtefoBJrTLGMZaQUQ7YP+3Y/rzHHHA3zh/HvY+C4oDQPcm1/QE5ZH6OdwT0EYuKKyfpIbHW5igejjkd0LDjBlnU7FPn3UtZ8Jf1QmR7Fw5jSAjA0= Received: from AM4PR05MB3425.eurprd05.prod.outlook.com (10.171.187.142) by AM4PR05MB1441.eurprd05.prod.outlook.com (10.164.79.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Thu, 18 Oct 2018 12:26:26 +0000 Received: from AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::fdeb:3890:f0f0:2202]) by AM4PR05MB3425.eurprd05.prod.outlook.com ([fe80::fdeb:3890:f0f0:2202%4]) with mapi id 15.20.1228.033; Thu, 18 Oct 2018 12:26:26 +0000 From: Ori Kam To: Dekel Peled , "wenzhuo.lu@intel.com" , "jingjing.wu@intel.com" , "bernard.iremonger@intel.com" , "olivier.matz@6wind.com" , Adrien Mazarguil , Thomas Monjalon , "ferruh.yigit@intel.com" , "arybchenko@solarflare.com" CC: Shahaf Shuler , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v5 2/3] app/testpmd: support metadata as flow rule item Thread-Index: AQHUZhGaxE9dA58ElEy4Ke4a+HJlj6UkrGCw Date: Thu, 18 Oct 2018 12:26:25 +0000 Message-ID: References: <1539254998-8555-1-git-send-email-dekelp@mellanox.com> <1539777829-64412-3-git-send-email-dekelp@mellanox.com> In-Reply-To: <1539777829-64412-3-git-send-email-dekelp@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-microsoft-exchange-diagnostics: 1; AM4PR05MB1441; 6:k9MK06L4irSmF1acKFmKwMVgYzOiJpDkJ9ajdAw4axxo42jHFn5XKQR5l1cVXElZN/HvOZzHfodgfOv4TIcg1zW5yf5iBthBb+AIJ/NWB9opBqcw1sWz+Ep3uWlwEnY2zA4H3UcwLXxJqndaGNutLXD26C7KngJn6I4ZQSTbfF563OngwTLAR1SSoxQFBNyhyFAlS/Y8wNGJgvF20KDNkD7GofQTlqZQsvuSStACiZricKl9O9/EmmYBLE+U3o9vIGA8FUGLzGv//oYTRmXbcId6C03+56rIDhNai4jye0+c+4NFAqPlXdlkdIZq5W1eSeJ+9oR76724VS+q3oE8PfoT+OMuomk5XD6yFSl54Gx+o8RQRWKfHNh1cKEF4XIGkJCdXOgXNJQoellyl4J1Jv91rsve8Ob40G6ZG/VjE1bxm7EQ0wnjpPO8naU8uOIteJJuW4rfEDMh04neVs4DaYtUi1HV4x8OAz3qprdLiSI=; 5:75YnjtNq7dLBxqPiiMnCu9NSYj1S7GQkkkqJdAC1wWs1Z3vB54ao6tEpaDdEJs6fR/vOZGNIX3GhxLpQuLACBfd105m4J3G2yAv5M2H8GWemdDiE4nA9ANzgqM2rOH7AqsiYo7D3C9PS9UpQMZpfUfyywza+q2DlVG/ZZEIw61Y=; 7:F2DRJUN6xzJzEQiJYg5OEaVcPMmFjscUx3RNvxs1IUOarJaJX685Wre2oZ1P3NiLf1nrMC/6rvrftxWqp65kNpyfGrE79fNZas3jpf5jS9rqd+WJ4qt0Q3GGk2K0jHoTJuGfK7b9L1jCZxhDqczgAub9Yh2wt2ajTolKsOekQazAR6Mw29U/ShqTjXY/mzFGkSTbL6gZUSHBSQq6yEP+Beu2kbFJtRJ/nAq2Qo0T/8cZA8D+vIE1BRy9FVMqEAZe x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: ef66bd8d-bab0-4a53-df55-08d634f4ec51 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM4PR05MB1441; x-ms-traffictypediagnostic: AM4PR05MB1441: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3231355)(944501410)(52105095)(3002001)(6055026)(149066)(150057)(6041310)(20161123562045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:AM4PR05MB1441; BCL:0; PCL:0; RULEID:; SRVR:AM4PR05MB1441; x-forefront-prvs: 08296C9B35 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(136003)(346002)(376002)(366004)(199004)(189003)(13464003)(6116002)(74316002)(305945005)(476003)(7736002)(316002)(86362001)(81156014)(186003)(66066001)(81166006)(76176011)(99286004)(11346002)(486006)(8936002)(7696005)(102836004)(53546011)(105586002)(446003)(106356001)(5660300001)(6506007)(14444005)(256004)(68736007)(55016002)(6436002)(2906002)(14454004)(3846002)(53936002)(478600001)(229853002)(25786009)(6246003)(97736004)(26005)(54906003)(2201001)(110136005)(2501003)(2900100001)(5250100002)(4326008)(71200400001)(33656002)(9686003)(71190400001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM4PR05MB1441; H:AM4PR05MB3425.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: cSDm13/9WIcg8oBmjGNVK124m0LDMa7gbdRma36l1kN/IKMA+L2oANpH2C+NdxeBvNIbDNMk9TcEtCb5aVEOctgXZChKjd1usnf4KASl8GEJClkIpE/K+0OvKrKHqJnTpLv2AFk1KytyY68CQvhvHodGrMzk8tSKojxsai1AILtVHPYbPBIsAPcPtMRuLCNhCrnQYo4NuQ0YYfY4Ebfa+FnOfTw/wCCRaWtUYogk5GsWK59lqRiPYI5QlZEN7YIsuSFGoIXRN+ojNtPHR+DJjslOTlxkRCNAtxmAdLjC0KvN1w3VfHE2yghXtd7s7uYxJIZPV21lKIEcSjHgKJhg59glB/5QzMzels1tILQDcAM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM 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: ef66bd8d-bab0-4a53-df55-08d634f4ec51 X-MS-Exchange-CrossTenant-originalarrivaltime: 18 Oct 2018 12:26:25.9365 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM4PR05MB1441 Subject: Re: [dpdk-dev] [PATCH v5 2/3] app/testpmd: support metadata as flow rule item X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Oct 2018 12:26:28 -0000 > -----Original Message----- > From: dev On Behalf Of Dekel Peled > Sent: Wednesday, October 17, 2018 3:04 PM > To: wenzhuo.lu@intel.com; jingjing.wu@intel.com; > bernard.iremonger@intel.com; olivier.matz@6wind.com; Adrien Mazarguil > ; Thomas Monjalon ; > ferruh.yigit@intel.com; arybchenko@solarflare.com > Cc: Shahaf Shuler ; dev@dpdk.org; Ori Kam > > Subject: [dpdk-dev] [PATCH v5 2/3] app/testpmd: support metadata as flow = rule > item >=20 > As described in [1], this series adds option to set metadata value > as match pattern when creating a new flow rule. >=20 > This patch introduces additional options in testpmd commands. > New item type "meta" "data", new offload flag "match_metadata". >=20 > [1] "ethdev: support metadata as flow rule criteria" >=20 > Signed-off-by: Dekel Peled > --- > app/test-pmd/cmdline.c | 10 +++++----- > app/test-pmd/cmdline_flow.c | 25 +++++++++++++++++++++++= ++ > app/test-pmd/testpmd.c | 4 ++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 6 +++++- > 4 files changed, 39 insertions(+), 6 deletions(-) >=20 > diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c > index 6e14345..28bbd80 100644 > --- a/app/test-pmd/cmdline.c > +++ b/app/test-pmd/cmdline.c > @@ -18124,7 +18124,8 @@ struct cmd_config_per_port_tx_offload_result { > "sctp_cksum#tcp_tso#udp_tso#outer_ipv4_cksum#" > "qinq_insert#vxlan_tnl_tso#gre_tnl_tso#" > "ipip_tnl_tso#geneve_tnl_tso#macsec_insert#" > - "mt_lockfree#multi_segs#mbuf_fast_free#security"); > + "mt_lockfree#multi_segs#mbuf_fast_free#security#" > + "match_metadata"); > cmdline_parse_token_string_t cmd_config_per_port_tx_offload_result_on_of= f > =3D > TOKEN_STRING_INITIALIZER > (struct cmd_config_per_port_tx_offload_result, > @@ -18205,8 +18206,8 @@ struct cmd_config_per_port_tx_offload_result { > "sctp_cksum|tcp_tso|udp_tso|outer_ipv4_cksum|" > "qinq_insert|vxlan_tnl_tso|gre_tnl_tso|" > "ipip_tnl_tso|geneve_tnl_tso|macsec_insert|" > - "mt_lockfree|multi_segs|mbuf_fast_free|security " > - "on|off", > + "mt_lockfree|multi_segs|mbuf_fast_free|security|" > + "match_metadata on|off", > .tokens =3D { > (void *)&cmd_config_per_port_tx_offload_result_port, > (void *)&cmd_config_per_port_tx_offload_result_config, > @@ -18309,8 +18310,7 @@ struct cmd_config_per_queue_tx_offload_result { > "sctp_cksum|tcp_tso|udp_tso|outer_ipv4_cksum|" > "qinq_insert|vxlan_tnl_tso|gre_tnl_tso|" > "ipip_tnl_tso|geneve_tnl_tso|macsec_insert|" > - "mt_lockfree|multi_segs|mbuf_fast_free|security " > - "on|off", > + "mt_lockfree|multi_segs|mbuf_fast_free|security on|off", Is this relevant for your patch? > .tokens =3D { > (void *)&cmd_config_per_queue_tx_offload_result_port, > (void *)&cmd_config_per_queue_tx_offload_result_port_id, > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index 1c72ad9..7ee9b7c 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -178,6 +178,8 @@ enum index { > ITEM_ICMP6_ND_OPT_SLA_ETH_SLA, > ITEM_ICMP6_ND_OPT_TLA_ETH, > ITEM_ICMP6_ND_OPT_TLA_ETH_TLA, > + ITEM_META, > + ITEM_META_DATA, >=20 > /* Validate/create actions. */ > ACTIONS, > @@ -599,6 +601,7 @@ struct parse_action_priv { > ITEM_ICMP6_ND_OPT, > ITEM_ICMP6_ND_OPT_SLA_ETH, > ITEM_ICMP6_ND_OPT_TLA_ETH, > + ITEM_META, > ZERO, > }; >=20 > @@ -819,6 +822,12 @@ struct parse_action_priv { > ZERO, > }; >=20 > +static const enum index item_meta[] =3D { > + ITEM_META_DATA, > + ITEM_NEXT, > + ZERO, > +}; > + > static const enum index next_action[] =3D { > ACTION_END, > ACTION_VOID, > @@ -2087,6 +2096,22 @@ static int comp_vc_action_rss_queue(struct context > *, const struct token *, > .args =3D ARGS(ARGS_ENTRY_HTON > (struct rte_flow_item_icmp6_nd_opt_tla_eth, tla)), > }, > + [ITEM_META] =3D { > + .name =3D "meta", > + .help =3D "match metadata header", > + .priv =3D PRIV_ITEM(META, sizeof(struct rte_flow_item_meta)), > + .next =3D NEXT(item_meta), > + .call =3D parse_vc, > + }, > + [ITEM_META_DATA] =3D { > + .name =3D "data", > + .help =3D "metadata value", > + .next =3D NEXT(item_meta, NEXT_ENTRY(UNSIGNED), > item_param), Do you support all the options? (mask, last ...) > + .args =3D ARGS(ARGS_ENTRY_MASK_HTON(struct This means that the value is in network byte order. > rte_flow_item_meta, > + data, > + "\xff\xff\xff\xff" > + "\xff\xff\xff\xff")), > + }, >=20 > /* Validate/create actions. */ > [ACTIONS] =3D { > diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c > index d550bda..75e960a 100644 > --- a/app/test-pmd/testpmd.c > +++ b/app/test-pmd/testpmd.c > @@ -1060,6 +1060,10 @@ struct extmem_param { > DEV_TX_OFFLOAD_MBUF_FAST_FREE)) > port->dev_conf.txmode.offloads &=3D > ~DEV_TX_OFFLOAD_MBUF_FAST_FREE; > + if (!(port->dev_info.tx_offload_capa & > + DEV_TX_OFFLOAD_MATCH_METADATA)) > + port->dev_conf.txmode.offloads &=3D > + ~DEV_TX_OFFLOAD_MATCH_METADATA; > if (numa_support) { > if (port_numa[pid] !=3D NUMA_NO_CONFIG) > port_per_socket[port_numa[pid]]++; > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 8d60bf0..c97f26b 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3671,11 +3671,15 @@ This section lists supported pattern items and th= eir > attributes, if any. >=20 > - ``sla {MAC-48}``: source Ethernet LLA. >=20 > -- ``icmp6_nd_opt_sla_eth``: match ICMPv6 neighbor discovery target Ether= net > +- ``icmp6_nd_opt_tla_eth``: match ICMPv6 neighbor discovery target Ether= net > link-layer address option. Is this relevant to your patch? >=20 > - ``tla {MAC-48}``: target Ethernet LLA. >=20 > +- ``meta``: match application specific metadata. > + > + - ``data``: metadata value. Should show what value to add. Also missing the documentations for enabling the offload. > + > Actions list > ^^^^^^^^^^^^ >=20 > -- > 1.8.3.1 Thanks, Ori