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 7249442493; Thu, 26 Jan 2023 17:19:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6377442B7E; Thu, 26 Jan 2023 17:19:26 +0100 (CET) Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2067.outbound.protection.outlook.com [40.107.244.67]) by mails.dpdk.org (Postfix) with ESMTP id CC76040A89 for ; Thu, 26 Jan 2023 17:19:24 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gjeIfe3gRtGqMHSOnhcd7SR9vPGpOhI8awV3IW1E6BLslgCqbhhVcwJciJNaq1CxW8FdrrmxTQz3t4E5RY3j0eyHs7cScr3NUEdOHsKEiLMIppXun1y1tUb8EOQ9+vGCNNjd22AYcUrxtnQsl1G0JyX44vaAzGaQPsQSYHFEWA4lfyVShX5aQWygZWMou2rSDfJGklZ18AfKRI0eGkbR/kfRslWquLmOo1vW1qoNEijSyOrz/MwNUAsJSVBaTNpLNIfIYImuGoRP6iUxFIDqrWnfGZfUky0y60BvIoyZPLfMzDyez9cpYEfc0/cCDcwBi/NWIlPqsW8NOx+X6U9YqA== 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=gZ7pC0k5Dz97Sl6jOhRpespDg45mIqMzIg5N0Mmkt9qWO46qyiu+CBsxp62/L1g335NWjIn2YnKyPS4V+cdXE/p0g5Go2UD8/Z5gpm9ay5i9zAOcs3eFU80gJUz1P16q4tWvoYNVCPGDSPRR/X37Uk2VxdlmtYGGjmKksy7NV2vPd0PAsydjzzlQaoLMc7ctZXnDNymV8ZsT/ooZrs50C7pbLPH4GnC+xZn0Qv5il0Kpzli6HgfrAcRcm7CKxOiotmXm4nA04H3qWGVIzh5eeXBfb2lmGZu9Y3aycEiLb944oKsHWZ9xPmclcV3l+kM8PSjUVuzLfAEyeF9oweTxqw== 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=Tci3MwndITZDXwOtF/o8Zf3FtGxK3jP11N3eMhif9KWumhO5rJK4bqicd4UwgYRIo9rfj3ZZRV0B8o2bQdM5NaIliBC5E84jGFvQG4efjyuC5uZKNmQkM/x5rQggo/dqsQ+KEHZOZb+EARdrawwXsOCAN8mo/bwKoizgWs7vmYQ= Received: from BN9PR03CA0519.namprd03.prod.outlook.com (2603:10b6:408:131::14) by PH7PR12MB7913.namprd12.prod.outlook.com (2603:10b6:510:27b::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.33; Thu, 26 Jan 2023 16:19:22 +0000 Received: from BN8NAM11FT088.eop-nam11.prod.protection.outlook.com (2603:10b6:408:131:cafe::17) by BN9PR03CA0519.outlook.office365.com (2603:10b6:408:131::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22 via Frontend Transport; Thu, 26 Jan 2023 16:19:22 +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 BN8NAM11FT088.mail.protection.outlook.com (10.13.177.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.22 via Frontend Transport; Thu, 26 Jan 2023 16:19:21 +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; Thu, 26 Jan 2023 10:19:21 -0600 From: Ferruh Yigit To: Thomas Monjalon , Olivier Matz CC: David Marchand , Subject: [PATCH v5 2/8] net: add smaller fields for VXLAN Date: Thu, 26 Jan 2023 16:18:58 +0000 Message-ID: <20230126161904.864517-3-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126161904.864517-1-ferruh.yigit@amd.com> References: <20221025214410.715864-1-thomas@monjalon.net> <20230126161904.864517-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: SATLEXMB03.amd.com (10.181.40.144) To SATLEXMB04.amd.com (10.181.40.145) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BN8NAM11FT088:EE_|PH7PR12MB7913:EE_ X-MS-Office365-Filtering-Correlation-Id: 49b521bd-684f-4f1f-6600-08daffb91562 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bDjY7H/TRzbS2b0FkIXe2NfrBU/tNU5/e2jPewo4vsENnB5zOW9+z8BZ8ecjjcI00C5MPKpCFKNmp44pMhdc5zcVhUw1rUTgF6AjaWhg7PUtJQieL/PDiV4YYJHD74PDW7yyJq6gObidDDU9e0LFyuD+gKuHlnVtxDb7beskXOu+sGoTx90DSgFfDvlxFsoPXS7RTduFMwUcsmsZ//poi385d+WGylscybVGLXZL2TebUDOCQuRlQpN1qzSAzZSmRxQaKNZf1szpiQb8Wn6y52jlOv7V+xmTeFsKINdl/LsxVN8C/tkG7tONgYoMNgc6KTU429AM4O/cOlBRTV4dpO3lpsH6rv28vHCEgZPG/G7nxlWWRX8AWZCjfrpZWU1xtgc5k+UiKYE1f1F0oNgDLkzHug4TYmRksBEw986KEDnBJG/5m8QNyYwaZu58o4Ny3gzluUFyC8kO/6jP6+B10vBT35qHg8Q4JzLijtrBMbhyY/9Ic+tHHxLTkRUHXEZeVBhaKV8fDrBhSzy0owQ70KAQy2PFMS42FA+8oUmzIaVWSaIp+hE3oyOLuv9ebTC2fIt/gv9nImNUU1lg32M/St1eRwf7Ys50Cs7co1KSvGf2BWAE1w2DQ5LS2Jxb6iwi6+CODBibD4hmgkIXHZw3W8K3PRTyuOk1vR+xBlMjUK//AltOD25FSDND7fd7kY8ReLey5dpXMLjcfs7mfh7SfCPmD0RV8AOcTths1Mi9piw= 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:(13230025)(4636009)(39860400002)(396003)(376002)(136003)(346002)(451199018)(46966006)(40470700004)(36840700001)(1076003)(2616005)(36860700001)(70586007)(83380400001)(70206006)(40480700001)(86362001)(7696005)(8676002)(26005)(316002)(36756003)(186003)(54906003)(4326008)(16526019)(110136005)(356005)(478600001)(336012)(6666004)(81166007)(40460700003)(5660300002)(47076005)(44832011)(82310400005)(2906002)(426003)(8936002)(82740400003)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2023 16:19:21.8836 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 49b521bd-684f-4f1f-6600-08daffb91562 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: BN8NAM11FT088.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7913 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