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 DA942A0524; Tue, 13 Apr 2021 10:14:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 526DB160748; Tue, 13 Apr 2021 10:14:20 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id AE0B5160C2C for ; Tue, 13 Apr 2021 10:14:18 +0200 (CEST) IronPort-SDR: vFVWSrUmIb0qj0knQfCe2qYCXBNFIwbt/BArX7CX5xW6XxSdaBPol1BIHggESlHZe+hQLiwd3Y NTGd9j5O84nw== X-IronPort-AV: E=McAfee;i="6200,9189,9952"; a="194479844" X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="194479844" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 01:14:17 -0700 IronPort-SDR: DKssctU35eLLidhCWRFrERBXUHPEPNnEK7XVhVHJgK7AOS2/Vbuy2ta9sZiyod5pnBFlP0O7Lc Ipm7Gqr6M7Jw== X-IronPort-AV: E=Sophos;i="5.82,218,1613462400"; d="scan'208";a="460497486" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.213.204.251]) ([10.213.204.251]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Apr 2021 01:14:14 -0700 To: Ori Kam , Gregory Etelson Cc: "ajit.khaparde@broadcom.com" , "andrew.rybchenko@oktetlabs.ru" , "dev@dpdk.org" , "jerinj@marvell.com" , "olivier.matz@6wind.com" , NBU-Contact-Thomas Monjalon , Slava Ovsiienko , Xiaoyun Li References: <1617645874-105139-1-git-send-email-orika@nvidia.com> <20210411173414.12568-1-getelson@nvidia.com> <20210411173414.12568-3-getelson@nvidia.com> <05094aab-c829-dfe3-7b8b-d8c64d236d44@intel.com> From: Ferruh Yigit X-User: ferruhy Message-ID: <8bcfa23e-e7bc-09fc-eb83-f5637e41110d@intel.com> Date: Tue, 13 Apr 2021 09:14:11 +0100 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v2 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 8:53 AM, Ori Kam wrote: > Hi Ferruh, > >> -----Original Message----- >> From: Ferruh Yigit >> >> On 4/11/2021 6:34 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 >>> --- >>> v2 add testpmd patch >>> --- >>> app/test-pmd/cmdline_flow.c | 39 >> +++++++++++++++++++++++++++++++++++++ >> >> Hi Gregory, Ori, >> >> Can you add some samples to "testpmd_funcs.rst#flow-rules-management"? >> >> I asked in some other thread but did not get any response, what do you think to >> make 'testpmd_funcs.rst' sample update mandatory when testpmd flow added? >> > I fully agree that each new function should be mandatory, What is new function here, new flow API? That should go to flow API documentation, 'rte_flow.rst'. > The question is do we want that each new item / action (they use existing function) > I think it is a bit of overhead but I don't have strong opinion. > Since the documentation is for the testpmd usage sample, I was thinking to add sample for each new item & action indeed. Same of the flow rules not widely used, and it is not always clear how to use them, that is why I believe documenting samples can help. >> >>> 1 file changed, 39 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", >>> >