From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id F2927A0524; Tue, 13 Apr 2021 19:16:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7118C1611E7; Tue, 13 Apr 2021 19:16:13 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id A94331611E2 for ; Tue, 13 Apr 2021 19:16:11 +0200 (CEST) IronPort-SDR: 6vBM6cMojkgQic/QQPMcEaFFUWq9vIlocvDLd/454u17uessdU8fsVdQ4znwgQv7srF8A988sD YASlSdswwDyQ== X-IronPort-AV: E=McAfee;i="6200,9189,9953"; a="214945957" X-IronPort-AV: E=Sophos;i="5.82,219,1613462400"; d="scan'208";a="214945957" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 10:16:05 -0700 IronPort-SDR: TGOkT6TJbpQpmAq01YrHRumjGhq+sb5+iTsgx20g7yodN7fwzsaAJrPXQm2cm0CflJrLXZ1aPc j2QzMgcKK0DQ== X-IronPort-AV: E=Sophos;i="5.82,219,1613462400"; d="scan'208";a="424344999" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.204.251]) ([10.213.204.251]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 10:16:00 -0700 To: Gregory Etelson , orika@nvidia.com Cc: ajit.khaparde@broadcom.com, andrew.rybchenko@oktetlabs.ru, dev@dpdk.org, jerinj@marvell.com, jerinjacobk@gmail.com, olivier.matz@6wind.com, thomas@monjalon.net, viacheslavo@nvidia.com, matan@nvidia.com, rasland@nvidia.com, Xiaoyun Li References: <20210413151606.11522-1-getelson@nvidia.com> <20210413151606.11522-3-getelson@nvidia.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <44343540-01a4-c576-46d8-502bf1349374@intel.com> Date: Tue, 13 Apr 2021 18:15:57 +0100 MIME-Version: 1.0 In-Reply-To: <20210413151606.11522-3-getelson@nvidia.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v3 2/2] app/testpmd: add support for integrity item X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" On 4/13/2021 4:16 PM, Gregory Etelson wrote: > From: Ori Kam > > The integrity item allows the application to match > on the integrity of a packet. > > use example: > match that packet integrity checks are ok. The checks depend on > packet layers. For example ICMP packet will not check L4 level. > flow create 0 ingress pattern integrity value mask 0x01 value spec 0x01 > match that L4 packet is ok - check L2 & L3 & L4 layers: > flow create 0 ingress pattern integrity value mask 0xfe value spec 0xfe > > Signed-off-by: Ori Kam > Signed-off-by: Gregory Etelson > --- > app/test-pmd/cmdline_flow.c | 39 +++++++++++++++++++++ > doc/guides/testpmd_app_ug/testpmd_funcs.rst | 7 ++++ > 2 files changed, 46 insertions(+) > > diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c > index fb7a3a8bd3..b5dec34325 100644 > --- a/app/test-pmd/cmdline_flow.c > +++ b/app/test-pmd/cmdline_flow.c > @@ -289,6 +289,9 @@ enum index { > ITEM_GENEVE_OPT_TYPE, > ITEM_GENEVE_OPT_LENGTH, > ITEM_GENEVE_OPT_DATA, > + ITEM_INTEGRITY, > + ITEM_INTEGRITY_LEVEL, > + ITEM_INTEGRITY_VALUE, > > /* Validate/create actions. */ > ACTIONS, > @@ -956,6 +959,7 @@ static const enum index next_item[] = { > ITEM_PFCP, > ITEM_ECPRI, > ITEM_GENEVE_OPT, > + ITEM_INTEGRITY, > END_SET, > ZERO, > }; > @@ -1307,6 +1311,19 @@ static const enum index item_geneve_opt[] = { > ZERO, > }; > > +static const enum index item_integrity[] = { > + ITEM_INTEGRITY_LEVEL, > + ITEM_INTEGRITY_VALUE, > + ZERO, > +}; > + > +static const enum index item_integrity_lv[] = { > + ITEM_INTEGRITY_LEVEL, > + ITEM_INTEGRITY_VALUE, > + ITEM_NEXT, > + ZERO, > +}; > + > static const enum index next_action[] = { > ACTION_END, > ACTION_VOID, > @@ -3373,6 +3390,28 @@ static const struct token token_list[] = { > (sizeof(struct rte_flow_item_geneve_opt), > ITEM_GENEVE_OPT_DATA_SIZE)), > }, > + [ITEM_INTEGRITY] = { > + .name = "integrity", > + .help = "match packet integrity", > + .priv = PRIV_ITEM(INTEGRITY, > + sizeof(struct rte_flow_item_integrity)), > + .next = NEXT(item_integrity), > + .call = parse_vc, > + }, > + [ITEM_INTEGRITY_LEVEL] = { > + .name = "level", > + .help = "integrity level", > + .next = NEXT(item_integrity_lv, NEXT_ENTRY(UNSIGNED), > + item_param), > + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_integrity, level)), > + }, > + [ITEM_INTEGRITY_VALUE] = { > + .name = "value", > + .help = "integrity value", > + .next = NEXT(item_integrity_lv, NEXT_ENTRY(UNSIGNED), > + item_param), > + .args = ARGS(ARGS_ENTRY(struct rte_flow_item_integrity, value)), > + }, > /* Validate/create actions. */ > [ACTIONS] = { > .name = "actions", > diff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > index 36f0a328a5..f1ad674336 100644 > --- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst > +++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst > @@ -3783,6 +3783,13 @@ This section lists supported pattern items and their attributes, if any. > - ``s_field {unsigned}``: S field. > - ``seid {unsigned}``: session endpoint identifier. > > +- ``integrity``: match packet integrity. > + > + - ``level {unsigned}``: Packet encapsulation level the item should > + apply to. See rte_flow_action_rss for details. > + - ``value {unsigned}``: A bitmask that specify what packet elements > + must be matched for integrity. > + > Actions list > ^^^^^^^^^^^^ > I was thinking about adding same sample rules, if you check through the end of this same documentation, there are various sections to document samples of various flow commands. Can it be possible to add some samples for the integrity flow rules?