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 5816A43E8E; Wed, 17 Apr 2024 09:23:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 31ABB402D9; Wed, 17 Apr 2024 09:23:30 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2069.outbound.protection.outlook.com [40.107.223.69]) by mails.dpdk.org (Postfix) with ESMTP id B15EA4029C for ; Wed, 17 Apr 2024 09:23:28 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HeZmV0UE6oxDWplSrnlfSyWd9gF07nI0Ez6Gqfe3oIgi2SB2k0sWzphDYhqwDdfluvSrwcgQaCTFsWmbec23NkmqHNjdsror0Bf3Q4jYcmc5vrU80OdV+1twzfjty48iW1Ek5pYu0kk3IHS8IW32RLSP71gIwR02/NutwBxGrfJUGM3HoOGkKgJb+9Fy0523hu/IfvIZUOXZg5LwLRsvW4BAXarRE43SZyvTgUtZs0UvR1ZL+KSdOev2IBnNEH4+iMmt+V63unkYOCiz7OJg9gtuDRN2Y+uy2DillIVsGTe8ErcTnExUbHBbeSglZ1URskDKmY9WAKjkiLQQbbrgbw== 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=zEzWNMv2XmbrKo+Q5J0nUmrWhrE72X2FfQmf2uZCeJY=; b=fjLnb0juioIGUdv1oCpYGf7d+t8ACklZMG2M+j92SwlRYRBei+RqiDhoEoe/HeSAq35IY9QLi71uEYmccuw89XTbC3uVXxajP7LRTURDMOpm1qfv6OyS+m6bjjDcRsFrvyhs28JkHGeuXc/7mm6My8y/BPQiVzYwQIdXWjSXDHE4PAsbhiuhXqsqk56s7pT1P0LsST9jlYotvXyEvlugohxY6+RekHaxxpJEAbHflXZYVKArOjVIPaJ5iPyWuDvT9ajrF0J9SOGTF/sAb+QFbpzcrEqrLY1H+j5ANfB7CIykPcKVz2aVZVOoviTR5nksYMx+ab+DXshJBsIFzVNkqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 216.228.117.160) smtp.rcpttodomain=dpdk.org 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=zEzWNMv2XmbrKo+Q5J0nUmrWhrE72X2FfQmf2uZCeJY=; b=Jlr5z7rU0rsm2ywi9O4SrmZn9twK2VR7FeJoU0n3MgpS9nnPF+qFGcikfP9yriJl66SF7jkS9yr25yTi/QCIHzwTpEQsU895vewh8cEX7waE254xSOKWZLJM5o4bNX0OxTtSDq5uhCfCyfrtvJLcg0ctjyIZ8d9Wjp6Ok+cGMLEZ1/EBjKq2zBfRHW9PpTHXi874CZTGMTqtpCgkBjHFwEFXf+th5VyYSn6LdOtDg32kxpHu5IFJU3fNgpgjiJsn4bCmF+x7XMRhQ0q0Qu7taolm4DgvaMcGTmlztAsEnxh65UpE4pBzsnO4Y/uH5A0Rs8xPGIqN4rOswJtwbXV96Q== Received: from DM5PR07CA0101.namprd07.prod.outlook.com (2603:10b6:4:ae::30) by CYYPR12MB9013.namprd12.prod.outlook.com (2603:10b6:930:c2::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.50; Wed, 17 Apr 2024 07:23:26 +0000 Received: from DS3PEPF000099E1.namprd04.prod.outlook.com (2603:10b6:4:ae:cafe::c0) by DM5PR07CA0101.outlook.office365.com (2603:10b6:4:ae::30) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7495.23 via Frontend Transport; Wed, 17 Apr 2024 07:23:26 +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 DS3PEPF000099E1.mail.protection.outlook.com (10.167.17.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.22 via Frontend Transport; Wed, 17 Apr 2024 07:23:26 +0000 Received: from rnnvmail204.nvidia.com (10.129.68.6) 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; Wed, 17 Apr 2024 00:23:10 -0700 Received: from rnnvmail201.nvidia.com (10.129.68.8) by rnnvmail204.nvidia.com (10.129.68.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Wed, 17 Apr 2024 00:23:10 -0700 Received: from nvidia.com (10.127.8.13) by mail.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.1258.12 via Frontend Transport; Wed, 17 Apr 2024 00:23:09 -0700 From: Michael Baum To: CC: Dariusz Sosnowski , Thomas Monjalon , Ferruh Yigit , Ori Kam Subject: [RFC 0/2] ethdev: update GENEVE option item structure Date: Wed, 17 Apr 2024 10:23:02 +0300 Message-ID: <20240417072304.3260172-1-michaelba@nvidia.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-NV-OnPremToCloud: ExternallySecured X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099E1:EE_|CYYPR12MB9013:EE_ X-MS-Office365-Filtering-Correlation-Id: 14100e76-a54e-48eb-0a30-08dc5eaf45b6 X-LD-Processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qcLRia0hz6KgzAdGrzohajphGwZXkb2MnwqPQ3WWF08oxkNgfrD9i3Dz4xvbzmPAJ3Sj6d53GiOHDnLBn6xyuQVj7dlrpblfF+niZSGUaxSdkHJTjGuTbK7rrbMX6KXHQ+IqtKPo6+7tMRVJmtH0ISfqZ9UAAF7c3fBp1X5Yv7gyhuwZQGug2wChbb/efTHvonR8koyuAA3cFZGv/nwCoac8/VgDxUYiUkTGGSA02R1mANO//5fq0a4qLWxmDqiD+LKB1gTLGj6rhqZ1QcxMf8le7gCE+PAfLoa7riRkRF67Jf+aLM4QhbNlkI7S8a0V1sGxB6cnnZAEA/YUxOvaaZIpaSLwTJSfnsuVc/Vp8rpy3ZAmR6hD+FZRMsx+3gxRPnQU35sIeIPgP3Bp7Sw/Ih9ao5CE7cGVVJPyCbpNYjLBiGF87yEnpLZFVMauA3s4rXPt31iLmyTXAlV4aJ0bzx/I93to405JN/s4xHx/epk2y5jDiwGvzQDQrXbtlMaPxQ2gpYmmAb+YYasraTh8UaQ9vVDjsEbjhJHIAZ0LFRc2rz1A2MZJv5ut6PUtR65EiZxmaDjJNKmsb9Exx5PFnUltfT1+ccHxexaZ6Iraoo23wQqzYoF6/oIOJPxV+a2e0ipyoEz9SBtv8BfqziFbHd1j9TSVWsrTSx7EulcFxZYLqMKBb6IVZQ4nH372+uOE4ad28p/5rAPaFmrYF8AM0qEqratFXR6M2zeocR4e7YQMEfgU1AuyxGn260Z2Q7df 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)(1800799015)(376005)(82310400014)(36860700004); DIR:OUT; SFP:1101; X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2024 07:23:26.0051 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 14100e76-a54e-48eb-0a30-08dc5eaf45b6 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: DS3PEPF000099E1.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CYYPR12MB9013 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 "rte_flow_item_geneve_opt" structure describes the GENEVE TLV option header according to RFC 8926 [1]: struct rte_flow_item_geneve_opt { rte_be16_t option_class; uint8_t option_type; uint8_t option_len; uint32_t *data; }; The "option_len" field is used for two different purposes: 1. item field for matching with value/mask. 2. descriptor for data array size. Those two different purposes might limit each other. For example, when matching on length with full mask (0x1f), the data array in the mask structure might be taken as size 31 and read invalid memory. This problem appears in conversion API. In current implementation, the "rte_flow_conv" API copies the "rte_flow_item_geneve_opt" structure without taking care about data deep-copy. The attempt to solve this revealed the problem in determining the size of the mask data array. To resolve this issue, two solutions are suggested. Immediate Workaround: The data array size in the "mask" structure is determined by "option_len" field in the "spec" structure. This workaround can be integrated soon to avoid deep-copy missing. Long Run Solution: Add a new field into "rte_flow_item_geneve_opt" structure regardless to "option_len" field. This solution should wait to "24.11" version since it contains API change. When the API is changed, I'll take the opportunity to add documentation for this item in "rte_flow.rst" file and update the data type to "rte_be32_t". [1] https://datatracker.ietf.org/doc/html/rfc8926 Michael Baum (2): ethdev: fix GENEVE option item conversion ethdev: add data size field to GENEVE option item app/test-pmd/cmdline_flow.c | 10 +++++++ doc/guides/prog_guide/rte_flow.rst | 16 ++++++++++++ doc/guides/testpmd_app_ug/testpmd_funcs.rst | 3 ++- lib/ethdev/rte_flow.c | 29 +++++++++++++++++---- lib/ethdev/rte_flow.h | 3 ++- 5 files changed, 54 insertions(+), 7 deletions(-) -- 2.25.1