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 336CAA0351; Sun, 9 Jan 2022 13:30:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B70D941163; Sun, 9 Jan 2022 13:30:05 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2080.outbound.protection.outlook.com [40.107.244.80]) by mails.dpdk.org (Postfix) with ESMTP id 6608940042 for ; Sun, 9 Jan 2022 13:30:04 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=FEBWy5Q6NyDUNEy/YeqA1t+mKr7Ym5Ak+I47MjfmzLxv2TI4YW8r/VCmU2hHlBCcFGLpztb4Zf7zmEvjWiTB5dB3JFciqyI9C6TBQ2Ykw/NAqlOqc1oWu9wdJgZGtysLeODEU9Jx2fNuk1Y+7mz3Y/NGwkjfE7TQrKZ3WEzYm7j4dNBP59pWQ9eaw0iARReGS54YsPQUJUmdXvBD7uBzIoyxGNhxBVw7nuLQG0yJed680MjlV4igf1xGkxGJE9rc9zpsTZANLPOuiULb5lfxoqb5hjonPTbjk2D3dMycKSFkFuMNyAqLzEli+Nz+TwjBtjriqSyqvp4DuRBRdNRiow== 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=ns54PjMwPHiJifmfNnswsimJzVGB1Fy9uCs6JQEbAvM=; b=iihQ4iqpnfnPP5mGeczvLoDgJ+HMd3SBjssBlONliTX63x3RvLjntia8MG9g6O+KrJZBdJJpha0aJrTIdCSfzoFDrCz+UN28iQUH01V8XUTCn2OyxkVzZUdaUcfz8IzUlRIDQBaeQyxdZBirXAb4lK/tlIftssdp5Mg/jZbR3lP34ap6ZuTBR/VhPmfo8eiXax29sJSx8UK+eBNMuycQaTktkC1akhAL54MZqf/x+L36CrDp5Ai2GbFremBhsPiHB176b/CQ6VBnhsXfYxWF1O2PD6QJODJcS/5ynuX27W/4NeTvmoe9TWQ1ndbIKZBfWldPPmC2Ux5m72VLQhTpHw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ns54PjMwPHiJifmfNnswsimJzVGB1Fy9uCs6JQEbAvM=; b=KkN8Iznme4xhnNDmvFqQMQocnqRJ1sglEvbyd1h1I9Mg8b2eSzBU0KKNoECK/pDlgkjMD1O6WExLBljyUIXulGR7ZUYA//rWas6hA6LBs/iSkf592LS97VFvHRJp0omdzzCciS5y3RLx1KUSMRE9QFk0d+8Vf72WIbF3PC8yce6UU8E9+On68tdI22tJNSQHZKAm3uqrISlBafzKEbWUSzBpMjKQx3xTa93dLAkgm8eIb5AZEk9uJznpvaOXQ8CVynlqrRX9OkL4Rs+mRTKk0zzagYGTFDZk2yc+fIrmqJ2KHKkaskbboL76V1VbSheCOxtZy8oeydgUNeA5bGZeVA== Received: from MW2PR12MB4666.namprd12.prod.outlook.com (2603:10b6:302:13::22) by MWHPR1201MB0159.namprd12.prod.outlook.com (2603:10b6:301:59::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.11; Sun, 9 Jan 2022 12:30:01 +0000 Received: from MW2PR12MB4666.namprd12.prod.outlook.com ([fe80::78:438a:c6b7:1cc1]) by MW2PR12MB4666.namprd12.prod.outlook.com ([fe80::78:438a:c6b7:1cc1%3]) with mapi id 15.20.4867.011; Sun, 9 Jan 2022 12:30:01 +0000 From: Ori Kam To: "Sean Zhang (Networking SW)" , Matan Azrad , "NBU-Contact-Thomas Monjalon (EXTERNAL)" , Ferruh Yigit , Andrew Rybchenko CC: "dev@dpdk.org" Subject: RE: [RFC 1/3] ethdev: support GRE optional fields Thread-Topic: [RFC 1/3] ethdev: support GRE optional fields Thread-Index: AQHX/SqU/7cI7vQpLkqVqKJmDy8VHaxarcHw Date: Sun, 9 Jan 2022 12:30:01 +0000 Message-ID: References: <20211230030817.15264-1-xiazhang@nvidia.com> <20211230030817.15264-2-xiazhang@nvidia.com> In-Reply-To: <20211230030817.15264-2-xiazhang@nvidia.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e4c9d320-dc6f-4e7a-5b87-08d9d36bc1af x-ms-traffictypediagnostic: MWHPR1201MB0159:EE_ x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8882; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: lRTnIl4MciyDwI9mTFtHl/yFUnFmdNK34ORKEL3vKLRPs6diRK62S7ObFrKeeNUAB1mb48i/sx+eyXs11zk+Syws6Vt1ZKnIaQMiDgH+Vh6tItsVk5rPW4VKVZzActMJIQqRwXgm3YfdM4MpthZ2/yOUsrT96wudnJ869FadKlKRrrP34g2Th3cubOSY6bUp2y3C4myipVyEyYXL3aPv/W+kJUKBFvgVG2xevwbx69NiZDuwJe0GhLV2ZSo+4rv9LWhO4XkY7t45Yw6MqJwHdsFXLetnQRro239r8ufBb41FNtBeufbuH+SfQgPFl4tB77JmiOjQ7iVw93MHq1VYnk1nNMfLrdE+2aD8mC7UbslxgytdeQeYQ4UY68xA/ZFuIWbLGn3RD1IQGhZUkFpiQiCb4mZNZNydfOTaS5GdwrSg1AbSQyxruSVVm9UZ2YCZoAvWCR8qPgZl5brTvn750y1oaA2EVZWe3hDILmMD8w/pp2RplQqwvkJgaVyvSnDIe4MeNlVMsbrqnP/a0Y4ygRi/kEr5bO2ea2OIP0Q18D47x+Z6QoIYQgGjiGU+MI0jW1NLgHUEikILlnoDuB/YotPx8f6iUORUK2JNDQnsbywGUaE6NJpCc0cjeSYuJ3VrEMlPPoBSWqfoPP36ppaOLVlaNIoDC3SjJdg1qZSnpUuaSR+xMuYUTrgj+BrzGCRLnxRlJAXPKuQxh8q17sc5Bg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MW2PR12MB4666.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(316002)(86362001)(508600001)(4326008)(38070700005)(26005)(38100700002)(66446008)(2906002)(122000001)(110136005)(66556008)(64756008)(186003)(66946007)(76116006)(33656002)(5660300002)(66476007)(83380400001)(52536014)(9686003)(6506007)(71200400001)(7696005)(8936002)(8676002)(55016003); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?BsGdYGyULSAnQKWFBLDDXK9gQ3ghWWCNKVJ3EodvqKaDNywixMKZ3xPC02sv?= =?us-ascii?Q?d52Gpi0e7Ns1KVfTXi+Lbf+6wNSwbtLjBMZgBYP+Q05EfB25lQaf8sNPlF7W?= =?us-ascii?Q?zlIRizlUU0J3k4arwfGNPioPg91ZsIPm9vRa9LP3tqZY7HM0fgw5MY5I++O5?= =?us-ascii?Q?035Ux8o+/FpzJECQnBpHNlFFnDUp/ZEBLLRbMmjoclb0SMAyhwHIQTik9fcS?= =?us-ascii?Q?9cspkdHwGwz0EWmxCBOM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?Q?Cak9/Vf8qkkVLP/5RqEwL549z6m79i7qWihQGOPI/zC9vt7bD7h4jcuEWikV?= =?us-ascii?Q?LOGwlkDSDg2FvubSTMf0xC/l9TwUmBbKeCxNfQd2eNyU7HrR96XkFm25+9mx?= =?us-ascii?Q?ppT88X46y8p1cOdhhwLmtmcktdz/F3VZG8ao6Ezvx+fJkROtU9cxcI36I8gZ?= =?us-ascii?Q?uQL261Kbrg56Wl8jv7lSkOkdlbUJ52kIOrC2yX77dImRMyCK5JaOrEbgNPWR?= =?us-ascii?Q?pcevNldLVmAk/ZD0w17FSUp49Nfw7FnlhY94kq/QjZhgrp8em5eJTBB7llmF?= =?us-ascii?Q?W2wpQN+qsdV9XP/zYQsDT6kXEwMEGJwB+nUqBltreZhWIfQB+WInkw6/6Lt6?= =?us-ascii?Q?B8ycF0sW7W0dCUohDLhCa1fYDJoBlNC9AIOBBmqJxRSTmVtKHO2rx9gNlPcN?= =?us-ascii?Q?hqR+lZon2e/rxXt3Qdfm8WxJWFshogNxaaim6ZZdakzhyHKdB34EqGJc/G3N?= =?us-ascii?Q?+g=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW2PR12MB4666.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4c9d320-dc6f-4e7a-5b87-08d9d36bc1af X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2022 12:30:01.3467 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: DqCA2804i6sQF8gybnfgz5XtNGP+uKOuL70vi7rHyPPPre4ZLvOCsBYty60wyd2kXRXX8oFu+wN7D28P2KF8ag== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0159 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 Hi Sean, > -----Original Message----- > From: Sean Zhang > Subject: [RFC 1/3] ethdev: support GRE optional fields >=20 > 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. >=20 > 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(+) >=20 > diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/r= te_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= " >=20 > +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`` > ^^^^^^^^^^^^^^^ >=20 > 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)), I think that this new item is making the gre_key redundant, why not deprecate it? > 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, > }; >=20 > /** > @@ -1196,6 +1203,17 @@ struct rte_flow_item_gre { > #endif >=20 > /** > + * 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; > +}; > + > +/** > * RTE_FLOW_ITEM_TYPE_FUZZY > * > * Fuzzy pattern match, expect faster than default. > -- > 1.8.3.1 Best, Ori