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 70E9EA04A8; Wed, 26 Jan 2022 09:44:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5B86B42730; Wed, 26 Jan 2022 09:44:33 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2057.outbound.protection.outlook.com [40.107.92.57]) by mails.dpdk.org (Postfix) with ESMTP id 76AEF42724 for ; Wed, 26 Jan 2022 09:44:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=H5jzFrlOU7/mIHHciyrZgBfCZaKy6qFRGuVKZ5dwf/RR0XwnCX+3weQhMl3y9XMRU0dakvL8HRHkc87IS4WL4EM+HSd9/Rjfv9zXEFF3sS0ecaR5prnt+SiO2YG3uITh4uCUYpEHyZCpgK3i/RVXYI3STYV/CEIoQmj+saNfNMBqmU9+GRonp0mznbCU6YQ9R3hIAwo4Ud+rajrUQW3nnp2jvd2dVWKj4YYJVFxA4/0vqdmhJ8M1913vxt+grFKMz7oim3dH81dmxY6AAkYS5gTNrWlv0Vfe1jLcUPnffyaA8NYAWcZlP3QisrqXEVqWwf8VXCQsmBaFhpQJEdvM5g== 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=4O4DFuPwDM6lM+dr9PGbgpvCQas9XKYGHYJsniDufPg=; b=PfOqXzMuTrv4GbVdJM3fncobny/gE35hOG+W7JzM59g7vvv1EdQbOP1/XypEiiGIMLDXfJjaIqrcV6NvzPhZssNCRcvK9/pbDJFjHkNRI1Ed23EXKAyYxjCo9cgEoVdUBkJ1k3w9SQL/t4s84rLcTI0wUjWPzpJkGVVcBai3Fkxjp3l7lAbkORdzerQ9nILAhm6y1DN6Tsv57MzBMBBBgtdjeMEH9w1lTFm4X4rRnFWfrMlDk7jGn8N4Unhn4MmpcFD8sC0FZmP3b7XeNLZ0WJ0J2qxSmMJhh3AX4GUcK41E0FmN43Ns863uIzcnrDESY7jWzV3O9s8ZC5mlv9QVTQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.236) 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=4O4DFuPwDM6lM+dr9PGbgpvCQas9XKYGHYJsniDufPg=; b=bIG0UB+OIeOdph18u04c5/+ddgZNebm2SAkIZtLSImwZ+i1GWyXweLnn5kAVp8xNQixpvNNA2ZtZCcVOLJAyTWYppmXnxHSK5ebBzgyovesssq5kB3TdJ/DK6rVD5iUNHfa3IIGqH19iiwqfAMfZn79NTjWQutQ+EgfmumZ6RopmoFG8GHiNnXwoUJ00EIeKerkyTtzs53nPVZhzhm3oWmRjWHQBUPsthAxqe+pu+a9H8ajgkGaDFkFJFCqZqMvWh+gDTntqfpy2KVjxENjIAG90aoj0PZyFwjQGnTGCFJi+romnKdrqXw0yk2WcFQ5BvjcPOPyWswhcXDsanKUYdQ== Received: from MWHPR02CA0012.namprd02.prod.outlook.com (2603:10b6:300:4b::22) by CH2PR12MB3864.namprd12.prod.outlook.com (2603:10b6:610:25::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Wed, 26 Jan 2022 08:44:26 +0000 Received: from CO1NAM11FT052.eop-nam11.prod.protection.outlook.com (2603:10b6:300:4b:cafe::e4) by MWHPR02CA0012.outlook.office365.com (2603:10b6:300:4b::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.7 via Frontend Transport; Wed, 26 Jan 2022 08:44:26 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.236) 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.236 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.236; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.236) by CO1NAM11FT052.mail.protection.outlook.com (10.13.174.225) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4930.15 via Frontend Transport; Wed, 26 Jan 2022 08:44:25 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL109.nvidia.com (10.27.9.19) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Wed, 26 Jan 2022 08:44:24 +0000 Received: from nvidia.com (10.126.231.35) by rnnvmail201.nvidia.com (10.129.68.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.9; Wed, 26 Jan 2022 00:44:22 -0800 From: Sean Zhang To: , Ori Kam , Ferruh Yigit , Andrew Rybchenko CC: Subject: [v1 2/4] ethdev: support GRE optional fields Date: Wed, 26 Jan 2022 10:44:02 +0200 Message-ID: <20220126084404.40178-3-xiazhang@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220126084404.40178-1-xiazhang@nvidia.com> References: <20211230030817.15264-2-xiazhang@nvidia.com> <20220126084404.40178-1-xiazhang@nvidia.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: drhqmail203.nvidia.com (10.126.190.182) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34add2f2-a2dd-4d9e-920c-08d9e0a80e9e X-MS-TrafficTypeDiagnostic: CH2PR12MB3864: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: dK1lgrqbfnDuIvRXEiukyhfU6pRtwvum5crW+LVMuLN5oaA3SjidgdjJ3rS2gSEDGv6Vl/5HK3ThWegYMpGU2qO5VVBwynKfc+XuT7WyKhZISAhT0zdMk9tn6abR18T4cHPz4nT59PrBHIyaLDLcPWoeG/cWP60FrVaSVs33KiXW5uG+ql00ZfIIG6t1R4n+o4M4fgTRg08TtbAWi8bHzkKHhxsjIlx7widOeFw3QXxzm4ZZ9Kmo7H1FNPjg6mHFgrgxcb5TxwPBD2Nq/eFj3ZGJsJQvGrS8rcPHKyXWy8wQCe53Umgy54EUMUMoeFM/4inhGQeV2g+M+hBGx0jJfPhZRzlWX5Asa8hKs4DVyPYteZXb8Y8ly03g6TTh5Z5YWp3/8TmWJneE45sE+UfUCxEmZp3Vr6tA0Szg3DoBMHrdEEJJvnMIaiMvf6sxJU7xOQQ3+BYLGZKGFCqh2pZiDpqdS4HF0Fr73k4LeqmpAiHcsEKneIdYronnocdKx0/wiSbYJlrxqpDDt+5/vvqvmowm7/RJabSd8H3RgES6k3y7QHfaYTe2jSQ0CfrFChZH413D2qX/LGkxFtRFZTgsHmFGTqPmItdmO69YQAKjr+5meSjfQ2z+uX/EUnEmmd0lxzL7EAH0zVV0SCxOwJpph7xt/J2TbTEd6B37qV/yjIWqdBrqqWBeDEDqp0PLXl0MsEcOlHc/uNybYi2p0humhA== X-Forefront-Antispam-Report: CIP:12.22.5.236; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(40470700004)(46966006)(36840700001)(110136005)(55016003)(5660300002)(8676002)(356005)(316002)(2906002)(8936002)(70206006)(70586007)(81166007)(6286002)(4326008)(6666004)(82310400004)(47076005)(1076003)(2616005)(508600001)(86362001)(16526019)(36756003)(26005)(186003)(426003)(336012)(40460700003)(36860700001)(7696005)(36900700001)(20210929001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 08:44:25.2942 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34add2f2-a2dd-4d9e-920c-08d9e0a80e9e 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.236]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CO1NAM11FT052.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR12MB3864 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 | 17 +++++++++++++++++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 19 +++++++++++++++++++ 3 files changed, 37 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index b4aa9c4..0e47501 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -1106,6 +1106,7 @@ Matches a GRE header. Item: ``GRE_KEY`` ^^^^^^^^^^^^^^^^^ +This action is deprecated. Consider `Item: GRE_OPTION`. Matches a GRE key field. This should be preceded by item ``GRE``. @@ -1113,6 +1114,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..7f93900 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_flow_item_gre_opt)), 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..db58b47 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -37,6 +37,7 @@ #include #include #include +#include #ifdef __cplusplus extern "C" { @@ -660,6 +661,13 @@ enum rte_flow_item_type { * See struct rte_flow_item_ppp. */ RTE_FLOW_ITEM_TYPE_PPP, + + /** + * Matches GRE optional fields. + * + * See struct rte_flow_item_gre_opt. + */ + RTE_FLOW_ITEM_TYPE_GRE_OPTION, }; /** @@ -1196,6 +1204,17 @@ struct rte_flow_item_gre { #endif /** + * RTE_FLOW_ITEM_TYPE_GRE_OPTION. + * + * Matches GRE optional fields in header. + */ +struct rte_flow_item_gre_opt { + struct rte_gre_hdr_opt_checksum checksum; + struct rte_gre_hdr_opt_key key; + struct rte_gre_hdr_opt_sequence sequence; +}; + +/** * RTE_FLOW_ITEM_TYPE_FUZZY * * Fuzzy pattern match, expect faster than default. -- 1.8.3.1