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 950FD41BBE; Fri, 3 Feb 2023 17:49:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8D5BD42D49; Fri, 3 Feb 2023 17:49:22 +0100 (CET) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2070.outbound.protection.outlook.com [40.107.223.70]) by mails.dpdk.org (Postfix) with ESMTP id 3D90342D41 for ; Fri, 3 Feb 2023 17:49:21 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=A0sBWEB5wzCoGz+jjXYwvqoQwVTNRO8EDyZF8ea8LTwSEVVqoAsOcI/bWMHKGzXZSDRSYFAuZ60yEUws8hoUs3A6+CKg5MYjkOJJC9nIvlwLgX6IwtFmoZ8OkNQOW5IaoPL0OHz1xI027YVtzVoxfie1pgN0k+ZGKjIDQlPCQQ6C9k9hHJU4VNfEuyIMGZdqM5nwTZ5M0F8mdYA7S0Og+m22c7mHPlWRe0SNbqYhfrFklqAjlE8z3EMsGu5kTPgUxFmZTklpHF68pHOXzHEFJBw1Hl3OTDbWaKaWkXGOftv90jfVC9Ta1XqAQwj8VGlIs0tK6xg+DgvPbkim/ulnBg== 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=oFnl2CWT5lqLd/hU4sH6STFh/KFL/S4RBgRhuu+3ZMw=; b=K/GkSb60HpSAmoLY52uR28nMGEe8+5s2AJZiqUYCNgHqkuz2t97JfEfvl5DjX1GjH8NLkR9i2x3k+LKj0gcR2W4Y2EUq/Yrc8VH/Rpx18M271RMrSCLZDJ/vfeCQUuTqCm4DxHTcBG/v6WA7H7q0lwN2lREMbDKZMyEE8bopcPrfNTLjwa2SNMw18E6ju9bxugaTvEPmYonx5jxCUrzrUJurOLJNlJ4ctQo6QyrwS1xzO0UXYca/Y3zkzgImtBvIR7Flzry/5HXH7OcN9j8zQGWQBbdPXjaLoYT3PDmgVYzFem+VvAVOQW3vwD421NKXdkHTlSNASBibQeM25D5SXA== 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=oFnl2CWT5lqLd/hU4sH6STFh/KFL/S4RBgRhuu+3ZMw=; b=RTk3ewIDFxQywGXSrPhX+Um01HqdfNzUI5oA/sLVIrr9vhsa5SZD1qZM+DBuGTp2UitivG5SrL25ugJ0iaegIgBiz1ak+G0UgbPFerSap36rrh4WOiOqy6pcIzaX8C0QLsZA1doaaKM4bYhaIgMvMfty7lWkajGbFMLwSfFg+GU= Received: from DS7PR03CA0039.namprd03.prod.outlook.com (2603:10b6:5:3b5::14) by BL1PR12MB5364.namprd12.prod.outlook.com (2603:10b6:208:314::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6043.38; Fri, 3 Feb 2023 16:49:19 +0000 Received: from DS1PEPF0000E65A.namprd02.prod.outlook.com (2603:10b6:5:3b5:cafe::90) by DS7PR03CA0039.outlook.office365.com (2603:10b6:5:3b5::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27 via Frontend Transport; Fri, 3 Feb 2023 16:49:18 +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 DS1PEPF0000E65A.mail.protection.outlook.com (10.167.18.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.21 via Frontend Transport; Fri, 3 Feb 2023 16:49:18 +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, 3 Feb 2023 10:49:17 -0600 From: Ferruh Yigit To: Thomas Monjalon , Olivier Matz CC: David Marchand , Subject: [PATCH v7 2/7] net: add smaller fields for VXLAN Date: Fri, 3 Feb 2023 16:48:49 +0000 Message-ID: <20230203164854.602595-3-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230203164854.602595-1-ferruh.yigit@amd.com> References: <20221025214410.715864-1-thomas@monjalon.net> <20230203164854.602595-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: DS1PEPF0000E65A:EE_|BL1PR12MB5364:EE_ X-MS-Office365-Filtering-Correlation-Id: 2a2a9879-4b3f-45af-7363-08db060697a9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vaEeKXpuIpqMqYFCaHKDdgEYqEo5itDqLh1Ne9YAVcQB4Ddaje1165wf0XNH6/ruXCnyT7xZEBuNiqqwaNkg0P3qks0rYDfCnkjW3+2r/h5CbJrnfI8QxaW8Bw8dG0VFrQkqybuO/0vdw2AlCdQCFuzJlW6/SodpT7nMtPBd4G+CsL8OZUpl4NlHRfFQq4Tt8D1V8oYGrwUevS8H3tGN33zNoQAVxfCKyiCkvJqx9Z9UzmA33ECbl/Yfz+LiditNKfHaL6B8eVwKGIea/CYzHwIlRQPEVo3p5PcGsI3F6DkW8G/+A+mwQxbCMKRL4KSamEdTPYs5xVljjcoaFCmZqMzFuVNo2hXX8BFjvMQT7QbgxuJOXLv85xPf8X68PZYfyTs8BG//Y+U4hYIkc8XTGqOwl4saHdo8qzjKZzZRJN2a9oOU3W1uMt2U0eiq7DDVuiAIYEtWxzO/tPh+k1aP/rXXaLfakmJxdWPSFhwkSp3ihDK2ePVqEw4QCIEeQN5utUaHo52j5le1YWu2skao8M8fz0dvLzPSg9GrJu4njSqN8JMmxWRoYf1w+dE0b33AuKuuoxGxKRqDXKWWv+IyNWLd1a14CTJWF083MmYO7BswrmRH2Ob8QoYoHclORCfrpozsH2ylzyPULb8Ip7XE9okc56rseX77vwHRCSW2uW6ycZtzzYlenAHsk8m5HRH/kunK9z9R+4QtKb4yCjhHVg0IYQBRlr6BHsWCfy0neK4= 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)(136003)(346002)(376002)(396003)(39860400002)(451199018)(40470700004)(46966006)(36840700001)(40460700003)(36756003)(110136005)(47076005)(86362001)(8676002)(336012)(83380400001)(426003)(82310400005)(70586007)(54906003)(82740400003)(186003)(8936002)(316002)(1076003)(478600001)(6666004)(5660300002)(2616005)(26005)(16526019)(44832011)(356005)(4326008)(40480700001)(81166007)(7696005)(36860700001)(70206006)(2906002)(41300700001)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2023 16:49:18.6311 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2a2a9879-4b3f-45af-7363-08db060697a9 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: DS1PEPF0000E65A.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR12MB5364 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.34.1