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 42C12A0519; Fri, 3 Jul 2020 08:45:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 042031DA08; Fri, 3 Jul 2020 08:44:49 +0200 (CEST) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by dpdk.org (Postfix) with ESMTP id 7E4CF1D960; Fri, 3 Jul 2020 08:44:44 +0200 (CEST) IronPort-SDR: 5FsAREd0c4h/IoQqDI8+cq7n+1Znw1N86cPjRa/8gpYnGSTwGO3J0HVKzWzNjxjAX7jI6RREpn FjBPLvWK9WSA== X-IronPort-AV: E=McAfee;i="6000,8403,9670"; a="146190771" X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208";a="146190771" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Jul 2020 23:44:43 -0700 IronPort-SDR: 91v22uOTvEW0Z560E05+ZL/LlvMOR8jo1QX/j/nSYZZ0Vqw9Wl5ioSxOvMdHy9McvuTQp8Bspd 4OLeKey8oXsQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,307,1589266800"; d="scan'208";a="356689702" Received: from unknown (HELO localhost.localdomain.bj.intel.com) ([172.16.182.123]) by orsmga001.jf.intel.com with ESMTP; 02 Jul 2020 23:44:41 -0700 From: Wei Zhao To: dev@dpdk.org Cc: stable@dpdk.org, qi.z.zhang@intel.com, nannan.lu@intel.com, Wei Zhao Date: Fri, 3 Jul 2020 14:19:35 +0800 Message-Id: <20200703061938.13045-3-wei.zhao1@intel.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20200703061938.13045-1-wei.zhao1@intel.com> References: <20200629051030.3541-1-wei.zhao1@intel.com> <20200703061938.13045-1-wei.zhao1@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 2/5] net/ice: fix tunnel type for switch rule 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" This patch add check for protocol type of IPv4 packet, it need to update tunnel type when NVGRE is in payload. Fixes: 6bc7628c5e0b ("net/ice: change default tunnel type") Cc: stable@dpdk.org Signed-off-by: Wei Zhao --- drivers/net/ice/ice_switch_filter.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c index 12a015f87..dae0d470b 100644 --- a/drivers/net/ice/ice_switch_filter.c +++ b/drivers/net/ice/ice_switch_filter.c @@ -29,6 +29,7 @@ #define MAX_QGRP_NUM_TYPE 7 #define ICE_PPP_IPV4_PROTO 0x0021 #define ICE_PPP_IPV6_PROTO 0x0057 +#define ICE_IPV4_PROTO_NVGRE 0x002F #define ICE_SW_INSET_ETHER ( \ ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_ETHERTYPE) @@ -633,6 +634,10 @@ ice_switch_inset_get(const struct rte_flow_item pattern[], list[t].m_u.ipv4_hdr.protocol = ipv4_mask->hdr.next_proto_id; } + if ((ipv4_spec->hdr.next_proto_id & + ipv4_mask->hdr.next_proto_id) == + ICE_IPV4_PROTO_NVGRE) + *tun_type = ICE_SW_TUN_AND_NON_TUN; if (ipv4_mask->hdr.type_of_service) { list[t].h_u.ipv4_hdr.tos = ipv4_spec->hdr.type_of_service; @@ -1532,7 +1537,7 @@ ice_switch_parse_pattern_action(struct ice_adapter *ad, const struct rte_flow_item *item = pattern; uint16_t item_num = 0; enum ice_sw_tunnel_type tun_type = - ICE_SW_TUN_AND_NON_TUN; + ICE_NON_TUN; struct ice_pattern_match_item *pattern_match_item = NULL; for (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) { -- 2.19.1