From patchwork Fri Sep 10 08:08:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 98557 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id CD4EBA0547; Fri, 10 Sep 2021 10:26:58 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A964C4067E; Fri, 10 Sep 2021 10:26:57 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id B01A44003E for ; Fri, 10 Sep 2021 10:26:53 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="208136136" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="208136136" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 01:26:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="540346326" Received: from wuwenjun.sh.intel.com ([10.67.110.178]) by FMSMGA003.fm.intel.com with ESMTP; 10 Sep 2021 01:26:47 -0700 From: Wenjun Wu To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Yuying Zhang Date: Fri, 10 Sep 2021 16:08:15 +0800 Message-Id: <20210910080821.18718-2-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210910080821.18718-1-wenjun1.wu@intel.com> References: <20210910080821.18718-1-wenjun1.wu@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 20.11 1/7] net/ice: add priority check for flow filters 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" From: Yuying Zhang This patch is not for LTS upstream, just for users to cherry-pick. Priority 0 and 1 were supported in switch filter. However, FDIR, ACL and RSS don't support priority 1. Add priority check in FDIR, ACL and RSS filter parse functions. Signed-off-by: Yuying Zhang --- drivers/net/ice/ice_acl_filter.c | 5 ++++- drivers/net/ice/ice_fdir_filter.c | 5 ++++- drivers/net/ice/ice_hash.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/net/ice/ice_acl_filter.c b/drivers/net/ice/ice_acl_filter.c index 14e36aa9f6..201c9fb382 100644 --- a/drivers/net/ice/ice_acl_filter.c +++ b/drivers/net/ice/ice_acl_filter.c @@ -904,7 +904,7 @@ ice_acl_parse(struct ice_adapter *ad, uint32_t array_len, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], - uint32_t priority __rte_unused, + uint32_t priority, void **meta, struct rte_flow_error *error) { @@ -914,6 +914,9 @@ ice_acl_parse(struct ice_adapter *ad, uint64_t input_set; int ret; + if (priority >= 1) + return -rte_errno; + memset(filter, 0, sizeof(*filter)); item = ice_search_pattern_match_item(pattern, array, array_len, error); if (!item) diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c index be04fcb8f3..1a9280a2eb 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -2029,7 +2029,7 @@ ice_fdir_parse(struct ice_adapter *ad, uint32_t array_len, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], - uint32_t priority __rte_unused, + uint32_t priority, void **meta, struct rte_flow_error *error) { @@ -2039,6 +2039,9 @@ ice_fdir_parse(struct ice_adapter *ad, uint64_t input_set; int ret; + if (priority >= 1) + return -rte_errno; + memset(filter, 0, sizeof(*filter)); item = ice_search_pattern_match_item(pattern, array, array_len, error); if (!item) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index ae095eb3cf..b8a87ea1dd 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -1238,7 +1238,7 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad, uint32_t array_len, const struct rte_flow_item pattern[], const struct rte_flow_action actions[], - uint32_t priority __rte_unused, + uint32_t priority, void **meta, struct rte_flow_error *error) { @@ -1246,6 +1246,9 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad, struct ice_pattern_match_item *pattern_match_item; struct rss_meta *rss_meta_ptr; + if (priority >= 1) + return -rte_errno; + rss_meta_ptr = rte_zmalloc(NULL, sizeof(*rss_meta_ptr), 0); if (!rss_meta_ptr) { rte_flow_error_set(error, EINVAL, From patchwork Fri Sep 10 08:08:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 98559 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AF80FA0547; Fri, 10 Sep 2021 10:27:09 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F260341120; Fri, 10 Sep 2021 10:26:59 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 760A74003E for ; Fri, 10 Sep 2021 10:26:54 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="208136146" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="208136146" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 01:26:50 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="540346341" Received: from wuwenjun.sh.intel.com ([10.67.110.178]) by FMSMGA003.fm.intel.com with ESMTP; 10 Sep 2021 01:26:48 -0700 From: Wenjun Wu To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Yuying Zhang Date: Fri, 10 Sep 2021 16:08:16 +0800 Message-Id: <20210910080821.18718-3-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210910080821.18718-1-wenjun1.wu@intel.com> References: <20210910080821.18718-1-wenjun1.wu@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 20.11 2/7] net/ice: refine flow priority usage 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" From: Yuying Zhang This patch is not for LTS upstream, just for users to cherry-pick. Current code uses switch filter as backup of FDIR in non-pipeline mode and Value 1 denotes higher priority. This patch refines priority usage to match the original design of rte_flow attribute. When priority is 0, rules are create in switch filter first and FDIR is used as backup. When priority is 1, only switch filter is supported and has lower priority. Signed-off-by: Yuying Zhang --- drivers/net/ice/ice_generic_flow.c | 4 ++-- drivers/net/ice/ice_switch_filter.c | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index ec141e8fa0..e195161a18 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -1927,9 +1927,9 @@ ice_register_parser(struct ice_flow_parser *parser, } else { if (parser->engine->type == ICE_FLOW_ENGINE_SWITCH || parser->engine->type == ICE_FLOW_ENGINE_HASH) - TAILQ_INSERT_TAIL(list, parser_node, node); - else if (parser->engine->type == ICE_FLOW_ENGINE_FDIR) TAILQ_INSERT_HEAD(list, parser_node, node); + else if (parser->engine->type == ICE_FLOW_ENGINE_FDIR) + TAILQ_INSERT_TAIL(list, parser_node, node); else if (parser->engine->type == ICE_FLOW_ENGINE_ACL) TAILQ_INSERT_HEAD(list, parser_node, node); else diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index db1586c970..45fa9723d2 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -1560,7 +1560,7 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad, rule_info->sw_act.src = rule_info->sw_act.vsi_handle; rule_info->sw_act.flag = ICE_FLTR_RX; rule_info->rx = 1; - rule_info->priority = priority + 5; + rule_info->priority = 6 - priority; return 0; } @@ -1639,7 +1639,7 @@ ice_switch_parse_action(struct ice_pf *pf, rule_info->sw_act.vsi_handle = vsi->idx; rule_info->rx = 1; rule_info->sw_act.src = vsi->idx; - rule_info->priority = priority + 5; + rule_info->priority = 6 - priority; return 0; @@ -1749,6 +1749,9 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad, ICE_NON_TUN; struct ice_pattern_match_item *pattern_match_item = NULL; + if (priority != 0 && priority != 1) + return rte_errno; + for (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) { item_num++; if (item->type == RTE_FLOW_ITEM_TYPE_ETH) { From patchwork Fri Sep 10 08:08:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 98558 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1F85CA0547; Fri, 10 Sep 2021 10:27:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C967B410F5; Fri, 10 Sep 2021 10:26:58 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id 3830840041 for ; Fri, 10 Sep 2021 10:26:54 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="208136174" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="208136174" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 01:26:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="540346354" Received: from wuwenjun.sh.intel.com ([10.67.110.178]) by FMSMGA003.fm.intel.com with ESMTP; 10 Sep 2021 01:26:50 -0700 From: Wenjun Wu To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Wenjun Wu , Dapeng Yu Date: Fri, 10 Sep 2021 16:08:17 +0800 Message-Id: <20210910080821.18718-4-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210910080821.18718-1-wenjun1.wu@intel.com> References: <20210910080821.18718-1-wenjun1.wu@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 20.11 3/7] net/ice: support 256 queues 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" This patch is not for LTS upstream, just for users to cherry-pick. 256 queues can be allowed now. Improve the code to support 256 queues for per PF. Signed-off-by: Dapeng Yu Signed-off-by: Wenjun Wu --- drivers/net/ice/ice_ethdev.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index f96625f43a..94b99999b3 100644 --- a/drivers/net/ice/ice_ethdev.h +++ b/drivers/net/ice/ice_ethdev.h @@ -21,8 +21,8 @@ #define ICE_ADMINQ_BUF_SZ 4096 #define ICE_SBIOQ_BUF_SZ 4096 #define ICE_MAILBOXQ_BUF_SZ 4096 -/* Number of queues per TC should be one of 1, 2, 4, 8, 16, 32, 64 */ -#define ICE_MAX_Q_PER_TC 64 +/* Number of queues per TC should be one of 1, 2, 4, 8, 16, 32, 64, 128, 256 */ +#define ICE_MAX_Q_PER_TC 256 #define ICE_NUM_DESC_DEFAULT 512 #define ICE_BUF_SIZE_MIN 1024 #define ICE_FRAME_SIZE_MAX 9728 From patchwork Fri Sep 10 08:08:18 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 98561 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 22A5BA0547; Fri, 10 Sep 2021 10:27:20 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4BD5141125; Fri, 10 Sep 2021 10:27:05 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id B730A410E8 for ; Fri, 10 Sep 2021 10:27:01 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="221060986" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="221060986" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 01:26:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="540346388" Received: from wuwenjun.sh.intel.com ([10.67.110.178]) by FMSMGA003.fm.intel.com with ESMTP; 10 Sep 2021 01:26:57 -0700 From: Wenjun Wu To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Wenjun Wu Date: Fri, 10 Sep 2021 16:08:18 +0800 Message-Id: <20210910080821.18718-5-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210910080821.18718-1-wenjun1.wu@intel.com> References: <20210910080821.18718-1-wenjun1.wu@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 20.11 4/7] net/ice: fix error set of queue number 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" This patch is not for LTS upstream, just for users to cherry-pick. The queue number actually applied should be the maximum integer power of 2 less than or equal to min(vsi->nb_qps, ICE_MAX_Q_PER_TC), so we need to get the most significant 1 bit. However the return value of function rte_bsf32 is the least significant 1 bit. This patch replaces the function rte_bsf32 with the function rte_fls_u32 and adds necessary boundary check. Signed-off-by: Wenjun Wu --- drivers/net/ice/ice_ethdev.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c index 5a1e775718..ce98477427 100644 --- a/drivers/net/ice/ice_ethdev.c +++ b/drivers/net/ice/ice_ethdev.c @@ -750,7 +750,7 @@ ice_vsi_config_tc_queue_mapping(struct ice_vsi *vsi, struct ice_aqc_vsi_props *info, uint8_t enabled_tcmap) { - uint16_t bsf, qp_idx; + uint16_t fls, qp_idx; /* default tc 0 now. Multi-TC supporting need to be done later. * Configure TC and queue mapping parameters, for enabled TC, @@ -762,15 +762,15 @@ ice_vsi_config_tc_queue_mapping(struct ice_vsi *vsi, } vsi->nb_qps = RTE_MIN(vsi->nb_qps, ICE_MAX_Q_PER_TC); - bsf = rte_bsf32(vsi->nb_qps); + fls = (vsi->nb_qps == 0) ? 0 : rte_fls_u32(vsi->nb_qps) - 1; /* Adjust the queue number to actual queues that can be applied */ - vsi->nb_qps = 0x1 << bsf; + vsi->nb_qps = (vsi->nb_qps == 0) ? 0 : 0x1 << fls; qp_idx = 0; /* Set tc and queue mapping with VSI */ info->tc_mapping[0] = rte_cpu_to_le_16((qp_idx << ICE_AQ_VSI_TC_Q_OFFSET_S) | - (bsf << ICE_AQ_VSI_TC_Q_NUM_S)); + (fls << ICE_AQ_VSI_TC_Q_NUM_S)); /* Associate queue number with VSI */ info->mapping_flags |= rte_cpu_to_le_16(ICE_AQ_VSI_Q_MAP_CONTIG); From patchwork Fri Sep 10 08:08:19 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 98560 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2D3DFA0547; Fri, 10 Sep 2021 10:27:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 258A14112E; Fri, 10 Sep 2021 10:27:02 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 2195E41125 for ; Fri, 10 Sep 2021 10:27:00 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="221060993" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="221060993" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 01:26:59 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="540346395" Received: from wuwenjun.sh.intel.com ([10.67.110.178]) by FMSMGA003.fm.intel.com with ESMTP; 10 Sep 2021 01:26:58 -0700 From: Wenjun Wu To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Wenjun Wu Date: Fri, 10 Sep 2021 16:08:19 +0800 Message-Id: <20210910080821.18718-6-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210910080821.18718-1-wenjun1.wu@intel.com> References: <20210910080821.18718-1-wenjun1.wu@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 20.11 5/7] net/ice: support 6-tuple RSS 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" This patch is not for LTS upstream, just for users to cherry-pick. Add 6-tuple RSS support for pattern eth/vlan/ipv4, eth/vlan/ipv4/sctp, eth/vlan/ipv4/udp,eth/vlan/ipv4/tcp. Signed-off-by: Wenjun Wu --- drivers/net/ice/ice_hash.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c index b8a87ea1dd..89bc458b86 100644 --- a/drivers/net/ice/ice_hash.c +++ b/drivers/net/ice/ice_hash.c @@ -505,6 +505,9 @@ struct ice_hash_match_type ice_hash_type_list[] = { {ETH_RSS_IPV4 | ETH_RSS_L3_DST_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_DA)}, {ETH_RSS_IPV4, ICE_FLOW_HASH_IPV4}, + {ETH_RSS_C_VLAN | ETH_RSS_IPV4, + BIT_ULL(ICE_FLOW_FIELD_IDX_C_VLAN) | + ICE_FLOW_HASH_IPV4}, {ETH_RSS_FRAG_IPV4, ICE_FLOW_HASH_IPV4 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_ID)}, @@ -539,6 +542,10 @@ struct ice_hash_match_type ice_hash_type_list[] = { {ETH_RSS_NONFRAG_IPV4_UDP, ICE_HASH_UDP_IPV4 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, + {ETH_RSS_C_VLAN | ETH_RSS_NONFRAG_IPV4_UDP, + BIT_ULL(ICE_FLOW_FIELD_IDX_C_VLAN) | + ICE_HASH_UDP_IPV4 | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, {ETH_RSS_NONFRAG_IPV4_TCP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT) | @@ -570,6 +577,10 @@ struct ice_hash_match_type ice_hash_type_list[] = { {ETH_RSS_NONFRAG_IPV4_TCP, ICE_HASH_TCP_IPV4 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, + {ETH_RSS_C_VLAN | ETH_RSS_NONFRAG_IPV4_TCP, + BIT_ULL(ICE_FLOW_FIELD_IDX_C_VLAN) | + ICE_HASH_TCP_IPV4 | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, {ETH_RSS_NONFRAG_IPV4_SCTP | ETH_RSS_L3_SRC_ONLY | ETH_RSS_L4_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_SA) | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT) | @@ -601,6 +612,10 @@ struct ice_hash_match_type ice_hash_type_list[] = { {ETH_RSS_NONFRAG_IPV4_SCTP, ICE_HASH_SCTP_IPV4 | BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, + {ETH_RSS_C_VLAN | ETH_RSS_NONFRAG_IPV4_SCTP, + BIT_ULL(ICE_FLOW_FIELD_IDX_C_VLAN) | + ICE_HASH_SCTP_IPV4 | + BIT_ULL(ICE_FLOW_FIELD_IDX_IPV4_PROT)}, /* IPV6 */ {ETH_RSS_IPV6 | ETH_RSS_L3_SRC_ONLY, BIT_ULL(ICE_FLOW_FIELD_IDX_IPV6_SA)}, From patchwork Fri Sep 10 08:08:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 98562 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 64233A0547; Fri, 10 Sep 2021 10:27:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6343C4113D; Fri, 10 Sep 2021 10:27:06 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id D868C41135 for ; Fri, 10 Sep 2021 10:27:02 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="221061056" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="221061056" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 01:27:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="540346438" Received: from wuwenjun.sh.intel.com ([10.67.110.178]) by FMSMGA003.fm.intel.com with ESMTP; 10 Sep 2021 01:27:01 -0700 From: Wenjun Wu To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Wenjun Wu , Steve Yang Date: Fri, 10 Sep 2021 16:08:20 +0800 Message-Id: <20210910080821.18718-7-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210910080821.18718-1-wenjun1.wu@intel.com> References: <20210910080821.18718-1-wenjun1.wu@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 20.11 6/7] net/ice: add L4 support for QinQ switch filter 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" This patch is not for LTS upstream, just for users to cherry-pick. Add L4 support for QinQ switch filter as following flow patterns: eth / vlan / vlan / ipv4 / udp eth / vlan / vlan / ipv4 / tcp eth / vlan / vlan / ipv6 / udp eth / vlan / vlan / ipv6 / tcp Signed-off-by: Steve Yang Signed-off-by: Wenjun Wu --- drivers/net/ice/ice_switch_filter.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index 45fa9723d2..eed72d9446 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -44,6 +44,12 @@ ICE_INSET_IPV4_PROTO | ICE_INSET_IPV4_TTL | ICE_INSET_IPV4_TOS) #define ICE_SW_INSET_MAC_QINQ_IPV4 ( \ ICE_SW_INSET_MAC_QINQ | ICE_SW_INSET_MAC_IPV4) +#define ICE_SW_INSET_MAC_QINQ_IPV4_TCP ( \ + ICE_SW_INSET_MAC_QINQ_IPV4 | \ + ICE_INSET_TCP_DST_PORT | ICE_INSET_TCP_SRC_PORT) +#define ICE_SW_INSET_MAC_QINQ_IPV4_UDP ( \ + ICE_SW_INSET_MAC_QINQ_IPV4 | \ + ICE_INSET_UDP_DST_PORT | ICE_INSET_UDP_SRC_PORT) #define ICE_SW_INSET_MAC_IPV4_TCP ( \ ICE_INSET_DMAC | ICE_INSET_IPV4_DST | ICE_INSET_IPV4_SRC | \ ICE_INSET_IPV4_TTL | ICE_INSET_IPV4_TOS | \ @@ -58,6 +64,12 @@ ICE_INSET_IPV6_NEXT_HDR) #define ICE_SW_INSET_MAC_QINQ_IPV6 ( \ ICE_SW_INSET_MAC_QINQ | ICE_SW_INSET_MAC_IPV6) +#define ICE_SW_INSET_MAC_QINQ_IPV6_TCP ( \ + ICE_SW_INSET_MAC_QINQ_IPV6 | \ + ICE_INSET_TCP_DST_PORT | ICE_INSET_TCP_SRC_PORT) +#define ICE_SW_INSET_MAC_QINQ_IPV6_UDP ( \ + ICE_SW_INSET_MAC_QINQ_IPV6 | \ + ICE_INSET_UDP_DST_PORT | ICE_INSET_UDP_SRC_PORT) #define ICE_SW_INSET_MAC_IPV6_TCP ( \ ICE_INSET_DMAC | ICE_INSET_IPV6_DST | ICE_INSET_IPV6_SRC | \ ICE_INSET_IPV6_HOP_LIMIT | ICE_INSET_IPV6_TC | \ @@ -274,8 +286,16 @@ ice_pattern_match_item ice_switch_pattern_dist_comms[] = { ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_qinq_ipv4, ICE_SW_INSET_MAC_QINQ_IPV4, ICE_INSET_NONE}, + {pattern_eth_qinq_ipv4_tcp, + ICE_SW_INSET_MAC_QINQ_IPV4_TCP, ICE_INSET_NONE}, + {pattern_eth_qinq_ipv4_udp, + ICE_SW_INSET_MAC_QINQ_IPV4_UDP, ICE_INSET_NONE}, {pattern_eth_qinq_ipv6, ICE_SW_INSET_MAC_QINQ_IPV6, ICE_INSET_NONE}, + {pattern_eth_qinq_ipv6_tcp, + ICE_SW_INSET_MAC_QINQ_IPV6_TCP, ICE_INSET_NONE}, + {pattern_eth_qinq_ipv6_udp, + ICE_SW_INSET_MAC_QINQ_IPV6_UDP, ICE_INSET_NONE}, {pattern_eth_qinq_pppoes, ICE_SW_INSET_MAC_PPPOE, ICE_INSET_NONE}, {pattern_eth_qinq_pppoes_proto, @@ -410,8 +430,16 @@ ice_pattern_match_item ice_switch_pattern_perm_comms[] = { ICE_INSET_NONE, ICE_INSET_NONE}, {pattern_eth_qinq_ipv4, ICE_SW_INSET_MAC_QINQ_IPV4, ICE_INSET_NONE}, + {pattern_eth_qinq_ipv4_tcp, + ICE_SW_INSET_MAC_QINQ_IPV4_TCP, ICE_INSET_NONE}, + {pattern_eth_qinq_ipv4_udp, + ICE_SW_INSET_MAC_QINQ_IPV4_UDP, ICE_INSET_NONE}, {pattern_eth_qinq_ipv6, ICE_SW_INSET_MAC_QINQ_IPV6, ICE_INSET_NONE}, + {pattern_eth_qinq_ipv6_tcp, + ICE_SW_INSET_MAC_QINQ_IPV6_TCP, ICE_INSET_NONE}, + {pattern_eth_qinq_ipv6_udp, + ICE_SW_INSET_MAC_QINQ_IPV6_UDP, ICE_INSET_NONE}, {pattern_eth_qinq_pppoes, ICE_SW_INSET_MAC_PPPOE, ICE_INSET_NONE}, {pattern_eth_qinq_pppoes_proto, From patchwork Fri Sep 10 08:08:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wenjun Wu X-Patchwork-Id: 98563 X-Patchwork-Delegate: qi.z.zhang@intel.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 3CF0BA0547; Fri, 10 Sep 2021 10:27:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E83AA4113C; Fri, 10 Sep 2021 10:27:09 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 3819040E46 for ; Fri, 10 Sep 2021 10:27:08 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10102"; a="221061066" X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="221061066" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Sep 2021 01:27:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,282,1624345200"; d="scan'208";a="540346475" Received: from wuwenjun.sh.intel.com ([10.67.110.178]) by FMSMGA003.fm.intel.com with ESMTP; 10 Sep 2021 01:27:06 -0700 From: Wenjun Wu To: dev@dpdk.org, qi.z.zhang@intel.com Cc: Steve Yang , Wenjun Wu Date: Fri, 10 Sep 2021 16:08:21 +0800 Message-Id: <20210910080821.18718-8-wenjun1.wu@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210910080821.18718-1-wenjun1.wu@intel.com> References: <20210910080821.18718-1-wenjun1.wu@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 20.11 7/7] net/ice/base: support L4 for QinQ switch filter 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" From: Steve Yang This patch is not for LTS upstream, just for users to cherry-pick. This patch adds more dummy packet types for QinQ packet, it enables tcp/udp layer of ipv4/ipv6 for QinQ payload, so we can use L4 dst/src port as input set for switch filter. For Example: flow create 0 ingress pattern eth / vlan tci is 2 / vlan tci is 1 \ / ipv4 src is 196.222.232.221 / tcp src is 400 / end actions queue \ index 1 / end Signed-off-by: Steve Yang Signed-off-by: Wenjun Wu --- drivers/net/ice/base/ice_switch.c | 176 +++++++++++++++++++++++++++++- 1 file changed, 170 insertions(+), 6 deletions(-) diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 6c4dfec062..183b169ccd 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -1228,12 +1228,78 @@ static const u8 dummy_qinq_ipv4_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, /* 2 bytes for 4 byte alignment */ +}; + +static const +struct ice_dummy_pkt_offsets dummy_qinq_ipv4_udp_packet_offsets[] = { + { ICE_MAC_OFOS, 0 }, + { ICE_ETYPE_OL, 12 }, + { ICE_VLAN_EX, 14 }, + { ICE_VLAN_IN, 18 }, + { ICE_IPV4_OFOS, 22 }, + { ICE_UDP_ILOS, 42 }, + { ICE_PROTOCOL_LAST, 0 }, +}; + +static const u8 dummy_qinq_ipv4_udp_pkt[] = { + 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x91, 0x00, /* ICE_ETYPE_OL 12 */ + + 0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */ + 0x00, 0x00, 0x08, 0x00, /* ICE_VLAN_IN 18 */ + + 0x45, 0x00, 0x00, 0x1c, /* ICE_IPV4_OFOS 22 */ + 0x00, 0x01, 0x00, 0x00, + 0x00, 0x11, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 42 */ 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, /* 2 bytes for 4 byte alignment */ }; +static const +struct ice_dummy_pkt_offsets dummy_qinq_ipv4_tcp_packet_offsets[] = { + { ICE_MAC_OFOS, 0 }, + { ICE_ETYPE_OL, 12 }, + { ICE_VLAN_EX, 14 }, + { ICE_VLAN_IN, 18 }, + { ICE_IPV4_OFOS, 22 }, + { ICE_TCP_IL, 42 }, + { ICE_PROTOCOL_LAST, 0 }, +}; + +static const u8 dummy_qinq_ipv4_tcp_pkt[] = { + 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x91, 0x00, /* ICE_ETYPE_OL 12 */ + + 0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */ + 0x00, 0x00, 0x08, 0x00, /* ICE_VLAN_IN 18 */ + + 0x45, 0x00, 0x00, 0x28, /* ICE_IPV4_OFOS 22 */ + 0x00, 0x01, 0x00, 0x00, + 0x00, 0x06, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x00, 0x00, 0x00, /* ICE_TCP_IL 42 */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x50, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x00, /* 2 bytes for 4 byte alignment */ +}; + static const struct ice_dummy_pkt_offsets dummy_qinq_ipv6_packet_offsets[] = { { ICE_MAC_OFOS, 0 }, { ICE_ETYPE_OL, 12 }, @@ -1248,13 +1314,46 @@ static const u8 dummy_qinq_ipv6_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x91, 0x00, /* ICE_ETYPE_OL 12 */ + 0x91, 0x00, /* ICE_ETYPE_OL 12 */ + 0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */ + 0x00, 0x00, 0x86, 0xDD,/* ICE_VLAN_IN 18 */ - 0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */ - 0x00, 0x00, 0x86, 0xDD, /* ICE_VLAN_IN 18 */ + 0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 22 */ + 0x00, 0x00, 0x3b, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x00, /* 2 bytes for 4 byte alignment */ +}; + +static const +struct ice_dummy_pkt_offsets dummy_qinq_ipv6_udp_packet_offsets[] = { + { ICE_MAC_OFOS, 0 }, + { ICE_ETYPE_OL, 12 }, + { ICE_VLAN_EX, 14 }, + { ICE_VLAN_IN, 18 }, + { ICE_IPV6_OFOS, 22 }, + { ICE_UDP_ILOS, 62 }, + { ICE_PROTOCOL_LAST, 0 }, +}; + +static const u8 dummy_qinq_ipv6_udp_pkt[] = { + 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x91, 0x00, /* ICE_ETYPE_OL 12 */ + 0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */ + 0x00, 0x00, 0x86, 0xDD,/* ICE_VLAN_IN 18 */ 0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 22 */ - 0x00, 0x10, 0x11, 0x00, /* Next header UDP */ + 0x00, 0x08, 0x11, 0x00, /* Next header UDP */ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, @@ -1265,9 +1364,46 @@ static const u8 dummy_qinq_ipv6_pkt[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* ICE_UDP_ILOS 62 */ - 0x00, 0x10, 0x00, 0x00, + 0x00, 0x08, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, /* needed for ESP packets */ + 0x00, 0x00, /* 2 bytes for 4 byte alignment */ +}; + +static const +struct ice_dummy_pkt_offsets dummy_qinq_ipv6_tcp_packet_offsets[] = { + { ICE_MAC_OFOS, 0 }, + { ICE_ETYPE_OL, 12 }, + { ICE_VLAN_EX, 14 }, + { ICE_VLAN_IN, 18 }, + { ICE_IPV6_OFOS, 22 }, + { ICE_TCP_IL, 62 }, + { ICE_PROTOCOL_LAST, 0 }, +}; + +static const u8 dummy_qinq_ipv6_tcp_pkt[] = { + 0x00, 0x00, 0x00, 0x00, /* ICE_MAC_OFOS 0 */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x91, 0x00, /* ICE_ETYPE_OL 12 */ + 0x00, 0x00, 0x81, 0x00, /* ICE_VLAN_EX 14 */ + 0x00, 0x00, 0x86, 0xDD, /* ICE_VLAN_IN 18 */ + + 0x60, 0x00, 0x00, 0x00, /* ICE_IPV6_OFOS 22 */ + 0x00, 0x14, 0x06, 0x00, /* Next header TCP */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + + 0x00, 0x00, 0x00, 0x00, /* ICE_TCP_IL 62 */ + 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 2 bytes for 4 byte alignment */ @@ -7382,12 +7518,40 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, if ((tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ || tun_type == ICE_NON_TUN_QINQ) && ipv6) { + if (tcp) { + *pkt = dummy_qinq_ipv6_tcp_pkt; + *pkt_len = sizeof(dummy_qinq_ipv6_tcp_pkt); + *offsets = dummy_qinq_ipv6_tcp_packet_offsets; + return; + } + + if (udp) { + *pkt = dummy_qinq_ipv6_udp_pkt; + *pkt_len = sizeof(dummy_qinq_ipv6_udp_pkt); + *offsets = dummy_qinq_ipv6_udp_packet_offsets; + return; + } + *pkt = dummy_qinq_ipv6_pkt; *pkt_len = sizeof(dummy_qinq_ipv6_pkt); *offsets = dummy_qinq_ipv6_packet_offsets; return; } else if (tun_type == ICE_SW_TUN_AND_NON_TUN_QINQ || tun_type == ICE_NON_TUN_QINQ) { + if (tcp) { + *pkt = dummy_qinq_ipv4_tcp_pkt; + *pkt_len = sizeof(dummy_qinq_ipv4_tcp_pkt); + *offsets = dummy_qinq_ipv4_tcp_packet_offsets; + return; + } + + if (udp) { + *pkt = dummy_qinq_ipv4_udp_pkt; + *pkt_len = sizeof(dummy_qinq_ipv4_udp_pkt); + *offsets = dummy_qinq_ipv4_udp_packet_offsets; + return; + } + *pkt = dummy_qinq_ipv4_pkt; *pkt_len = sizeof(dummy_qinq_ipv4_pkt); *offsets = dummy_qinq_ipv4_packet_offsets;