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 55483A0547; Fri, 12 Mar 2021 12:08:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 30B97160882; Fri, 12 Mar 2021 12:07:51 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 0C6E24067E for ; Fri, 12 Mar 2021 12:07:48 +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 B59277F589; Fri, 12 Mar 2021 14:07:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru B59277F589 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1615547267; bh=5xruwNVl02NgzTYUzEgdqaK9Hfp5FFuZPK13esraQKk=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=xHUqz5GX854ZKNY3nsZnXi4xQ/vpvqmRbaIgr1tz6x1lAZZLwNmcY6t/q10vehyzm dVetH9DwjBafiWO+qdvl45BSr6jwyk/xrvkPd1Yedl/MiKs72q6/QmFuQRVuXR4kWp YR8tLEnXPkPv4nK8Bce791hp601QCAet7Kbuw5XI= From: Ivan Malov To: dev@dpdk.org Cc: Andrew Rybchenko , Andy Moreton , Olivier Matz Date: Fri, 12 Mar 2021 14:07:38 +0300 Message-Id: <20210312110745.31721-3-ivan.malov@oktetlabs.ru> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210312110745.31721-1-ivan.malov@oktetlabs.ru> References: <20210312093143.28186-1-ivan.malov@oktetlabs.ru> <20210312110745.31721-1-ivan.malov@oktetlabs.ru> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2 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