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 94741A0547; Fri, 12 Mar 2021 10:32:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AE92A16085B; Fri, 12 Mar 2021 10:31:52 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 9150D4067E for ; Fri, 12 Mar 2021 10:31:49 +0100 (CET) Received: from localhost.localdomain (unknown [188.242.7.54]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 4EE2A7F578; Fri, 12 Mar 2021 12:31:49 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 4EE2A7F578 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1615541509; bh=5xruwNVl02NgzTYUzEgdqaK9Hfp5FFuZPK13esraQKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=GEr2ZNiO96siGrhsDqNQGz2hDBzg0FJ8k82jhLmv2pNTpO4XldL863HA7RADpmf7N Z8wu4aTHjuy9geyJg9yEQg4z8QUK64jf0OnomN7fw+Oz2YdAUpJViN7vTyxaZ9ryaj yCErK5G4lkOtQBLwqqSflBNx6xlmd+QnKe0nddOo= From: Ivan Malov To: dev@dpdk.org Cc: Andrew Rybchenko , Andy Moreton , Olivier Matz Date: Fri, 12 Mar 2021 12:31:36 +0300 Message-Id: <20210312093143.28186-3-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210312093143.28186-1-ivan.malov@oktetlabs.ru> References: <20210312093143.28186-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 03/10] net: clarify endianness of 32-bit fields in VXLAN headers 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 Sender: "dev" These fields have network byte order. Highlight it using dedicated type. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- lib/librte_net/rte_vxlan.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/librte_net/rte_vxlan.h b/lib/librte_net/rte_vxlan.h index 2ad606165..929fa7a1d 100644 --- a/lib/librte_net/rte_vxlan.h +++ b/lib/librte_net/rte_vxlan.h @@ -13,6 +13,7 @@ #include +#include #include @@ -30,8 +31,8 @@ extern "C" { * Reserved fields (24 bits and 8 bits) */ struct rte_vxlan_hdr { - uint32_t vx_flags; /**< flag (8) + Reserved (24). */ - uint32_t vx_vni; /**< VNI (24) + Reserved (8). */ + rte_be32_t vx_flags; /**< flag (8) + Reserved (24). */ + rte_be32_t vx_vni; /**< VNI (24) + Reserved (8). */ } __rte_packed; /** VXLAN tunnel header length. */ @@ -48,7 +49,7 @@ struct rte_vxlan_gpe_hdr { uint8_t vx_flags; /**< flag (8). */ uint8_t reserved[2]; /**< Reserved (16). */ uint8_t proto; /**< next-protocol (8). */ - uint32_t vx_vni; /**< VNI (24) + Reserved (8). */ + rte_be32_t vx_vni; /**< VNI (24) + Reserved (8). */ } __rte_packed; /** VXLAN-GPE tunnel header length. */ -- 2.20.1