From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 57F6D7D0B for ; Fri, 25 Aug 2017 09:51:17 +0200 (CEST) Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Aug 2017 00:51:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,424,1498546800"; d="scan'208";a="144422388" Received: from unknown (HELO dpdk9.sh.intel.com) ([10.67.119.137]) by fmsmga006.fm.intel.com with ESMTP; 25 Aug 2017 00:51:15 -0700 From: Beilei Xing To: jingjing.wu@intel.com Cc: dev@dpdk.org Date: Fri, 25 Aug 2017 15:50:25 +0800 Message-Id: <1503647430-93905-3-git-send-email-beilei.xing@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1503647430-93905-1-git-send-email-beilei.xing@intel.com> References: <1503647430-93905-1-git-send-email-beilei.xing@intel.com> Subject: [dpdk-dev] [PATCH 2/7] ethdev: add GTP item X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 25 Aug 2017 07:51:17 -0000 This patch adds GTP items to generic rte flow. Signed-off-by: Beilei Xing --- doc/guides/prog_guide/rte_flow.rst | 12 ++++++++++++ lib/librte_ether/rte_flow.h | 31 +++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst index 662a912..2843b71 100644 --- a/doc/guides/prog_guide/rte_flow.rst +++ b/doc/guides/prog_guide/rte_flow.rst @@ -955,6 +955,18 @@ Usage example, fuzzy match a TCPv4 packets: | 4 | END | +-------+----------+ +Item: ``GTP`` +^^^^^^^^^^^^^^ + +Matches a GTP header. + +- ``v_pt_rsv_flags``: version (3b), protocol type (1b), reserved (1b), + extension header flag (1b), sequence number flag (1b), N-PDU number flag(1b). +- ``msg_type``: message type. +- ``msg_len``: message length. +- ``teid``: TEID. +- Default ``mask`` matches teid only. + Actions ~~~~~~~ diff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h index bba6169..73305aa 100644 --- a/lib/librte_ether/rte_flow.h +++ b/lib/librte_ether/rte_flow.h @@ -309,6 +309,13 @@ enum rte_flow_item_type { * See struct rte_flow_item_fuzzy. */ RTE_FLOW_ITEM_TYPE_FUZZY, + + /** + * Matches a GTP header + * + * See struct rte_flow_item. + */ + RTE_FLOW_ITEM_TYPE_GTP, }; /** @@ -735,6 +742,30 @@ static const struct rte_flow_item_fuzzy rte_flow_item_fuzzy_mask = { #endif /** + * RTE_FLOW_ITEM_TYPE_GTP. + * + * Matches a GTP header. + */ +struct rte_flow_item_gtp { + /** + * Version(2b), Protocol type(1b), Reserved(1b), + * Extension header flag(1b), + * Sequqnce number flag(1b), + * N-PDU number flag(1b). + */ + uint8_t v_pt_rsv_flags; + uint8_t msg_type; /**< Message type */ + rte_be16_t msg_len; /**< Message length */ + rte_be32_t teid; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_GTP. */ +#ifndef __cplusplus + static const struct rte_flow_item_gtp rte_flow_item_gtp_mask = { + .teid = RTE_BE32(0xffffffff), + }; +#endif +/** * Matching pattern item definition. * * A pattern is formed by stacking items starting from the lowest protocol -- 2.5.5