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 7D92E42439; Fri, 20 Jan 2023 18:19:44 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6D73342D3D; Fri, 20 Jan 2023 18:19:44 +0100 (CET) Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2086.outbound.protection.outlook.com [40.107.93.86]) by mails.dpdk.org (Postfix) with ESMTP id 7974F4067E for ; Fri, 20 Jan 2023 18:19:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=m4uylMU4vPlc8kY9qHzcZbiXT+yi/gliHTO9pnHRtLovH3bnOjWfh5t0LZYwyKX4ZtqoepwEOkGq8a5iNGtAMt5kGC8SSGAwutHAHKdDd0ch+x2R5smb+scjUMPUxrsQWwbOqo5mv9YGZUVh4Pe2UqhE1xZ/Ae/OfmiSebda8DpLz48n9gcYziYGZvGsWFfk72E+xaStsbIi1zAe7L6GMmOhfOXsX2d12m2sUiuuDNSxyeqYgEkdvn22ytT3wB+hMsToYDuC/vHPdoZSwjaPVxQHmpUhL5hap0DNWkFaZL7dzQQJSeHbv7/2F5GZykUQx7Dpp4/QhxsVWmxgN4kFbg== 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=tsG51c7O3OuFJSerB+6u/9JqG7T1t+7Fnde5puBBg0M=; b=JaK8msuSf0yB3XTEJcfbgHDzQVkwBDm6oOUMwQzvLen6h3GcYfqStXmDFF1LPp2zdA+W5kUp6gxaowO8f1NFLcFOqnMxjYA0rRt6qwlSzMDr0Gyb+65bYLVi8ptHPGsaAcNIskhumdIL+03dfnlxa7hqZBwzexoOCfDGoFerAz27uvplpxx29/srt9/KuwfToTnEZkL+q6kpS+H+qD6KYyw5jHKG+NLh3Vl7b4auQDt180ZBiE+AmxZHOHvpCfwdjCxhgntThl6NPT2SjYwuvikq3b/usXLSWfZC8dfCBiw2eqfm4r9Oke7BrILtBEqEXsHwhz4cR2uVYIcxrDrOnw== 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=tsG51c7O3OuFJSerB+6u/9JqG7T1t+7Fnde5puBBg0M=; b=ubp9LxXPFIW0CtSsA2Gg5SDrDIIzBz6et2f9vJMUWZwZ+Vm7GhRuaH/p1nR3SqskP6nhri6Zbuhh8eJdBd7VMfwpg4kz1PxyCsiDcVERJpGU09x2sY4Np3y92jBqWddCJrmZdLd1zGwp/Y9MWnUB02Ak5TQFgaOwTXbGMJ1pfOU= Received: from BN8PR15CA0026.namprd15.prod.outlook.com (2603:10b6:408:c0::39) by PH8PR12MB7206.namprd12.prod.outlook.com (2603:10b6:510:226::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.27; Fri, 20 Jan 2023 17:19:40 +0000 Received: from BL02EPF00010209.namprd05.prod.outlook.com (2603:10b6:408:c0:cafe::5f) by BN8PR15CA0026.outlook.office365.com (2603:10b6:408:c0::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.27 via Frontend Transport; Fri, 20 Jan 2023 17:19:40 +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 BL02EPF00010209.mail.protection.outlook.com (10.167.241.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6002.11 via Frontend Transport; Fri, 20 Jan 2023 17:19:40 +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; Fri, 20 Jan 2023 11:19:39 -0600 From: Ferruh Yigit To: Thomas Monjalon , Olivier Matz CC: David Marchand , Subject: [PATCH v2 2/8] net: add smaller fields for VXLAN Date: Fri, 20 Jan 2023 17:18:56 +0000 Message-ID: <20230120171902.4188088-3-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230120171902.4188088-1-ferruh.yigit@amd.com> References: <20221025214410.715864-1-thomas@monjalon.net> <20230120171902.4188088-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: BL02EPF00010209:EE_|PH8PR12MB7206:EE_ X-MS-Office365-Filtering-Correlation-Id: 6ab4b2ba-1380-4102-63a3-08dafb0a83be X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: +gMxTts4bBh7OthBugY9Tib7j+Tb7Jl1VnTQmFl/xQI/U1K58+xJu1he/Tqa5OA5Gahv38uv5xjRt7TzYb4zKbliN0N93dzsUMc5ehhhp6AgBmyS1dWs0n8sWl+1hBDfJPSDz8hT4p0bZK1IubovKkNWRf0FAQLlV2Tf4lOj1UZIdXs4vP5ZHR01zMrYYlEFhsCw6pw0CV39BwFsT5kk0iyIqwA55oEYXgt/SK80G9wfwNbCuBi971dwWn8pMjgR+4v6WliI1eJvKMil/wwFGtYmCvVQ4NxQJYZbAUiKcnrRRyNNLbjuNfUaa6UUz1Z26sIIjDv88zE5aqsZIIUfhWCOh8OkcaVfUahY5Is/B+DxM40uL3PPg5Vyyv8ULDRA9RFOxkzBQwF7eiRRJ83gQowDDQ5/MreZjzR+JCdeaSw+s9aA7BQSP4vsxRBh/KB0CgrPHAvG7SbNLEMZcEQeLW7Frkq8K917NxJn5yKm0xVfXscfSqB82vmWxm0KlGy5PTk4YOODNxK/nlsknuO63T6M8TBHykbBat6uRYLCYwh4irnTaMHmrKDh7ZCq2CjuuA2mTWFTuryGFFY+vu2giA0bkbtgHrD+yfzvFq8dsj4kYT7wXdDhmTR64qMPcVxgrywPsOWFpnwpp+q7+Nio3iZLfWXEzwO+6OLtXlHEDI8vAZjsOXtU0qQ834EvJ2ipP+TaIdyKvLb74oFyIsLDzQyL6eAyfBTuNwHbmaMgiXE= 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)(136003)(346002)(376002)(396003)(39860400002)(451199015)(46966006)(36840700001)(40470700004)(336012)(82740400003)(8676002)(5660300002)(4326008)(316002)(1076003)(36756003)(6666004)(2616005)(356005)(81166007)(40460700003)(41300700001)(8936002)(7696005)(54906003)(36860700001)(110136005)(426003)(16526019)(44832011)(47076005)(478600001)(86362001)(2906002)(83380400001)(26005)(186003)(40480700001)(82310400005)(70206006)(70586007)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jan 2023 17:19:40.4415 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6ab4b2ba-1380-4102-63a3-08dafb0a83be 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: BL02EPF00010209.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB7206 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 Acked-by: Ferruh Yigit --- 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