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 C591FA04A4; Wed, 19 Jan 2022 10:53:56 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A63F9410F3; Wed, 19 Jan 2022 10:53:56 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 737004013F for ; Wed, 19 Jan 2022 10:53:54 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642586034; x=1674122034; h=message-id:date:to:cc:references:from:subject: in-reply-to:content-transfer-encoding:mime-version; bh=VNTeXr91Dv0L3d2Mn63M3gp3VPoBCYEL9MOm4LAi09Q=; b=GAS1Mkh2s6gfO1SR0T4808tz+g6/S7WQTKSe7sWgraQCVUuRW7uEweP5 OfgJmdUrcGzO/FXtR1O0bskXkvOQOpXEZdMIo/d3NzaUgHo72y80Uv9i6 UEeZ5XaPu22q+AbnaHcXFggto0oSFP+0SQs4dFv7nkW72n5jT6C95abEe RA8iBlK/uL+iGtARhrvK4ra0g6oF2WHVYuy/KTMnKbWXG2ua93Y2iFAOx MiEN4xmETndn2QWi1jwUUXGfJdA50E8Lmy8JqAKuujjkWBgqnpsxvlsqP Rh0b/kMsJ3F1CJOWB0GpfUwoeiPPjoXDAGghPeu2LoIk0z2S/ku8Sl1ja A==; X-IronPort-AV: E=McAfee;i="6200,9189,10231"; a="269420368" X-IronPort-AV: E=Sophos;i="5.88,299,1635231600"; d="scan'208";a="269420368" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jan 2022 01:53:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,299,1635231600"; d="scan'208";a="615652430" Received: from orsmsx604.amr.corp.intel.com ([10.22.229.17]) by FMSMGA003.fm.intel.com with ESMTP; 19 Jan 2022 01:53:52 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 19 Jan 2022 01:53:49 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 19 Jan 2022 01:53:49 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 19 Jan 2022 01:53:49 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.49) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 19 Jan 2022 01:53:49 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MlmTNtgYDGO2RRHEC6jITfbFckfKZKg2MQmTWafOA2SR5N5OoaBhcHYBgD/jrNlKpFW6rUDiDXWosSH7fStyw7L+YuvE/Z4dvOi3kjI63GiXNExKh4EwaHB7FKhG6IIax4J4QmlxR67Ktrav966fjpwIbAjlKLlLfclBFzolljJCahRf1aFgKAbOZqA3ZsUCzbAEjl00ck86meeSBBDpopXLdkhxc/0srBYEMlkGQR7qbOsxFkEsS5nvpUlzcwtyW5//dfeV+zFJQ7ROIpmBBmjIzS/FW4zaK61rNbov8LTKC4d5ouioancQzkL/VQ8+qBk6VOPZttxU32vX+whKBQ== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=PvPADayorp3xB5fldZV8PQn78XINbzigYqinHdc+CpQ=; b=R9FWjl/TrtAjoPWvSdNeyertJWU1Njok+xXcv/bttMj6tBTp1cxiRE1qiXEbjD8jY6xL3UcngVmbG1oM3gYSlPVYZ90kGahmqSxG80xsj5DnnOFMESD3wpoWxUZJo1L6vqNZieJqQvLZxP90dWa+0pu92j1uQusRv7oNX4IG8Y8j240MPdtqgRQqn8TDgTno7woZF47SwJRZZ6popdIcQJgwEL7rrPEFBhwcM3nPoxgcoVUGgmaj1pJXXYJWbBvmDXFEwXBRNraey3lnDHtZa1wgeWftJ7nj98CvFtxop8+d0CCBpeldqaIFPfyDfL+OcBT7DCHc0Rxs0GoYbJByyA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) by BY5PR11MB4166.namprd11.prod.outlook.com (2603:10b6:a03:191::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4888.12; Wed, 19 Jan 2022 09:53:47 +0000 Received: from PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e]) by PH0PR11MB5000.namprd11.prod.outlook.com ([fe80::5046:8550:928d:850e%7]) with mapi id 15.20.4909.008; Wed, 19 Jan 2022 09:53:47 +0000 Message-ID: <002b1f85-0871-a02f-0345-1b19d722762a@intel.com> Date: Wed, 19 Jan 2022 09:53:42 +0000 Content-Language: en-US To: Sean Zhang , , , Thomas Monjalon , Andrew Rybchenko CC: References: <20211230030817.15264-1-xiazhang@nvidia.com> <20211230030817.15264-2-xiazhang@nvidia.com> From: Ferruh Yigit Subject: Re: [RFC 1/3] ethdev: support GRE optional fields X-User: ferruhy In-Reply-To: <20211230030817.15264-2-xiazhang@nvidia.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P123CA0352.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:18d::15) To PH0PR11MB5000.namprd11.prod.outlook.com (2603:10b6:510:41::19) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 20915230-5934-46fb-0ebf-08d9db319695 X-MS-TrafficTypeDiagnostic: BY5PR11MB4166:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:8273; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PY7h0v1Su1hhO0RzkBVRR/RcjVKpkfArt4Kkuug0YDLc2sWfuKF5O2d0Gam68TYcF1uc0085giqDTKCMYCmdcrw6IWKwoFpxkyCAZZcauGU6Tq7ISBd+E+Z/0B1c4bh/crnr07M5qAQHqqJzBFTe8Y6p/M8k2dIvIeX2xFCbLYolMQBB8khfkkpUqFTQrN3YsYZa+utN5S/i0rGi8GUGXVHii0kh4buio2RKbfZ401uRUP6rnYwFiMCJlx426Lia1+LhYT6lP+WySez2C48Dv7Vvt+ZgAGOtBxRDim+PdVktsQgQY7XyaJV7DJBeghHww03bqb7Ii7aWKyi52mFcG7ZHzcFAnPjZ6hwlGQcHZo8V//Robgh8/voJb/WTDdbvSeEypn1Uw0FDUCfgHy+gQZqaaecL2n6Cygl81cLxjTlQRrLja44PxBhIR4dfBV5GzEHPOJeMlWmJxUkGmbfHpGldqnMWe4Qp0FIhUTeZERM3wultx+ppiqIishgaMrICQe1a7enTmtfJ70/aP3p3hV9x/cBkcKMd+0VuH8hKIoqB5VMeT6m0BzFmxTz59S6anz9y0dccPm6nFnEc/KEqpVFbz8M5odkH+xfnbFX82eW55tM4o/VZ6BL6pjCnFekdoNQ3J8FIP2C3KvK3rdkKay7LU07cXD4cF5vRROEP8DxWlBC5QKHUHcT9Lir1h/MWuqO7B2xMjj1Xsxs+m106wQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH0PR11MB5000.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(83380400001)(6512007)(86362001)(4326008)(66946007)(2616005)(82960400001)(5660300002)(38100700002)(6666004)(2906002)(53546011)(316002)(110136005)(44832011)(31686004)(31696002)(8676002)(186003)(36756003)(6486002)(8936002)(508600001)(66476007)(26005)(66556008)(6506007)(45980500001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TjRsN3NsWEdSNVJ2bXlrNnlQMWJ2RVo3bGJQS1NpbUUySHZhQlpYOUlpdmV0?= =?utf-8?B?cjE5dk56eSs0SW1KVmJualpHUWFrdVZuUS9GN3Nxc2lveFFHaEQrN29hNlYx?= =?utf-8?B?a3lqempEak8yRVdJL1VlWUJxUjREdExCczJlTTFMQTF4dmV4TnhoV0FZcldQ?= =?utf-8?B?L1YrOFpUL2VkSEswWTVLQmczTE95azZROWdVQW9XN0VqU0ZYSzJnU01NZGJD?= =?utf-8?B?QzVKQi80ZHRzVW83U0ZEMXI5dTNaVGRQMzB5WEZLWjJ1RUU2dEY3ZVNqY0FY?= =?utf-8?B?azA3aHh4UWR2b3c0dnozU2FpWjZENzhHejlXZksySGpCc0YrMW45alU3YkVB?= =?utf-8?B?RkVMaGdiRWpDaFFueUsxMGorTStFT25Wc2ZuVFNyNEdPcXNSMWdaZTl2c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= X-MS-Exchange-CrossTenant-Network-Message-Id: 20915230-5934-46fb-0ebf-08d9db319695 X-MS-Exchange-CrossTenant-AuthSource: PH0PR11MB5000.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jan 2022 09:53:47.8210 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Mt1mdl/ptB1Vg8Q8jao6RFfb8gTHo1RzeO4ZDqz1/1JEjaDetVjI+dlUvREH5fQn8S2EZdb1KUaII4D9CN/Fgg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB4166 X-OriginatorOrg: intel.com 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 On 12/30/2021 3:08 AM, Sean Zhang wrote: > Add flow pattern items and header format for matching optional fields > (checksum/key/sequence) in GRE header. And the flags in gre item should > be correspondingly set with the new added items. > > Signed-off-by: Sean Zhang > --- > doc/guides/prog_guide/rte_flow.rst | 16 ++++++++++++++++ > lib/ethdev/rte_flow.c | 1 + > lib/ethdev/rte_flow.h | 18 ++++++++++++++++++ > 3 files changed, 35 insertions(+) > > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst > index c51ed88..48d5685 100644 > --- a/doc/guides/prog_guide/rte_flow.rst > +++ b/doc/guides/prog_guide/rte_flow.rst > @@ -1113,6 +1113,22 @@ This should be preceded by item ``GRE``. > - Value to be matched is a big-endian 32 bit integer. > - When this item present it implicitly match K bit in default mask as "1" > > +Item: ``GRE_OPTION`` > +^^^^^^^^^^^^^^^^^^^^ > + > +Matches a GRE optional fields (checksum/key/sequence). > +This should be preceded by item ``GRE``. > + > +- ``checksum``: checksum. > +- ``key``: key. > +- ``sequence``: sequence. > +- The items in GRE_OPTION do not change bit flags(c_bit/k_bit/s_bit) in GRE > + item. The bit flags need be set with GRE item by application. When the items > + present, the corresponding bits in GRE spec and mask should be set "1" by > + application, it means to match specified value of the fields. When the items > + no present, but the corresponding bits in GRE spec and mask is "1", it means > + to match any value of the fields. > + > Item: ``FUZZY`` > ^^^^^^^^^^^^^^^ > > diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c > index a93f68a..03bd1df 100644 > --- a/lib/ethdev/rte_flow.c > +++ b/lib/ethdev/rte_flow.c > @@ -139,6 +139,7 @@ struct rte_flow_desc_data { > 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(GRE_OPTION, sizeof(struct rte_gre_hdr_option)), > MK_FLOW_ITEM(GTP_PSC, sizeof(struct rte_flow_item_gtp_psc)), > MK_FLOW_ITEM(PPPOES, sizeof(struct rte_flow_item_pppoe)), > MK_FLOW_ITEM(PPPOED, sizeof(struct rte_flow_item_pppoe)), > diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h > index 1031fb2..27b4140 100644 > --- a/lib/ethdev/rte_flow.h > +++ b/lib/ethdev/rte_flow.h > @@ -660,6 +660,13 @@ enum rte_flow_item_type { > * See struct rte_flow_item_ppp. > */ > RTE_FLOW_ITEM_TYPE_PPP, > + > + /** > + * Matches GRE optional fields. > + * > + * See struct rte_gre_hdr_option. > + */ > + RTE_FLOW_ITEM_TYPE_GRE_OPTION, > }; > > /** > @@ -1196,6 +1203,17 @@ struct rte_flow_item_gre { > #endif > > /** > + * RTE_FLOW_ITEM_TYPE_GRE_OPTION. > + * > + * Matches GRE optional fields in header. > + */ > +struct rte_gre_hdr_option { > + rte_be16_t checksum; > + rte_be32_t key; > + rte_be32_t sequence; > +}; > + Hi Ori, Andrew, The decision was to have protocol structs in the net library and flow structs use from there, wasn't it? (Btw, a deprecation notice is still pending to clear some existing ones) So for the GRE optional fields, what about having a struct in the 'rte_gre.h'? (Also perhaps an GRE extended protocol header can be defined combining 'rte_gre_hdr' and optional fields struct.) Later flow API struct can embed that struct.