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 E8AC7A0547; Fri, 12 Mar 2021 12:08:09 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5ECC2160888; Fri, 12 Mar 2021 12:07:52 +0100 (CET) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 470F54067E 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 EF3FB7F5AA; Fri, 12 Mar 2021 14:07:47 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru EF3FB7F5AA DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1615547268; bh=zpQUTS6veHue+Qd2Veogvz+41lhLSQlJ0QqucMda5tw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=hCjkksS+DArKx4Y0b0aCeB2NtvKDF8ytKXaMho50HiB/znnO5k0Q6slEjHalqGahp SOYnxeQsEzirZzrUkW6QvP6XfcT8naBwbDNj5gHiAyVTr/I+YS9HNxbp+BhKCrQOIo Ayq93Y+VdAEWZlWF5N3z4V8INAwYEiVc0RghUJlo= From: Ivan Malov To: dev@dpdk.org Cc: Andrew Rybchenko , Andy Moreton , Ori Kam , Thomas Monjalon , Ferruh Yigit Date: Fri, 12 Mar 2021 14:07:39 +0300 Message-Id: <20210312110745.31721-4-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 04/10] ethdev: reuse header definition in flow pattern item VXLAN 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" One ought to reuse existing header structs in flow items. Signed-off-by: Ivan Malov Reviewed-by: Andrew Rybchenko Reviewed-by: Andy Moreton --- lib/librte_ethdev/rte_flow.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/lib/librte_ethdev/rte_flow.h b/lib/librte_ethdev/rte_flow.h index b9b349669..6cc57136a 100644 --- a/lib/librte_ethdev/rte_flow.h +++ b/lib/librte_ethdev/rte_flow.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -955,17 +956,27 @@ static const struct rte_flow_item_sctp rte_flow_item_sctp_mask = { * * Matches a VXLAN header (RFC 7348). */ +RTE_STD_C11 struct rte_flow_item_vxlan { - uint8_t flags; /**< Normally 0x08 (I flag). */ - uint8_t rsvd0[3]; /**< Reserved, normally 0x000000. */ - uint8_t vni[3]; /**< VXLAN identifier. */ - uint8_t rsvd1; /**< Reserved, normally 0x00. */ + union { + struct { + /* + * These fields are retained for compatibility. + * Please switch to the new header field below. + */ + uint8_t flags; /**< Normally 0x08 (I flag). */ + uint8_t rsvd0[3]; /**< Reserved, normally 0x000000. */ + uint8_t vni[3]; /**< VXLAN identifier. */ + uint8_t rsvd1; /**< Reserved, normally 0x00. */ + }; + struct rte_vxlan_hdr hdr; + }; }; /** Default mask for RTE_FLOW_ITEM_TYPE_VXLAN. */ #ifndef __cplusplus static const struct rte_flow_item_vxlan rte_flow_item_vxlan_mask = { - .vni = "\xff\xff\xff", + .hdr.vx_vni = RTE_BE32(__builtin_constant_p(0xffffff << 8)), }; #endif -- 2.20.1