From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C627BA051C for ; Tue, 11 Feb 2020 12:42:08 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B9EEE1C01B; Tue, 11 Feb 2020 12:42:08 +0100 (CET) Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by dpdk.org (Postfix) with ESMTP id AD6A31C01B for ; Tue, 11 Feb 2020 12:42:07 +0100 (CET) Received: by mail-wr1-f45.google.com with SMTP id w15so11967345wru.4 for ; Tue, 11 Feb 2020 03:42:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1j+Ur+OHhPcaGTAGOGDaSNk8BKCutJcWPd+obSzOfho=; b=YslsGLthxVa/x6Vq3xfZPaFwdR8VJ0chvJih9Z8M4tI5XtvnY1g5VAVX8yvtU7bSEj dZed7LrjZudomdgGC+JIiwNIcPaXRY3SCVaawnDFtiiSjnmBJNA/zRDM/g07nK6jROt+ BfwWrsGHR83u01R9wjwv09ahGaTz7DyLU5mvyQoxkrXNdgfr19wm1SRw/qsv627sRNE2 G9mnc+Lzya2u8uL+BfjDI7YOuLW/aLp8Z07q4nhkTIuvMIB7GodSiw2sugVRb51RprXR LYU4T26oGQ2yz/whsMPg67IxTtntWn4soG94fWSSbChAIQ5/XWRmeZXrV16FxZ/mkEkR 6WVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1j+Ur+OHhPcaGTAGOGDaSNk8BKCutJcWPd+obSzOfho=; b=mZbH7aWs1EolfEulcayikGGG7VxPJ4+sU/hQHGfDoJjJyfyXzfDSSRZZvgFUL9mYL9 EfOfU6MG+PhDRdybxbsig/sxN2RXhGSXzovqBEHqc5oLyIinomu7E9gVNxurQym0YtfM IecKcD1F4xfpn+/0MQ51GHAdDPVWJYC+GBUPdgU6xsAdmeiIg3trX5PlFnaJGicxXrep HDsC6on6ySKdpuQM3D+etxKxiw/kQqprRZ0a3FUCjwBzXOW+AOKHdf5HkzmfsA7SSGGk 5u8H/ehbYEbzjmKD+IET8UXxoDOshyw4l+hYyZx0fplUG02++lPPrU9R0wAutyi5HKVj 85Fg== X-Gm-Message-State: APjAAAUxr/Q7xluSOOyoS9G/N4v4ktGH8MnkzKGNJwMSkYLO2AAvILE5 7Xu5pocWD6x160JxLruhLBk= X-Google-Smtp-Source: APXvYqwWPDn3xlLcWbEI07Gi+/zNamYef68qO+W6X6SZ/IMb/IrbVeimvjiZ0yCBocIPQQak3Q2RmA== X-Received: by 2002:a5d:5403:: with SMTP id g3mr8604241wrv.302.1581421327393; Tue, 11 Feb 2020 03:42:07 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id h205sm3442633wmf.25.2020.02.11.03.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:42:06 -0800 (PST) From: luca.boccassi@gmail.com To: Qi Zhang Cc: Xiaolong Ye , dpdk stable Date: Tue, 11 Feb 2020 11:21:54 +0000 Message-Id: <20200211112216.3929-168-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/ice: fix GTP-U rule conflict' has been queued to stable release 19.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Sender: "stable" Hi, FYI, your patch has been queued to stable release 19.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 02/13/20. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Thanks. Luca Boccassi --- >From f65e9ca82d1efcfd9dc2cb1b7873285930907bc8 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Wed, 22 Jan 2020 13:28:24 +0800 Subject: [PATCH] net/ice: fix GTP-U rule conflict [ upstream commit 89a532ba87ccf64bd53be6f2c384d5747d616612 ] The patch distinguishes fdir rules for GTPU with or without extend header, so flow to match below patterns can be created correctly. 1. eth / ipv4 / udp / gtpu teid is 10 / ... 2. eth / ipv4 / udp / gtpu teid is 10 / gtp_psc / ... 3. eth / ipv4 / udp / gtpu / gtp_psc qfi is 10 / ... 4. eth / ipv4 / udp / gtpu teid is 10 / gtp_psc is 10 / ... Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel") Signed-off-by: Qi Zhang Acked-by: Xiaolong Ye --- drivers/net/ice/base/ice_flow.c | 8 ++++---- drivers/net/ice/ice_ethdev.h | 1 + drivers/net/ice/ice_fdir_filter.c | 27 ++++++++++++++++++++------- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c index 391df1b540..f1a46e67f5 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -586,10 +586,6 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) src = (const ice_bitmap_t *)ice_ptypes_gtpc_tid; ice_and_bitmap(params->ptypes, params->ptypes, src, ICE_FLOW_PTYPE_MAX); - } else if (hdrs & ICE_FLOW_SEG_HDR_GTPU) { - src = (const ice_bitmap_t *)ice_ptypes_gtpu; - ice_and_bitmap(params->ptypes, params->ptypes, - src, ICE_FLOW_PTYPE_MAX); } else if (hdrs & ICE_FLOW_SEG_HDR_GTPU_EH) { src = (const ice_bitmap_t *)ice_ptypes_gtpu; ice_and_bitmap(params->ptypes, params->ptypes, @@ -598,6 +594,10 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params) /* Attributes for GTP packet with Extension Header */ params->attr = ice_attr_gtpu_eh; params->attr_cnt = ARRAY_SIZE(ice_attr_gtpu_eh); + } else if (hdrs & ICE_FLOW_SEG_HDR_GTPU_IP) { + src = (const ice_bitmap_t *)ice_ptypes_gtpu; + ice_and_bitmap(params->ptypes, params->ptypes, + src, ICE_FLOW_PTYPE_MAX); } } diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h index f2186e1ff9..da557a2540 100644 --- a/drivers/net/ice/ice_ethdev.h +++ b/drivers/net/ice/ice_ethdev.h @@ -254,6 +254,7 @@ enum ice_fdir_tunnel_type { ICE_FDIR_TUNNEL_TYPE_NONE = 0, ICE_FDIR_TUNNEL_TYPE_VXLAN, ICE_FDIR_TUNNEL_TYPE_GTPU, + ICE_FDIR_TUNNEL_TYPE_GTPU_EH, }; struct rte_flow; diff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c index 79e4d2edf8..442295e59d 100644 --- a/drivers/net/ice/ice_fdir_filter.c +++ b/drivers/net/ice/ice_fdir_filter.c @@ -133,6 +133,9 @@ static struct ice_pattern_match_item ice_fdir_pattern_comms[] = { static struct ice_flow_parser ice_fdir_parser_os; static struct ice_flow_parser ice_fdir_parser_comms; +static int +ice_fdir_is_tunnel_profile(enum ice_fdir_tunnel_type tunnel_type); + static const struct rte_memzone * ice_memzone_reserve(const char *name, uint32_t len, int socket_id) { @@ -915,7 +918,7 @@ ice_fdir_input_set_parse(uint64_t inset, enum ice_flow_field *field) {ICE_INSET_TUN_UDP_DST_PORT, ICE_FLOW_FIELD_IDX_UDP_DST_PORT}, {ICE_INSET_TUN_SCTP_SRC_PORT, ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT}, {ICE_INSET_TUN_SCTP_DST_PORT, ICE_FLOW_FIELD_IDX_SCTP_DST_PORT}, - {ICE_INSET_GTPU_TEID, ICE_FLOW_FIELD_IDX_GTPU_EH_TEID}, + {ICE_INSET_GTPU_TEID, ICE_FLOW_FIELD_IDX_GTPU_IP_TEID}, {ICE_INSET_GTPU_QFI, ICE_FLOW_FIELD_IDX_GTPU_EH_QFI}, }; @@ -928,11 +931,12 @@ ice_fdir_input_set_parse(uint64_t inset, enum ice_flow_field *field) static int ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow, - uint64_t input_set, bool is_tunnel) + uint64_t input_set, enum ice_fdir_tunnel_type ttype) { struct ice_flow_seg_info *seg; struct ice_flow_seg_info *seg_tun = NULL; enum ice_flow_field field[ICE_FLOW_FIELD_IDX_MAX]; + bool is_tunnel; int i, ret; if (!input_set) @@ -984,9 +988,15 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow, case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP: case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP: case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER: - ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH | - ICE_FLOW_SEG_HDR_GTPU_IP | - ICE_FLOW_SEG_HDR_IPV4); + if (ttype == ICE_FDIR_TUNNEL_TYPE_GTPU) + ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP | + ICE_FLOW_SEG_HDR_IPV4); + else if (ttype == ICE_FDIR_TUNNEL_TYPE_GTPU_EH) + ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH | + ICE_FLOW_SEG_HDR_GTPU_IP | + ICE_FLOW_SEG_HDR_IPV4); + else + PMD_DRV_LOG(ERR, "not supported tunnel type."); break; default: PMD_DRV_LOG(ERR, "not supported filter type."); @@ -1000,6 +1010,7 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow, ICE_FLOW_FLD_OFF_INVAL, false); } + is_tunnel = ice_fdir_is_tunnel_profile(ttype); if (!is_tunnel) { ret = ice_fdir_hw_tbl_conf(pf, pf->main_vsi, pf->fdir.fdir_vsi, seg, flow, false); @@ -1224,7 +1235,7 @@ ice_fdir_create_filter(struct ice_adapter *ad, is_tun = ice_fdir_is_tunnel_profile(filter->tunnel_type); ret = ice_fdir_input_set_conf(pf, filter->input.flow_type, - filter->input_set, is_tun); + filter->input_set, filter->tunnel_type); if (ret) { rte_flow_error_set(error, -ret, RTE_FLOW_ERROR_TYPE_HANDLE, NULL, @@ -1897,6 +1908,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, filter->input.gtpu_data.qfi = gtp_psc_spec->qfi; } + tunnel_type = ICE_FDIR_TUNNEL_TYPE_GTPU_EH; break; default: rte_flow_error_set(error, EINVAL, @@ -1907,7 +1919,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad, } } - if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU) + if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU || + tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU_EH) flow_type = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER; filter->tunnel_type = tunnel_type; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:44.441964349 +0000 +++ 0168-net-ice-fix-GTP-U-rule-conflict.patch 2020-02-11 11:17:38.804008901 +0000 @@ -1,8 +1,10 @@ -From 89a532ba87ccf64bd53be6f2c384d5747d616612 Mon Sep 17 00:00:00 2001 +From f65e9ca82d1efcfd9dc2cb1b7873285930907bc8 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Wed, 22 Jan 2020 13:28:24 +0800 Subject: [PATCH] net/ice: fix GTP-U rule conflict +[ upstream commit 89a532ba87ccf64bd53be6f2c384d5747d616612 ] + The patch distinguishes fdir rules for GTPU with or without extend header, so flow to match below patterns can be created correctly. @@ -13,7 +15,6 @@ 4. eth / ipv4 / udp / gtpu teid is 10 / gtp_psc is 10 / ... Fixes: efc16c621415 ("net/ice: support flow director GTPU tunnel") -Cc: stable@dpdk.org Signed-off-by: Qi Zhang Acked-by: Xiaolong Ye @@ -24,7 +25,7 @@ 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c -index eaa7a3b964..02f169808a 100644 +index 391df1b540..f1a46e67f5 100644 --- a/drivers/net/ice/base/ice_flow.c +++ b/drivers/net/ice/base/ice_flow.c @@ -586,10 +586,6 @@ ice_flow_proc_seg_hdrs(struct ice_flow_prof_params *params)