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 3B089A046B for ; Wed, 24 Jul 2019 09:41:23 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 028B51C12D; Wed, 24 Jul 2019 09:41:22 +0200 (CEST) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 888F11C11D; Wed, 24 Jul 2019 09:41:19 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2019 00:41:18 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,302,1559545200"; d="scan'208";a="321265392" Received: from npg-dpdk-cvl-yingwang-117d49.sh.intel.com (HELO npg-dpdk-cvl-yingwang-117d84.sh.intel.com) ([10.67.117.84]) by orsmga004.jf.intel.com with ESMTP; 24 Jul 2019 00:41:16 -0700 From: Wang Ying A To: qi.z.zhang@intel.com Cc: qiming.yang@intel.com, dev@dpdk.org, ying.a.wang@intel.com, stable@dpdk.org Date: Wed, 24 Jul 2019 07:20:59 +0800 Message-Id: <1563924059-178037-1-git-send-email-ying.a.wang@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] net/ice: add vni/tni support for flow inputset match 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" For VXLAN/NVGRE packet, vni/tni should be included in the matching keys. This patch fixes this issue. Fixes: d76116a4678f ("net/ice: add generic flow API") Cc: stable@dpdk.org Signed-off-by: Wang Ying A --- drivers/net/ice/ice_generic_flow.c | 8 ++++++++ drivers/net/ice/ice_generic_flow.h | 18 ++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/net/ice/ice_generic_flow.c b/drivers/net/ice/ice_generic_flow.c index 1d07c83..5fcf428 100644 --- a/drivers/net/ice/ice_generic_flow.c +++ b/drivers/net/ice/ice_generic_flow.c @@ -464,6 +464,10 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], "Invalid VXLAN item"); return 0; } + if (vxlan_mask->vni[0] == UINT8_MAX && + vxlan_mask->vni[1] == UINT8_MAX && + vxlan_mask->vni[2] == UINT8_MAX) + input_set |= ICE_INSET_TUN_ID; is_tunnel = 1; break; @@ -482,6 +486,10 @@ static uint64_t ice_get_flow_field(const struct rte_flow_item pattern[], "Invalid NVGRE item"); return 0; } + if (nvgre_mask->tni[0] == UINT8_MAX && + nvgre_mask->tni[1] == UINT8_MAX && + nvgre_mask->tni[2] == UINT8_MAX) + input_set |= ICE_INSET_TUN_ID; is_tunnel = 1; break; diff --git a/drivers/net/ice/ice_generic_flow.h b/drivers/net/ice/ice_generic_flow.h index 2aa79e0..1953905 100644 --- a/drivers/net/ice/ice_generic_flow.h +++ b/drivers/net/ice/ice_generic_flow.h @@ -83,24 +83,30 @@ struct ice_flow_pattern { ICE_INSET_IPV6_HOP_LIMIT | ICE_INSET_IPV6_TOS | ICE_INSET_ICMP6) #define INSET_TUNNEL_IPV4_TYPE1 ( \ ICE_INSET_TUN_IPV4_SRC | ICE_INSET_TUN_IPV4_DST | \ - ICE_INSET_TUN_IPV4_TTL | ICE_INSET_TUN_IPV4_PROTO) + ICE_INSET_TUN_IPV4_TTL | ICE_INSET_TUN_IPV4_PROTO | \ + ICE_INSET_TUN_ID) #define INSET_TUNNEL_IPV4_TYPE2 ( \ ICE_INSET_TUN_IPV4_SRC | ICE_INSET_TUN_IPV4_DST | \ ICE_INSET_TUN_IPV4_TTL | ICE_INSET_TUN_IPV4_PROTO | \ - ICE_INSET_TUN_SRC_PORT | ICE_INSET_TUN_DST_PORT) + ICE_INSET_TUN_SRC_PORT | ICE_INSET_TUN_DST_PORT | \ + ICE_INSET_TUN_ID) #define INSET_TUNNEL_IPV4_TYPE3 ( \ ICE_INSET_TUN_IPV4_SRC | ICE_INSET_TUN_IPV4_DST | \ - ICE_INSET_TUN_IPV4_TTL | ICE_INSET_ICMP) + ICE_INSET_TUN_IPV4_TTL | ICE_INSET_ICMP | \ + ICE_INSET_TUN_ID) #define INSET_TUNNEL_IPV6_TYPE1 ( \ ICE_INSET_TUN_IPV6_SRC | ICE_INSET_TUN_IPV6_DST | \ - ICE_INSET_TUN_IPV6_TTL | ICE_INSET_TUN_IPV6_PROTO) + ICE_INSET_TUN_IPV6_TTL | ICE_INSET_TUN_IPV6_PROTO | \ + ICE_INSET_TUN_ID) #define INSET_TUNNEL_IPV6_TYPE2 ( \ ICE_INSET_TUN_IPV6_SRC | ICE_INSET_TUN_IPV6_DST | \ ICE_INSET_TUN_IPV6_TTL | ICE_INSET_TUN_IPV6_PROTO | \ - ICE_INSET_TUN_SRC_PORT | ICE_INSET_TUN_DST_PORT) + ICE_INSET_TUN_SRC_PORT | ICE_INSET_TUN_DST_PORT | \ + ICE_INSET_TUN_ID) #define INSET_TUNNEL_IPV6_TYPE3 ( \ ICE_INSET_TUN_IPV6_SRC | ICE_INSET_TUN_IPV6_DST | \ - ICE_INSET_TUN_IPV6_TTL | ICE_INSET_ICMP6) + ICE_INSET_TUN_IPV6_TTL | ICE_INSET_ICMP6 | \ + ICE_INSET_TUN_ID) /* L2 */ static enum rte_flow_item_type pattern_ethertype[] = { -- 1.8.3.1