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 42D70A0544; Tue, 25 Oct 2022 23:44:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 063E942C63; Tue, 25 Oct 2022 23:44:52 +0200 (CEST) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id AD97342C51 for ; Tue, 25 Oct 2022 23:44:49 +0200 (CEST) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 6CDC95C00BD; Tue, 25 Oct 2022 17:44:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 25 Oct 2022 17:44:49 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1666734289; x=1666820689; bh=Lm V5SjqUp4bDGhSkqL7tKdxsa5/AeqVEhjxLrLAf3ug=; b=Hu/yqEMIWuS3GHPv6b EtowVe8N8ZiBp0eWoJeNZz9y+KJjYbBuO2K7YZLv7BY2uTi67XFE5SvU12FWrVtt a4ErcWJHBKzbrWLGo7AYS9uLfMStiWCMbMkIleOK/vHGWVmGt6zW+9M6S5Nmuh2R 6pcwBHzTvQmZv+xZNCOn9SzGJt9+M954z3Q+AdE7KLh8Hm6NDuOtAmkL0RgE5xKs yqfcz2b7GfyD/eLd7EOxKW3Rre2neL0oG1KV+Q6Dzt/nGScccLe6bgfd0+v38rbF 2RdAWeZ3hP9erXANBocg4G92XRUzu3SOTFtqyvHzz+lOVokXzf8DcUXz0LLThTXm 3T1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1666734289; x=1666820689; bh=LmV5SjqUp4bDG hSkqL7tKdxsa5/AeqVEhjxLrLAf3ug=; b=jY0eTyUSwjw4W8eFDT8FYUCDGw9XN cZWYk8c+I0/U9pJEzMjr9ddLw1JJ7aVMxwyOzn5t3F5c2cUrsumEgwd/FPuGAM0w z7QsqFVsoPM1tatsssWKPdyK5M8hRx07JawCjX2E5x/W0/XaeDLcQ6kTpQSDSMwl GL1d+5QRRFmuXZ9EuWPQg4ALpv2WvIKF0yRPzuXZtiZT9NqyiGColKLHiA5OGO1f LFGtm6hdOI1W9Q3R66GQxFM5/E2W0Clhjsiya281Vux6w7z7XuzEXi3erV0fDNgh mEEQjN1LSEfAOMXtB5PrWM+AJ14C6luKwExDTICZ5CEOhM/cDlYx0+S1Q== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvgedrtddugddtudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdejhfdugeehvddtieejieegteeuudfgjeeukeeiledthfetveek hefhieelhfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 25 Oct 2022 17:44:48 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: ferruh.yigit@amd.com, andrew.rybchenko@oktetlabs.ru, Olivier Matz Subject: [PATCH 2/8] net: add smaller fields for VXLAN Date: Tue, 25 Oct 2022 23:44:04 +0200 Message-Id: <20221025214410.715864-3-thomas@monjalon.net> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20221025214410.715864-1-thomas@monjalon.net> References: <20221025214410.715864-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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 929fa7a1dd..997fc784fc 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.36.1