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 E3559A04A5; Wed, 26 Jan 2022 07:31:22 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D21E942706; Wed, 26 Jan 2022 07:31:22 +0100 (CET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mails.dpdk.org (Postfix) with ESMTP id C5669426FB for ; Wed, 26 Jan 2022 07:31:21 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643178681; x=1674714681; h=from:to:cc:subject:date:message-id:in-reply-to: references:reply-to:mime-version: content-transfer-encoding; bh=Na+UZDUE/B65kYnOkKAjNY30jq90UCuAfyLHKWUKDHI=; b=QwbzXrlmXHUkFhAXOMRnOOmnA52crSCX3Yt7qngFk+pHcOkdEa62QGkd S5BcRg58gZwjzpojQq/89u5fUUb81RrWCKqESl0uLjuKfE/AcmxvyFTFd hd/Kw9Ld3jm8+nv9ZY2DTSsBFXtXSAhQNFvBPf3iacaWNnCCJKSNIvU4M Ta14DyFpi1EWTfhpayFkuh3SHI2rENfxySlEq4kd+8JgN+y+N2+YzYday XNWmuNhqhQ3N6E5GTJP8Q0TpTeDuEQXB0tPB7t9gRfGTla5Xe2p90fxSB x15LpwjNgYWiCfe+Lw5nYIUCD35Zcv1IhwXY4528QpV1BBC0S0GjgJ9/Z Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="227163609" X-IronPort-AV: E=Sophos;i="5.88,316,1635231600"; d="scan'208";a="227163609" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 22:31:13 -0800 X-IronPort-AV: E=Sophos;i="5.88,316,1635231600"; d="scan'208";a="520688787" Received: from intel-cd-odc-gavin.cd.intel.com ([10.240.178.183]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Jan 2022 22:31:10 -0800 From: Jie Wang To: dev@dpdk.org Cc: stevex.yang@intel.com, orika@nvidia.com, aman.deep.singh@intel.com, ferruh.yigit@intel.com, thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, jingjing.wu@intel.com, beilei.xing@intel.com, qi.z.zhang@intel.com, Jie Wang Subject: [PATCH v2 2/6] net: fix L2TPv2 common header Date: Wed, 26 Jan 2022 14:30:12 +0800 Message-Id: <20220126063016.2384393-3-jie1x.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220126063016.2384393-1-jie1x.wang@intel.com> References: <20220126063016.2384393-1-jie1x.wang@intel.com> 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: , Reply-To: 20220124065613.2197436-1-jie1x.wang@intel.com Errors-To: dev-bounces@dpdk.org The fields of L2TPv2 common header were reversed in big endian and little endian. This patch fixes this error to ensure L2TPv2 can be parsed correctly. Fixes: 3a929df1f286 ("ethdev: support L2TPv2 and PPP procotol") Signed-off-by: Jie Wang --- lib/net/rte_l2tpv2.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/lib/net/rte_l2tpv2.h b/lib/net/rte_l2tpv2.h index 938a993b48..1f3ad3f03c 100644 --- a/lib/net/rte_l2tpv2.h +++ b/lib/net/rte_l2tpv2.h @@ -89,16 +89,6 @@ struct rte_l2tpv2_common_hdr { __extension__ struct { #if RTE_BYTE_ORDER == RTE_LITTLE_ENDIAN - uint16_t t:1; /**< message Type */ - uint16_t l:1; /**< length option bit */ - uint16_t res1:2; /**< reserved */ - uint16_t s:1; /**< ns/nr option bit */ - uint16_t res2:1; /**< reserved */ - uint16_t o:1; /**< offset option bit */ - uint16_t p:1; /**< priority option bit */ - uint16_t res3:4; /**< reserved */ - uint16_t ver:4; /**< protocol version */ -#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN uint16_t ver:4; /**< protocol version */ uint16_t res3:4; /**< reserved */ uint16_t p:1; /**< priority option bit */ @@ -108,6 +98,16 @@ struct rte_l2tpv2_common_hdr { uint16_t res1:2; /**< reserved */ uint16_t l:1; /**< length option bit */ uint16_t t:1; /**< message Type */ +#elif RTE_BYTE_ORDER == RTE_BIG_ENDIAN + uint16_t t:1; /**< message Type */ + uint16_t l:1; /**< length option bit */ + uint16_t res1:2; /**< reserved */ + uint16_t s:1; /**< ns/nr option bit */ + uint16_t res2:1; /**< reserved */ + uint16_t o:1; /**< offset option bit */ + uint16_t p:1; /**< priority option bit */ + uint16_t res3:4; /**< reserved */ + uint16_t ver:4; /**< protocol version */ #endif }; }; -- 2.25.1