From patchwork Thu Feb 1 12:29:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suanming Mou X-Patchwork-Id: 603 Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5A6C743A39; Thu, 1 Feb 2024 13:30:04 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0BA5B4069F; Thu, 1 Feb 2024 13:30:04 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2071.outbound.protection.outlook.com [40.107.244.71]) by mails.dpdk.org (Postfix) with ESMTP id 07A294021D for ; Thu, 1 Feb 2024 13:30:02 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Khvnz3wnn8hW39qSohohJcfA2fpsS/9a1t+tjbq7PRFyJARnOMFbDrS51w83Xlig0U1BOXr2zUHq5PemxL2+pSc1dH9FngAwhQK5Ihjm3unQ99r7WbIguiPvhWfuOxsf1fcaubJleKajhdV9THgsmoJvawfjSRN3/79BptRGZ2DcUIxVqhqdiE8bFMBDzyhcvi5xDLV0Cba2QBJI4X7aJiDT42NuGvbjXCeT/OhwfEq3Nihqh6jPcn/TFlRlDibkRpdug3gnvC0A/m7UgyeJxDyrTZj7QuJpVU1pZd6uZXESPPK5Ep3zihIKiGKlvVuIjADm5eu4zJQ03vr6cepy9g== 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=M6a7eusW/FYj5MIhsi009eXuEx9yncorJCsv/qTGcAc=; b=BIRNfBcapLd64WsAybEF42V1p2HUfxgZMJuA/SvLmWaOD9y2jEYDE+j8BfWs6Nhhsg7f5JiJfH9HnPa8pY3QiCTI7NkICxa9QPry0kgzXL0ht5a7lRpW7Yag2aUSHiCeLBqYe7Nad+RNUzv9B+8H22Qta+vrI8QAN/8ooPKyUgqgOVbFA++N+zjhKB3gHt1PFD2Lsldtp9BXaO5yi+f3gKfe1aP2YV4MpQhbJrH4dmkhToSgGY1UuSa5fcHGeAVUIt5yXcQAcXOVYknYIA6elzAoQGwNeIRH4krIc60FyQdjPGQ6lrJdvAUAMpf055KfMbQLcPPNw4wB6wl1JbUTAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=amd.com 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 (0) 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=M6a7eusW/FYj5MIhsi009eXuEx9yncorJCsv/qTGcAc=; b=Aakx2TBlq6p2WeP0i8c3PIFAaMDD7IEiuDT007PZbtKdxdJ9RiuXHdX2QAD6ih+nFusyaHpce+NURlJNWf4bWso0URCljkhsqDpgXAbv0YAROfAJxZ87PydTvtrxSW5MssTGixXQi7CalrcDmGTE171X7oHXaZ44ddbj0+EO9XM8nNTrQjadTg/KEA9QAOVEHatzGLNEnvo41wLSjL8/kdyiDMM2U2Xtv2nvIlMlDf26/1Bz+9V+WLUQ+kXmxon88UgA8CXN41X2iAWfZOmZfyIwSdNtO6L1tTzpk7c0iRnUW6sOa1bHCVS54UDdN7jc8UZmyWbXJ2BMyL/F2OPoFA== Received: from CH0PR03CA0389.namprd03.prod.outlook.com (2603:10b6:610:119::28) by DM3PR12MB9435.namprd12.prod.outlook.com (2603:10b6:0:40::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.22; Thu, 1 Feb 2024 12:30:00 +0000 Received: from CH2PEPF000000A0.namprd02.prod.outlook.com (2603:10b6:610:119:cafe::5d) by CH0PR03CA0389.outlook.office365.com (2603:10b6:610:119::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.24 via Frontend Transport; Thu, 1 Feb 2024 12:30:00 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 216.228.117.160) 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 216.228.117.160 as permitted sender) receiver=protection.outlook.com; client-ip=216.228.117.160; helo=mail.nvidia.com; pr=C Received: from mail.nvidia.com (216.228.117.160) by CH2PEPF000000A0.mail.protection.outlook.com (10.167.244.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7249.19 via Frontend Transport; Thu, 1 Feb 2024 12:30:00 +0000 Received: from rnnvmail201.nvidia.com (10.129.68.8) by mail.nvidia.com (10.129.200.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.41; Thu, 1 Feb 2024 04:29:48 -0800 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.41; Thu, 1 Feb 2024 04:29:46 -0800 From: Suanming Mou To: CC: , Subject: [PATCH v5 0/3] ethdev: add RTE_FLOW_ITEM_TYPE_COMPARE Date: Thu, 1 Feb 2024 20:29:19 +0800 Message-ID: <20240201122922.474250-1-suanmingm@nvidia.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20231214031227.363911-1-suanmingm@nvidia.com> References: <20231214031227.363911-1-suanmingm@nvidia.com> MIME-Version: 1.0 X-Originating-IP: [10.126.231.35] X-ClientProxiedBy: rnnvmail201.nvidia.com (10.129.68.8) To rnnvmail201.nvidia.com (10.129.68.8) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PEPF000000A0:EE_|DM3PR12MB9435:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a148da1-15c1-41cf-f0fb-08dc232181ff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u0Hg6Exy4fVBDG95O/nTpaBmXe87eUB9FU9Ut+BKmPxeKpuxir9kDRm+1o4szkG3SNKcRrMR3d9qaTvMid81DNSoEwL1QGqAvYQZxpfP1wmsT980TwXmut96gLN7WINwvgCOuXn8HNdR2E0qDX9BjfbOlQ1GotckaspbWFcjOMN1W74e4LGCH0l+RVah66dD2BGMBt8lbd+sXzpxekyUzv1U+R2mWXMUw1NuIIVdtupTV2RJI/UG0QRhwRSS++eV5WrcDZcmt1NP++wcXKjQHSVJTL58etiX/nSn3ZxQ08Ao/burtUJHZWusIMFgmgvCHBevE6V7lsinZPgrtzAA1YIaSsvVC8WEUv8cJ0SmQ+eXooKVU0KYjOdiBbSl/N6+qIe0nNwpuGTIe9YZ6BnzyUXukE2TBAvcHRwOKmGAGkdcwkHSPjntjA03suln01zRa/nwT2FQS3hiSQdtTsW5q+WMeRbKb8BO1MIGDrtKZ0QNlcWDieDVHi2me5T67iiEZWHmU/oslRglMuiA/rGb5BtK0DsH5bJ7XLcnnbNMrjVUVANAFStVDdLgdhHqt9tpz3l6R7Hy40AZ5M5HFOXJ/t5Kday8CCX3Fo+l22LcDqaYSBXrg9CCN4N1BEX8wBAxPs8nTJh+eLxb/ODt4sz3CY+WC7jjY2ZwHtP5uwKWjf0T37huAeCzDrNC+0dcoHz7y66zpxLCLDU7vaHOxc9fCDHyqJ0e7B9Khj5in8NKMAk= X-Forefront-Antispam-Report: CIP:216.228.117.160; CTRY:US; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:mail.nvidia.com; PTR:dc6edge1.nvidia.com; CAT:NONE; SFS:(13230031)(4636009)(346002)(376002)(396003)(136003)(39860400002)(230922051799003)(64100799003)(1800799012)(186009)(451199024)(82310400011)(46966006)(40470700004)(36840700001)(8676002)(54906003)(70206006)(47076005)(6916009)(70586007)(478600001)(316002)(8936002)(6666004)(7696005)(4326008)(1076003)(336012)(6286002)(2616005)(83380400001)(2906002)(426003)(82740400003)(36860700001)(55016003)(5660300002)(16526019)(107886003)(26005)(356005)(7636003)(40460700003)(36756003)(41300700001)(40480700001)(86362001); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Feb 2024 12:30:00.0131 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a148da1-15c1-41cf-f0fb-08dc232181ff X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=43083d15-7273-40c1-b7db-39efd9ccc17a; Ip=[216.228.117.160]; Helo=[mail.nvidia.com] X-MS-Exchange-CrossTenant-AuthSource: CH2PEPF000000A0.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB9435 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 The new item type is added for the case user wants to match traffic based on packet field compare result with other fields or immediate value. e.g. take advantage the compare item user will be able to accumulate a IPv4/TCP packet's TCP data_offset and IPv4 IHL field to a tag register, then compare the tag register with IPv4 header total length to understand the packet has payload or not. The supported operations can be as below: - RTE_FLOW_ITEM_COMPARE_EQ (equal) - RTE_FLOW_ITEM_COMPARE_NE (not equal) - RTE_FLOW_ITEM_COMPARE_LT (less than) - RTE_FLOW_ITEM_COMPARE_LE (less than or equal) - RTE_FLOW_ITEM_COMPARE_GT (great than) - RTE_FLOW_ITEM_COMPARE_GE (great than or equal) V5: - rebase on top of next-net - add sample detail for rte_flow_field. V4: - rebase on top of the latest version. - move ACTION_MODIFY_PATTERN_SIZE and modify_field_ids rename to first patch. - add comparison flow create sample in testpmd_funcs.rst. V3: - fix code style missing empty line in rte_flow.rst. - fix missing the ABI change release notes. V2: - Since modify field data struct is experiment, rename modify field data directly instead of adding new flow field struct. Suanming Mou (3): ethdev: rename action modify field data structure ethdev: add compare item net/mlx5: add compare item support app/test-pmd/cmdline_flow.c | 416 +++++++++++++++++++- doc/guides/nics/features/default.ini | 1 + doc/guides/nics/features/mlx5.ini | 1 + doc/guides/nics/mlx5.rst | 7 + doc/guides/prog_guide/rte_flow.rst | 9 +- doc/guides/rel_notes/release_24_03.rst | 8 + doc/guides/testpmd_app_ug/testpmd_funcs.rst | 24 ++ drivers/net/mlx5/mlx5_flow.c | 4 +- drivers/net/mlx5/mlx5_flow.h | 9 +- drivers/net/mlx5/mlx5_flow_dv.c | 10 +- drivers/net/mlx5/mlx5_flow_hw.c | 73 ++++ lib/ethdev/rte_flow.c | 1 + lib/ethdev/rte_flow.h | 332 +++++++++------- 13 files changed, 726 insertions(+), 169 deletions(-)