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 DE44DA0C43; Fri, 24 Sep 2021 09:20:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DC6CC412D5; Fri, 24 Sep 2021 09:20:08 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 33C3C412C7 for ; Fri, 24 Sep 2021 09:20:06 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10116"; a="211094938" X-IronPort-AV: E=Sophos;i="5.85,319,1624345200"; d="scan'208";a="211094938" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2021 00:20:06 -0700 X-IronPort-AV: E=Sophos;i="5.85,319,1624345200"; d="scan'208";a="514506169" Received: from dpdk.cd.intel.com ([10.240.178.133]) by fmsmga008-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Sep 2021 00:20:03 -0700 From: Jie Wang To: dev@dpdk.org Cc: ferruh.yigit@intel.com, thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru, xiaoyun.li@intel.com, jingjing.wu@intel.com, beilei.xing@intel.com, wenjun1.wu@intel.com, stevex.yang@intel.com, Jie Wang Date: Fri, 24 Sep 2021 23:17:04 +0800 Message-Id: <20210924151705.287571-4-jie1x.wang@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210924151705.287571-1-jie1x.wang@intel.com> References: <20210924151705.287571-1-jie1x.wang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH 3/4] ethdev: support PPPoL2TPv2oUDP RSS Hash 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" Add flow pattern items, RSS offload types and header formats of L2TPv2 and PPP. Signed-off-by: Wenjun Wu Signed-off-by: Jie Wang --- lib/ethdev/rte_flow.c | 2 + lib/ethdev/rte_flow.h | 99 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 101 insertions(+) diff --git a/lib/ethdev/rte_flow.c b/lib/ethdev/rte_flow.c index 8cb7a069c8..307fbc3abe 100644 --- a/lib/ethdev/rte_flow.c +++ b/lib/ethdev/rte_flow.c @@ -98,6 +98,8 @@ static const struct rte_flow_desc_data rte_flow_desc_item[] = { MK_FLOW_ITEM(PFCP, sizeof(struct rte_flow_item_pfcp)), MK_FLOW_ITEM(ECPRI, sizeof(struct rte_flow_item_ecpri)), MK_FLOW_ITEM(GENEVE_OPT, sizeof(struct rte_flow_item_geneve_opt)), + MK_FLOW_ITEM(L2TPV2, sizeof(struct rte_flow_item_l2tpv2)), + MK_FLOW_ITEM(PPP, sizeof(struct rte_flow_item_ppp)), MK_FLOW_ITEM(INTEGRITY, sizeof(struct rte_flow_item_integrity)), MK_FLOW_ITEM(CONNTRACK, sizeof(uint32_t)), }; diff --git a/lib/ethdev/rte_flow.h b/lib/ethdev/rte_flow.h index 70f455d47d..93205b7d1e 100644 --- a/lib/ethdev/rte_flow.h +++ b/lib/ethdev/rte_flow.h @@ -554,6 +554,20 @@ enum rte_flow_item_type { */ RTE_FLOW_ITEM_TYPE_GENEVE_OPT, + /** + * Matches L2TPV2 Header. + * + * See struct rte_flow_item_l2tpv2. + */ + RTE_FLOW_ITEM_TYPE_L2TPV2, + + /** + * Matches PPP Header. + * + * See struct rte_flow_item_ppp. + */ + RTE_FLOW_ITEM_TYPE_PPP, + /** * [META] * @@ -1799,6 +1813,91 @@ static const struct rte_flow_item_conntrack rte_flow_item_conntrack_mask = { }; #endif +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * RTE_FLOW_ITEM_TYPE_L2TPV2 + * + * Matches L2TPv2 Header + */ +RTE_STD_C11 +struct rte_flow_item_l2tpv2 { + rte_be16_t flags_version; /**< flag(12) version(2). version must be 2 */ + union{ + struct{ + rte_be16_t length; /**< length(16) */ + rte_be16_t tunnel_id; /**< tunnel id(16) */ + rte_be16_t session_id; /**< session id(16) */ + rte_be32_t ns_nr; /**< Ns(16) + Nr(16) */ + rte_be32_t offset; /**< offset size(16) + offset padding(16) */ + } type1; + struct{ + rte_be16_t tunnel_id; /**< tunnel id(16) */ + rte_be16_t session_id; /**< session id(16) */ + rte_be32_t ns_nr; /**< Ns(16) + Nr(16) */ + rte_be32_t offset; /**< offset size(16) + offset padding(16) */ + } type2; + struct{ + rte_be16_t length; /**< length(16) */ + rte_be16_t tunnel_id; /**< tunnel id(16) */ + rte_be16_t session_id; /**< session id(16) */ + rte_be32_t offset; /**< offset size(16) + offset padding(16) */ + } type3; + struct{ + rte_be16_t length; /**< length(16) */ + rte_be16_t tunnel_id; /**< tunnel id(16) */ + rte_be16_t session_id; /**< session id(16) */ + rte_be32_t ns_nr; /**< Ns(16) + Nr(16) */ + } type4; + struct{ + rte_be16_t tunnel_id; /**< tunnel id(16) */ + rte_be16_t session_id; /**< session id(16) */ + rte_be32_t offset; /**< offset size(16) + offset padding(16) */ + } type5; + struct{ + rte_be16_t tunnel_id; /**< tunnel id(16) */ + rte_be16_t session_id; /**< session id(16) */ + rte_be32_t ns_nr; /**< Ns(16) + Nr(16) */ + } type6; + struct{ + rte_be16_t length; /**< length(16) */ + rte_be16_t tunnel_id; /**< tunnel id(16) */ + rte_be16_t session_id; /**< session id(16) */ + } type7; + struct{ + rte_be16_t tunnel_id; /**< tunnel id(16) */ + rte_be16_t session_id; /**< session id(16) */ + } type8; + }; +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_L2TPV2. */ +#ifndef __cplusplus +static const struct rte_flow_item_l2tpv2 rte_flow_item_l2tpv2_mask = { + .flags_version = 0xffff, +}; +#endif + +/** + * @warning + * @b EXPERIMENTAL: this structure may change without prior notice + * RTE_FLOW_ITEM_TYPE_PPP + * + * Matches PPP Header + */ +struct rte_flow_item_ppp { + rte_be16_t pppaddr_ctrl; /**< ppp address(8) + control(8) */ + rte_be16_t pppproto_id; /**< ppp protocol id(16) */ +}; + +/** Default mask for RTE_FLOW_ITEM_TYPE_PPP. */ +#ifndef __cplusplus +static const struct rte_flow_item_ppp rte_flow_item_ppp_mask = { + .pppaddr_ctrl = 0xffff, + .pppproto_id = 0xffff, +}; +#endif + /** * Matching pattern item definition. * -- 2.25.1