From patchwork Thu Feb 2 12:44:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 122943 X-Patchwork-Delegate: ferruh.yigit@amd.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 6104F41BAE; Thu, 2 Feb 2023 13:45:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4FC7742DA9; Thu, 2 Feb 2023 13:45:30 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2064.outbound.protection.outlook.com [40.107.243.64]) by mails.dpdk.org (Postfix) with ESMTP id 3F52240689 for ; Thu, 2 Feb 2023 13:45:29 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Gcb1ank4Jtr9Az7pGWmRR/jLgNdXKnlPw2KxjF+2Vj6AX5nKqcPMkgNsXZsu7mwf6bs238wygix21JGBuYiSjpsuJqkDK1kbmSRHlnnHCMrDI7wrG0vLXl9EQFyObVbLCUncTDCACQjtGBQaeL+MM1ejyCV4apdE17vR6EN6a0WZkxlli+Y90C3jSJv4xShi+bZiqNZ+Eq0JVSpktnDwgAAActNtYLXFBsKHl8s940DYzBQ94RIkZW5KEc0vO8LjVDh0F/85hQDqQGyXjAWVU+zXJGdloqcsPttY09t+v1jj3isR2AkYF8vCosJEhCJ3CgBYPzv0eO4Xzgj7HCEBWA== 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=jrtlnEUQr6wcLyDyi3Aej8n65C2xknJQeI0xxTFPr5LIGlSWC6mQReRARtQJ1nKbsAmj2p0u4XqtjPtLSVH8N0vIJ/Ub1pGbBFYCdXhcIKbYkK0dpn+nGdaLeOFnM7+jDylrajp1v7w7H4ulzumLmJkZt6OiVyykVIyudWekONw6CzYcLmKnQDbr0jTh+iFKlosNOq6HF4FSUuX0lZG5d8+TqnGQjJ0GNW41tioHIrpHP3FKrZVcA9Ev/r0F7RtBejiG78wMoN52IkCnGvXgteyFD9sUJ5PoAd1HQIqlinHplqyDaNRW3dOaoVl9iKCRLUBPT2c+NDjLqgeAgFJ9zg== 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=nIllPRfQERDprg+5DoUICaO7oDxp0x0ndSZKeKkc0d6iZB2VYoEIIpu+RgSlrzzEknnaNIuPqjodxRBsI7gxwacW5kOQ7+ItDytIXCv/l2h18gNGzwZbothOq5rf61ycyH434o9CT1S97xXm4NZ6XpXrdRB/B4kwINcofg4xxxw= Received: from MW4PR03CA0227.namprd03.prod.outlook.com (2603:10b6:303:b9::22) by DM4PR12MB5325.namprd12.prod.outlook.com (2603:10b6:5:390::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27; Thu, 2 Feb 2023 12:45:25 +0000 Received: from CO1NAM11FT046.eop-nam11.prod.protection.outlook.com (2603:10b6:303:b9:cafe::fe) by MW4PR03CA0227.outlook.office365.com (2603:10b6:303:b9::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.27 via Frontend Transport; Thu, 2 Feb 2023 12:45:25 +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 CO1NAM11FT046.mail.protection.outlook.com (10.13.174.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6064.25 via Frontend Transport; Thu, 2 Feb 2023 12:45:25 +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, 2 Feb 2023 06:45:24 -0600 From: Ferruh Yigit To: Thomas Monjalon , Olivier Matz CC: David Marchand , Subject: [PATCH v6 2/8] net: add smaller fields for VXLAN Date: Thu, 2 Feb 2023 12:44:54 +0000 Message-ID: <20230202124500.2578857-3-ferruh.yigit@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230202124500.2578857-1-ferruh.yigit@amd.com> References: <20221025214410.715864-1-thomas@monjalon.net> <20230202124500.2578857-1-ferruh.yigit@amd.com> MIME-Version: 1.0 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: CO1NAM11FT046:EE_|DM4PR12MB5325:EE_ X-MS-Office365-Filtering-Correlation-Id: b59e53de-1b8c-4621-1b8e-08db051b5b29 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: VhMhOg4Jhh2r1wXPmdrECSJCMqj3lMaIvN9FwevAk7hyDPG881e2/DboRvJtOck1NxJXC+JtopQKR5Ia77YqXsb/KcIGSq/HmkFfRv8CJWpJiwAY+mudu0+xhvIL8VTZZqr+WkfHQaKgrMYfePAZtW22fFZKX+XMHqWE9r0ttSXZgGZOT3myFC4bxY0FKwqQb9D+/b6pZeLciY8/MGbaXddWSYg3ObdpEaQLnqtflp2fj8bONqWEnoAntduZZqfaSzmOK2EtvK61RmbdyhvUWILSHRBnmPjzndF4JVqJ7GCCsRPvu6cJTjmkSXROGQN/FludySI96AOT12k4BjHi0IqK36yw6nF7MEAiwUbsaUlZOqCnA/l5Ndbw4JX0vtjEEz9+gcWyvQLdZlTXjOXGS9UAJtRBahEbshxD7SL7K7+cYE76hnMd3nYXG/a/i3oTOOPgp4sjQdvkiC0opU/rBHAV7mBVKs4OG3outIpCE6BzBvBOeN6WKRpdwZCiTR55cYHtQpmgkQeXdKfG3ZGkrUICf7xCHF4GYcBUtV7ugQxAvYSVEWMUqB8Rkyp97444km7yjT+gnLujlvbCKR6o5geDZNsDXV+KQ1q0oHsOATRUVDzpfrUJIFGAA+QiuwCWgbWhqLumkfd/T+oEUDYIj3lI/nNH2H4+VAu4AJpxXzq5I7KX2WbEGMqVJkSTGuNzkhN2vuwOXBSoUrALTsS1LVdTqhhSD52VFa59fiqc5ZU= 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)(346002)(396003)(376002)(136003)(39860400002)(451199018)(36840700001)(40470700004)(46966006)(356005)(81166007)(40480700001)(47076005)(336012)(2616005)(83380400001)(426003)(82740400003)(8676002)(36860700001)(40460700003)(70586007)(70206006)(44832011)(8936002)(4326008)(86362001)(5660300002)(2906002)(41300700001)(7696005)(478600001)(82310400005)(316002)(6666004)(1076003)(110136005)(186003)(26005)(54906003)(16526019)(36756003)(36900700001); DIR:OUT; SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Feb 2023 12:45:25.3015 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b59e53de-1b8c-4621-1b8e-08db051b5b29 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: CO1NAM11FT046.eop-nam11.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB5325 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. */