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 4C9E042492; Thu, 26 Jan 2023 14:18:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4157341144; Thu, 26 Jan 2023 14:18:43 +0100 (CET) Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2040.outbound.protection.outlook.com [40.107.236.40]) by mails.dpdk.org (Postfix) with ESMTP id 13689400D7 for ; Thu, 26 Jan 2023 14:18:42 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hqXaLAZfV3h2lblnVEusqkm9cVdJzEht8UJ4cfER6qkUTOD4YkNa20K9U2vDadZF01sRFVdP1G8+oe9zSqSfMdUT2ywlvzmDbKdqSJmtwVcKPKXOqp8bz19AcIAZAIM+O6xW6g3ecfDY700fJX67cLNSsv64lqVFA3RpUqAPfwhDB1nyYKOPc64pseCLk9qE3qBbKZjgaH3sRpBcRZH+y1obry7cM/N6t2LnTSQIO5xjnhpP/VMuho3P9imW0heU5vKfayqqAIATj14UWqAu57GvtiMNU+50sSI7XAJYL2O9RFqmUnT2vvnx79nCp2bVEoe14rUbK+zSmYMqgBXz1w== 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=Lpo5YcSEfU6riQwhhctVUIGRdUlFYwjlInVy7mh5ZX6BBWBaeIDskjLb+EGvsUXtyzqoIMd44NA2HUnqMoR9uF/9cbtG5bjiLClJIF8bH0ZftkKpXIT3wpCcGhpMnyPlMS5MGXQOwQ0z718FUz8YHeRbMQCN+tU8OXZe2sFor+bjmEZXQAqNplnTjHHFGLVJr0pMpyg6x2fAc3Cz6Bn0+FAq0ZqLSGHCs0mjBiznoLu6t+Uf9JbJ/zCiZVEl+7mTd5VASWPiHE3viE3bcMc9gK2wjvZYJb21cxNCVKlhX9BAOd933/mjnwnZmyDoyn5H/hZgumE1WvpLzY+dozAH4g== 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=vO6Xd3NM7OEQdiqb+x/y00+lodl8VuzXynjC5Flu+391E7fILn9gRNq3aEcKK5lmUyvPZK2832Mm0cS3vAdF7XzkGLS7kGdGJAmRS/OvzU6SsZdtxFstbW71qP5MGSvxIiHe2fdDkC6OXUWLcQi2nHUUVp0f4918SqEHDl76Nis= Received: from BN0PR02CA0048.namprd02.prod.outlook.com (2603:10b6:408:e5::23) by PH8PR12MB8607.namprd12.prod.outlook.com (2603:10b6:510:1cf::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.22; Thu, 26 Jan 2023 13:18:37 +0000 Received: from BN8NAM11FT012.eop-nam11.prod.protection.outlook.com (2603:10b6:408:e5:cafe::c6) by BN0PR02CA0048.outlook.office365.com (2603:10b6:408:e5::23) 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 13:18:37 +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 BN8NAM11FT012.mail.protection.outlook.com (10.13.177.55) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6043.17 via Frontend Transport; Thu, 26 Jan 2023 13:18:36 +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 07:18:33 -0600 From: Ferruh Yigit To: Thomas Monjalon , Olivier Matz CC: David Marchand , Subject: [PATCH v4 2/8] net: add smaller fields for VXLAN Date: Thu, 26 Jan 2023 13:17:53 +0000 Message-ID: <20230126131759.3887632-3-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230126131759.3887632-1-ferruh.yigit@amd.com> References: <20221025214410.715864-1-thomas@monjalon.net> <20230126131759.3887632-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: BN8NAM11FT012:EE_|PH8PR12MB8607:EE_ X-MS-Office365-Filtering-Correlation-Id: b4c2caad-3ebe-4bb9-bc9f-08daff9fd550 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1ziXCSO7WmM698DEvH2aa7H9vKpoJTp1GqK4P5xGFRXLbQfWyxLm1T/7A30lITSxzkXuCiO9dynIPE9Y0U5e/pAk7F+o+y5ql4GBldV86gUcTIhp4sm2KxbWlxOhUx8wsuILwE4ahB8H9/SDx1l39RJOw3PLjxsQBoCBVZUisZVyPDvRBZ1pR7LDgJcQ9vmsPa054UwdSdrd9JkI6Jw3zS7540nlCTUqDoFG5oNetyDeqPH1JeCI+tQ/wqgUbDeay/FfbFYkpMiJNoikND9Xgg4dSMZElEnfiiFpM78Q56ZB9VQ4lrrazzd08MQj7cQ92dYrjckXmCutSWeeE6Da/tIKMKpKXh8sAgMtJZraPDAO0N1EX6lLa9diTwzjbz5+P70/WoLe/3fOfbgjlYzaNNlvy+zkjO49OJ8Wv+43rvSoUqsAXDB0CYhzv6NGKE00cmXvDMFb6aCMxyTZNNIIqeMSnargcRro77LhUNyOIOd3o9Ie4sBMEfAO3r3OR+4PXINk380MPgZLRVzPw2/+5+H7IaWGIg+n7iX3K89yVGI/KuvexQ1fk/EW31AkU5W6ptWrtEOuEzWl8iuVqRq4iDCAJdSNIEGLLfQcxKoYwF8IYM3+N0FUS//VDS61mMNKIEvc2XHYKLfOsbgCqQTGiKEMfh+G7ARu7uERD/aYWQUyEzwe6FmnTOK7v44HkvSWb8z9E4YOJjRxLV0B1BUNj34XsDEglusPS0iSEQyespg= 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)(346002)(136003)(396003)(376002)(451199018)(40470700004)(46966006)(36840700001)(40460700003)(44832011)(2906002)(356005)(81166007)(36860700001)(2616005)(1076003)(6666004)(16526019)(186003)(26005)(40480700001)(426003)(86362001)(83380400001)(336012)(4326008)(70586007)(70206006)(8676002)(5660300002)(47076005)(36756003)(41300700001)(7696005)(478600001)(316002)(110136005)(8936002)(82740400003)(54906003)(82310400005)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2023 13:18:36.9755 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b4c2caad-3ebe-4bb9-bc9f-08daff9fd550 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: BN8NAM11FT012.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB8607 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