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 A7C35A00C2; Thu, 30 Dec 2021 04:08:47 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A8AC141104; Thu, 30 Dec 2021 04:08:43 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2045.outbound.protection.outlook.com [40.107.243.45]) by mails.dpdk.org (Postfix) with ESMTP id 7AE7E410E6 for ; Thu, 30 Dec 2021 04:08:41 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AAtHWtZVnnS4BowFXxzijKw6O7wv6Tj+TMcKZHjTUnx0U+yOyt8VtYqAMotGcANDVIS5vlBUBwm9lqFd8hJP3IIP6TFSXbL6Z4yklI71bE5YGdcHDEe9WQjDrpjgWYOaKQRAIlAza6Ux08gp87JdE1B09mnLFP0/vlvCiE32iWfb5FAYPK3t9oTwdakj2shHE4uRgSJi9vtffj00QTklnX881urr/gXf026mftEI5KZymr4RXfDnK4mtZKz0XAbCkODkM5+wzY0VgCNWFZcsXiUY9PLyWoUGY8HdsoUFIp/kNPPaTAS90WLGW04WONvnvQ1uToDohIYXHAQoFG0UbA== 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=U4uDRIC0OctsQXvwse9RN/0dNAMpTEwd0/p86isK/6c=; b=e38jmO3T5r6vrzHWpy04jl4q59Plneb50PkHnVRlt+FO5gcuGfzIaZ3FD0jXzv4u2NXUU0r0SJ2CMDXWPKZeBpJ1gD0jHWIel6kNL7S+vDySQEYgtnmdrQUrKKToq7r5CZBBuhOQ4/0zx8sCqKQLw2gqbN2BgeQCkJQQ0dKw036WSCTpUhEZsqowdxnyNNcZMB4cVcFSsshwL0GCN51U6cL0nI1KzXL9VUTBsuxcy0q1W9ovOBHjcZmIdivkYSDNY7k90sm7qsXiLBXC6X4n+sTIP3Crn9zd49yj0Fyg6LGz4GPCknxbejIU8F3CTNrOasDEMeD3rJ8vEPYZJ/UAgQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.234) smtp.rcpttodomain=oktetlabs.ru smtp.mailfrom=nvidia.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nvidia.com; dkim=none (message not signed); 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=U4uDRIC0OctsQXvwse9RN/0dNAMpTEwd0/p86isK/6c=; b=SbhZwO6umHsPaACUnNqjbuFEqx61x7WKSX6GRD/UHp6pX/WTgFzkjy1RgHNwHL6wKHH/XexqwTemzBcPZ8w2/5nL9NbAldSEBCwxC4F8rq5itqxVe54VcVcb/b+Ay0mTZr1Yb7AjYCTGeQCcSyiKd2g2zRFnwA57S8+1k7teTeEnxrn0TviPrgYxHCPK2xWouFRvcSUV/w+tt5dKACqpDPIJ/ygdWl+AJiyh7YR19Ehy8JvsBydKRnDwVyAQFRaXo02R9zspgN7OINfs0VafJS4C2Wqu928by1lgdPQLGVSSU3wMro9NcIfHfS5JTGSQHdVGYFoo/dXYl8YlUHBzKA== Received: from CO1PR15CA0058.namprd15.prod.outlook.com (2603:10b6:101:1f::26) by DM6PR12MB4298.namprd12.prod.outlook.com (2603:10b6:5:21e::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19; Thu, 30 Dec 2021 03:08:39 +0000 Received: from CO1NAM11FT006.eop-nam11.prod.protection.outlook.com (2603:10b6:101:1f:cafe::2f) by CO1PR15CA0058.outlook.office365.com (2603:10b6:101:1f::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4823.19 via Frontend Transport; Thu, 30 Dec 2021 03:08:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.234) smtp.mailfrom=nvidia.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nvidia.com; Received-SPF: Pass (protection.outlook.com: domain of nvidia.com designates 12.22.5.234 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.234; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.234) by CO1NAM11FT006.mail.protection.outlook.com (10.13.174.246) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4844.14 via Frontend Transport; Thu, 30 Dec 2021 03:08:38 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL101.nvidia.com (10.27.9.10) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Thu, 30 Dec 2021 03:08:37 +0000 Received: from nvidia.com (172.20.187.6) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.986.9; Wed, 29 Dec 2021 19:08:35 -0800 From: Sean Zhang To: , , Thomas Monjalon , Ferruh Yigit , "Andrew Rybchenko" CC: Subject: [RFC 1/3] ethdev: support GRE optional fields Date: Thu, 30 Dec 2021 05:08:15 +0200 Message-ID: <20211230030817.15264-2-xiazhang@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211230030817.15264-1-xiazhang@nvidia.com> References: <20211230030817.15264-1-xiazhang@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.20.187.6] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4e9acb27-72c3-4c75-ffac-08d9cb41ace5 X-MS-TrafficTypeDiagnostic: DM6PR12MB4298:EE_ X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:9508; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: opVA75uDmfuDmEZcazWXIQaKc6jL2HDFuSfhgk37teo837Zfd56qb+HAgZsGQ/rUgMIUZFM7nVwznXYtzMOZzeVzXq5w1vyBHHWRqIhOB9luxh4Cyifcl9XiIXU1r4Dgv/ZsLTE1ExJ7lxCFHBE5kLlWxPZ8NwO1d46Ww+JepuEEiUg4XwnhTIIx90sNTTsq3VmY1ORyJQYXok4T2w6Rnq4VONH9QSHJyB4BhPSU9IdoCkNjex6BD0cXPQv3WMX28YAwsr2shBkNZ4BKLtH9uZGBHKPaFgrMBUSNe/xiHFd7uF2EBMZCf/076ERvakN+mqT5xjY61SFgN85+a6CtLF9MIAZBZkILChubskbFLlvt2Ws44mzQSJKG80E/ipP/x11qS/LKRg6A33Ygcymb2iD13GJFNTXb4yHmtXalqIN6obbc4htPyqTh4zc8M09iGAXd00UJgTjI2f8fa5WQBMLFLwmBv7PKAN53nejJQLPi2bmaNbNZLZmaedrLeYe5uug4W/MZ3AlXOneJJa1fVxIOX0YETsCPwIAT7Xe4vEDdBkTIc8unolhWz6Jn2UZW70nprMcI7yYu7LacNe99MObt4F66mPUTZQXPPhE1VYZY0tCxxYMK3gitdCuQWGOORtnFZipeEjZKm1kRJZMcuwkrTooMMaj+2pmyyKb3hD14t58y+WANSITC1HQk4k8OpSEOGL+7QlY8NvvFW4hbpt/PHQLIytXeDBxbdi3M+KGpGtDvZOqLP1bREo9rRlYScGq9ytmWmAv4sc33wgxjoeds+aRcxV0mEM2wPMZPty0= X-Forefront-Antispam-Report: CIP:12.22.5.234; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(4636009)(46966006)(40470700002)(36840700001)(7696005)(8676002)(186003)(81166007)(47076005)(86362001)(70206006)(8936002)(426003)(36860700001)(70586007)(6286002)(508600001)(16526019)(26005)(55016003)(336012)(2616005)(6666004)(4326008)(110136005)(316002)(40460700001)(82310400004)(356005)(36756003)(5660300002)(1076003)(2906002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Dec 2021 03:08:38.2609 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4e9acb27-72c3-4c75-ffac-08d9cb41ace5 X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[12.22.5.234]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT006.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4298 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 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; +}; + +/** * RTE_FLOW_ITEM_TYPE_FUZZY * * Fuzzy pattern match, expect faster than default. -- 1.8.3.1