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 4D53142476; Tue, 24 Jan 2023 10:05:45 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E4DD40223; Tue, 24 Jan 2023 10:05:45 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2089.outbound.protection.outlook.com [40.107.243.89]) by mails.dpdk.org (Postfix) with ESMTP id E5C39400EF for ; Tue, 24 Jan 2023 10:05:43 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SX0zNvt+0ZUhMi4wFMQ6KlwBsmImUU4ciTbOg1kYtgL1FKQMXCQLRLKcmLHStT0g3ak+pE8fNnk3d32bldpxUexiJHKYO1aqnsHJxVMmhQqYRXSntTG5LVyksv93Mz+V/v2sb7oEo0McDjVHzOvBdyR9towYOSant0LH1Khq3ir0PL80yInsuw8ByCZ5HpwvtvYe2EBvoJtlFQ8jDQofkWCx8e7SdDaa5hXEepDVlocHjR7W8scJCvFlOwHhYzvvyF2Vg9uuLsE68E5F54pyAxJ+LiOcnmTmPvUiYdDSOX6bK7KZS2RE1d3mIdr6zwG8v2ZeqO8bKteIZTIEs4m33g== 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=goUCvf0m24EEgRkC6LeA//ZgGSHRbAIBeD8sQ2856mM=; b=UTYNaCXJVzZIb+6lBoxx3yeG1B0M+NpLnRO68y0lGMesyJRV8GvQFocJ0l5V0aiDXl9EPiK9BkS5XYfLppBY+q67FvDVfe490DrFo7F5vbUDpl/hQBUaphNlosu5HKbkHdYeY1ZM0f58aaj6XIuKCYVE183d1SqBxfny1n6W5YYweGKY7hFEpfN7y/9LzAeBM77P1vjnc252ch4DdFwFS/bwH7sZ9P9z+ca9pLzEzyZ6PEyTGdxvjZHtg2n2vZzvCPb46z0Rx3u611tuXzjc3u1qW1GbhOqiypaPWwDsaOVMbjYlvQUIrJVi6lXoCpM9z6x8CezE0SArr+CtABgVIA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=monjalon.net smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=goUCvf0m24EEgRkC6LeA//ZgGSHRbAIBeD8sQ2856mM=; b=Kx0zCJek9xUkJd+W7lIiwihQsWRFR9EXOS/P8LtUWO62MOo1PZlo2HYVp3b51BGebWw1AKRgM1DNyKcw22b8vcRjFmdvRdwQBt11FdOMOZc52dI9Kp2zfwm9AyXVYFh3sOIth7BEBbpke49bdYr3XFR9SnWx7JMgDIhy+of7ISs= Received: from MN2PR20CA0003.namprd20.prod.outlook.com (2603:10b6:208:e8::16) by CY5PR12MB6106.namprd12.prod.outlook.com (2603:10b6:930:29::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Tue, 24 Jan 2023 09:05:39 +0000 Received: from BL02EPF000108EB.namprd05.prod.outlook.com (2603:10b6:208:e8:cafe::3d) by MN2PR20CA0003.outlook.office365.com (2603:10b6:208:e8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33 via Frontend Transport; Tue, 24 Jan 2023 09:05:39 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by BL02EPF000108EB.mail.protection.outlook.com (10.167.241.200) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.12 via Frontend Transport; Tue, 24 Jan 2023 09:05:39 +0000 Received: from telcodpdk.amd.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Tue, 24 Jan 2023 03:05:24 -0600 From: Ferruh Yigit To: Thomas Monjalon , Olivier Matz CC: David Marchand , Subject: [PATCH v3 2/8] net: add smaller fields for VXLAN Date: Tue, 24 Jan 2023 09:02:54 +0000 Message-ID: <20230124090300.247915-3-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230124090300.247915-1-ferruh.yigit@amd.com> References: <20221025214410.715864-1-thomas@monjalon.net> <20230124090300.247915-1-ferruh.yigit@amd.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [10.180.168.240] X-ClientProxiedBy: SATLEXMB04.amd.com (10.181.40.145) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF000108EB:EE_|CY5PR12MB6106:EE_ X-MS-Office365-Filtering-Correlation-Id: 01bae6f3-f66a-49e4-a14c-08dafdea2a03 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 3MZVzpUam8RUYDG+jjJYMVHDrmwWUbN9otbJEbCAMlTZ72x5u31Z/u4Rbc74+ga6TeWX6ysGTyn8AK7x7RuSD5+yc2pnvNNlyoEU0NDT0v5NguWgXV72bDQDkvgIa6OAmRzXdnprpT1QJOq++a0qd4qWBpfPoRH3xMJJ/LrSoWCduCBy2l+rZRdZnmHy+CSwaDSqggVUkejYBTIhrj0VO3kZRgJK2LDaYDTJ8GEuzkwHnesSJuIrFv2XhnUY4j31lPtk1BziQBRilWk2CAJkAv/mEeAFOjH/VdqSOjsdm+4B50HvSIzDyQzhj2rhxYp56ZvC49GiJx65kLiZVVd7Vly1sM2clyZ4+opNZcxkIzMMsqN6goac8qKKSSK3Qv2BDESNl2tJCThFYptMCM8c43y3K27HjHongriyWiBD/Bb6uvcss52uCtVFgr+Mmy2UAlWqja2NRKEticfYxiEr8FKm0tF6eDZobv7P432JY0uQuaxv3A3+iE+22UyAw/VBLrkELjoXhe4HuZoVw40XlDaE9lHGs89XKC5eiRisoIpJ6TqZVI+LelA6n184wYq7xiboFjrDmtYnShYo8qOr2Nz9L6EszApn5jJMeIEyXxBZeeDu9JJfNkRLIwqVhUF48TGC/3BBzezi07KDgvmQ7Bei4n76kfpvuGUQ8Tv5F4YI9n/BQ1tvSNrDJCDpR+OGRiNAslsW0QfWUIAFFsoTnIpvbslI9i5GVS5fygb2r4g= X-Forefront-Antispam-Report: CIP:165.204.84.17; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:SATLEXMB04.amd.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230022)(4636009)(396003)(346002)(376002)(39860400002)(136003)(451199015)(36840700001)(40470700004)(46966006)(83380400001)(36860700001)(81166007)(82740400003)(41300700001)(356005)(86362001)(82310400005)(44832011)(2906002)(8936002)(5660300002)(4326008)(40460700003)(16526019)(40480700001)(316002)(8676002)(26005)(186003)(70586007)(6666004)(47076005)(336012)(426003)(70206006)(1076003)(2616005)(54906003)(478600001)(110136005)(7696005)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2023 09:05:39.5089 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 01bae6f3-f66a-49e4-a14c-08dafdea2a03 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL02EPF000108EB.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY5PR12MB6106 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 From: Thomas Monjalon The VXLAN and VXLAN-GPE headers were including reserved fields with other fields in big uint32_t struct members. Some more precise definitions are added as union of the old ones. The new struct members are smaller in size and in names. Signed-off-by: Thomas Monjalon --- lib/net/rte_vxlan.h | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/lib/net/rte_vxlan.h b/lib/net/rte_vxlan.h index 929fa7a1dd01..997fc784fc84 100644 --- a/lib/net/rte_vxlan.h +++ b/lib/net/rte_vxlan.h @@ -30,9 +30,20 @@ extern "C" { * Contains the 8-bit flag, 24-bit VXLAN Network Identifier and * Reserved fields (24 bits and 8 bits) */ +__extension__ /* no named member in struct */ struct rte_vxlan_hdr { - rte_be32_t vx_flags; /**< flag (8) + Reserved (24). */ - rte_be32_t vx_vni; /**< VNI (24) + Reserved (8). */ + union { + struct { + rte_be32_t vx_flags; /**< flags (8) + Reserved (24). */ + rte_be32_t vx_vni; /**< VNI (24) + Reserved (8). */ + }; + struct { + uint8_t flags; /**< Should be 8 (I flag). */ + uint8_t rsvd0[3]; /**< Reserved. */ + uint8_t vni[3]; /**< VXLAN identifier. */ + uint8_t rsvd1; /**< Reserved. */ + }; + }; } __rte_packed; /** VXLAN tunnel header length. */ @@ -45,11 +56,23 @@ struct rte_vxlan_hdr { * Contains the 8-bit flag, 8-bit next-protocol, 24-bit VXLAN Network * Identifier and Reserved fields (16 bits and 8 bits). */ +__extension__ /* no named member in struct */ struct rte_vxlan_gpe_hdr { - uint8_t vx_flags; /**< flag (8). */ - uint8_t reserved[2]; /**< Reserved (16). */ - uint8_t proto; /**< next-protocol (8). */ - rte_be32_t vx_vni; /**< VNI (24) + Reserved (8). */ + union { + struct { + uint8_t vx_flags; /**< flag (8). */ + uint8_t reserved[2]; /**< Reserved (16). */ + uint8_t protocol; /**< next-protocol (8). */ + rte_be32_t vx_vni; /**< VNI (24) + Reserved (8). */ + }; + struct { + uint8_t flags; /**< Flags. */ + uint8_t rsvd0[2]; /**< Reserved. */ + uint8_t proto; /**< Next protocol. */ + uint8_t vni[3]; /**< VXLAN identifier. */ + uint8_t rsvd1; /**< Reserved. */ + }; + }; } __rte_packed; /** VXLAN-GPE tunnel header length. */ -- 2.25.1