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 A45FFA00BE; Fri, 11 Feb 2022 02:46:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7FD57411EE; Fri, 11 Feb 2022 02:45:58 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2071.outbound.protection.outlook.com [40.107.223.71]) by mails.dpdk.org (Postfix) with ESMTP id 2E17B411DB for ; Fri, 11 Feb 2022 02:45:57 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AgIaYnSfQfaUeWhL8oF90KABejX2uomsJhitJT+cw/rKkPGAeYCpDGXI3creilAYuokuMgep3AuT1eSJapzhDKjtolvdw3EZP8EIUjFdEXE5g3d+a6W4Q4RiFYkUVnt/QrHgVNne9N8AfROZLUDxeV8LqSNvDyrfF7/2KHniMkrcNY1YhSjMQP2bs2XwU7deFSgjh0sQgwK88iSTCAIwuqARO0xcCHAgaJ+KD9abCB66mVKJJY849QJLBiOeNwkFeLgp4L7U/GicS7lwdGnd/xS7lBN7fQ+LJiY5oumoa0byzQAiwqcgwmOBh9eqRMY+aEwkHODhzFrA5W926Zehdg== 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=papK35tKRYH2meNkrvVuXYmtXpxXYlpKXaew5TJ0VNQ=; b=e/HkNxswrZh8EboqMejLcBB6YyUzXA8wneWnEadKu5LA8YxaXbLVLVpykYHLlA67vGHVbjkXm2zohXY1iCrNeRFaZ6d+3r0mY83P8ayH7jcy0P11og4jkRJ1Y8zkMn0HJADqHarDNSPEpZGdZYRnechTKY29NNsUmmnoebfa1F58Odvz5Qn8zHzEqMbgIT4CO0WSYTnLcPnfMf+wdTd0PXJd9Zk5rYdGuZbTiLaF1Y/0WvcQpik6mMKJWeKlmLenCP7lSRNqQcN0Wqbo1HuIGXOHsgJPMxwu5kLG1bv937N4TQlqGQNkr36Ig9PYiDkEUq4zlMxuzQW7bJo/zxhiBA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 12.22.5.238) 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=papK35tKRYH2meNkrvVuXYmtXpxXYlpKXaew5TJ0VNQ=; b=A3shy7k+yDeJkkImyFHiM+rSNs+hZX1Bl1fks4H8uY5j6mOFlKPrIVCwhtfql/9SHxbUzrJ3iPlb1CT3J9Aun9WTnw/3lZAS7vix9aK7N7R2bUYr5Cux5LrGe1I91bFl056rCFXGscpQyxVunovZAbiEfbW0VBNgLVic0hgnmAhS3yg3x+3zAUjshZ2wq9riq1kZX7qsUBWx0JjjbO6zi5tReHFLUFj0VD+7GbN66M1LpP7UMLy1ttkjn1EO9xFXkkMocJ11IFhncZT0YZWmu9vnK8toT4eeC4lT4TK/IDK2wJr4qGMfdfHa7qCwMVrFpx4pQzp09A5L4576KxU4VA== Received: from BN9PR03CA0404.namprd03.prod.outlook.com (2603:10b6:408:111::19) by DM5PR12MB1178.namprd12.prod.outlook.com (2603:10b6:3:6c::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.12; Fri, 11 Feb 2022 01:45:55 +0000 Received: from BN8NAM11FT014.eop-nam11.prod.protection.outlook.com (2603:10b6:408:111:cafe::b0) by BN9PR03CA0404.outlook.office365.com (2603:10b6:408:111::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4975.14 via Frontend Transport; Fri, 11 Feb 2022 01:45:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 12.22.5.238) 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.238 as permitted sender) receiver=protection.outlook.com; client-ip=12.22.5.238; helo=mail.nvidia.com; Received: from mail.nvidia.com (12.22.5.238) by BN8NAM11FT014.mail.protection.outlook.com (10.13.177.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.4975.11 via Frontend Transport; Fri, 11 Feb 2022 01:45:54 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by DRHQMAIL105.nvidia.com (10.27.9.14) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Fri, 11 Feb 2022 01:45:53 +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; Thu, 10 Feb 2022 17:45:51 -0800 From: Sean Zhang To: , , Ori Kam , Andrew Rybchenko CC: Subject: [v2 2/4] ethdev: support GRE optional fields Date: Fri, 11 Feb 2022 03:45:28 +0200 Message-ID: <20220211014530.77711-3-xiazhang@nvidia.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220211014530.77711-1-xiazhang@nvidia.com> References: <20220126084404.40178-1-xiazhang@nvidia.com> <20220211014530.77711-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: rnnvmail202.nvidia.com (10.129.68.7) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9de41719-4c04-4d21-86a4-08d9ed003dd7 X-MS-TrafficTypeDiagnostic: DM5PR12MB1178: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: 5alwLYB5yNKykg7K0T37K2muJp/TPEDQbrzsyh3cw+6ypPPaqADuhPA9Iye+9oCRLG3fH64udANfEQSpKeDVdf1a5xU+3AdqImCSA/+Q6xUZlJA96H/iazRY/gYXEpSWoVP66BEjqjhQdGLw6SFnFWi8LlsHK44g8mjsuizpqfsjcrORE8e0IzLMTBP/pytGIyiy0WmI88sNv25BvWhBmHzWcX3G7vbGJCJwhEMfeF3vha9ewFjZOFxv2IQYLMUJCkNBpd48Vnh46PcpBsH1EBV1QoDzBwgLCVB7BNqS0oR1Tol4p5EJmOlrh3H5fZ/gNZNHMZBIrm0kNGZb4pwgaWyepNnjZGgKZEOIcQd0oPPFix+fOoBcnH5DmmZ6INZYr7R9MvNzW049eCBVCTRHiQ9lP+voffGhxowy1luKkafPaYH2gPey1m7hC/Xm0yg6tTcCHVv6JVhNWznGecXAbas9u1L2wFr7LY1r/em1uVG9XXls/F0sylMkFj9QiCjaT4UkYH6JmRm/pdG8th5WWAWHrWRfCRBTreT7oMtSXq2wd5WMUKXi7pYYg7Ie/rNaUjXWgXaJH6rEeONK/SW/QV4kZxQyqqv9Hj7FXJM7uYu3hgi38g3rAXdWV462Ur0HisxNYamzDilT7qC675/dJlRZv120w2sQuVxke2zmG3sY9VRAELswynGDUw1rUQtLCkwMmHK4szkrmJ9wrpLFDQ== X-Forefront-Antispam-Report: CIP:12.22.5.238; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:mail.nvidia.com; PTR:InfoNoRecords; CAT:NONE; SFS:(13230001)(4636009)(36840700001)(46966006)(40470700004)(426003)(336012)(186003)(6286002)(26005)(7696005)(8676002)(1076003)(4326008)(70206006)(55016003)(70586007)(356005)(82310400004)(8936002)(81166007)(110136005)(16526019)(316002)(6666004)(40460700003)(2616005)(2906002)(47076005)(86362001)(508600001)(36860700001)(36756003)(83380400001)(5660300002)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Feb 2022 01:45:54.1078 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9de41719-4c04-4d21-86a4-08d9ed003dd7 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.238]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM11FT014.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1178 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 +++++++++++++++++ doc/guides/rel_notes/release_22_03.rst | 5 +++++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 19 +++++++++++++++++++ 4 files changed, 42 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/doc/guides/rel_notes/release_22_03.rst b/doc/guides/rel_notes/release_22_03.rst index b20716c..721ce16 100644 --- a/doc/guides/rel_notes/release_22_03.rst +++ b/doc/guides/rel_notes/release_22_03.rst @@ -87,6 +87,11 @@ New Features The new API ``rte_event_eth_rx_adapter_event_port_get()`` was added. +* **Added rte_flow support for matching GRE optional fields.** + + * Added ``gre_option`` item in rte_flow to support checksum/key/sequence + matching in GRE packets. + * **Updated testpmd.** * Called ``rte_ipv4/6_udptcp_cksum_mbuf()`` functions in testpmd csum mode 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..765beb3 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_rsvd checksum_rsvd; + 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