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 C3DF3A0516; Tue, 9 Jun 2020 14:04:52 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 497F649E0; Tue, 9 Jun 2020 13:57:39 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 9FC161BEF2 for ; Tue, 9 Jun 2020 13:57:36 +0200 (CEST) IronPort-SDR: wdtuC6IvMeqwznIQfLQr2aUU4bhdHVYCYcdYuhm28xM3dkTOwH33EG1KIRLMCHqoCqjztEbWmd zoPhD/YOExyg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jun 2020 04:57:36 -0700 IronPort-SDR: xCWSbaJRbIBXldOxGB8ugfl6fL2Mpiu5wobhLV30DRcU54w+MPGy3A6Q6JHeczAj7QAAOfO4yp XqHUGGnwuVXg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,492,1583222400"; d="scan'208";a="473044366" Received: from dpdk51.sh.intel.com ([10.67.111.82]) by fmsmga005.fm.intel.com with ESMTP; 09 Jun 2020 04:57:34 -0700 From: Qi Zhang To: qiming.yang@intel.com Cc: xiaolong.ye@intel.com, dev@dpdk.org, Qi Zhang , Wei Zhao , "Paul M . Stillwell Jr" Date: Tue, 9 Jun 2020 19:59:57 +0800 Message-Id: <20200609120001.35110-49-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200609120001.35110-1-qi.z.zhang@intel.com> References: <20200603024016.30636-1-qi.z.zhang@intel.com> <20200609120001.35110-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2 48/52] net/ice/base: add more tunnel type for IPv4 and IPv6 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 more tunnel type defination ipv4/ipv6 packet, it enable tcp/udp layer of ipv4/ipv6 as L4 payload but without L4 dst/src port number as input set for switch filter rule. For example: we can download a switch rule to direct ipv4 packet with specific source and destination ip address to queue index 1. "eth / ipv4 src is 192.168.0.1 dst is 192.168.0.2 / udp / end actions queue index 1 / end" this type of rule will be matched with ipv4/udp file only. Signed-off-by: Wei Zhao Signed-off-by: Paul M. Stillwell Jr Signed-off-by: Qi Zhang --- drivers/net/ice/base/ice_protocol_type.h | 4 ++++ drivers/net/ice/base/ice_switch.c | 40 ++++++++++++++++++++++++++++++++ drivers/net/ice/base/ice_switch.h | 4 ++++ 3 files changed, 48 insertions(+) diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h index 85af7513c..7cc44c172 100644 --- a/drivers/net/ice/base/ice_protocol_type.h +++ b/drivers/net/ice/base/ice_protocol_type.h @@ -66,6 +66,10 @@ enum ice_sw_tunnel_type { ICE_SW_TUN_UDP, /* This means all "UDP" tunnel types: VXLAN-GPE, VXLAN * and GENEVE */ + ICE_SW_IPV4_TCP, + ICE_SW_IPV4_UDP, + ICE_SW_IPV6_TCP, + ICE_SW_IPV6_UDP, ICE_SW_TUN_GTP, ICE_SW_TUN_PPPOE, ICE_SW_TUN_PPPOE_PAY, diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c index 9c7e55ff9..1b1693dbb 100644 --- a/drivers/net/ice/base/ice_switch.c +++ b/drivers/net/ice/base/ice_switch.c @@ -6357,6 +6357,18 @@ ice_get_compat_fv_bitmap(struct ice_hw *hw, struct ice_adv_rule_info *rinfo, case ICE_SW_TUN_IPV4_AH: ice_set_bit(ICE_PROFID_IPV4_AH, bm); return; + case ICE_SW_IPV4_TCP: + ice_set_bit(ICE_PROFID_IPV4_TCP, bm); + return; + case ICE_SW_IPV4_UDP: + ice_set_bit(ICE_PROFID_IPV4_UDP, bm); + return; + case ICE_SW_IPV6_TCP: + ice_set_bit(ICE_PROFID_IPV6_TCP, bm); + return; + case ICE_SW_IPV6_UDP: + ice_set_bit(ICE_PROFID_IPV6_UDP, bm); + return; case ICE_SW_TUN_AND_NON_TUN: default: prof_type = ICE_PROF_ALL; @@ -6771,6 +6783,34 @@ ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt, return; } + if (tun_type == ICE_SW_IPV4_TCP) { + *pkt = dummy_tcp_packet; + *pkt_len = sizeof(dummy_tcp_packet); + *offsets = dummy_tcp_packet_offsets; + return; + } + + if (tun_type == ICE_SW_IPV4_UDP) { + *pkt = dummy_udp_packet; + *pkt_len = sizeof(dummy_udp_packet); + *offsets = dummy_udp_packet_offsets; + return; + } + + if (tun_type == ICE_SW_IPV6_TCP) { + *pkt = dummy_tcp_ipv6_packet; + *pkt_len = sizeof(dummy_tcp_ipv6_packet); + *offsets = dummy_tcp_ipv6_packet_offsets; + return; + } + + if (tun_type == ICE_SW_IPV6_UDP) { + *pkt = dummy_udp_ipv6_packet; + *pkt_len = sizeof(dummy_udp_ipv6_packet); + *offsets = dummy_udp_ipv6_packet_offsets; + return; + } + if (tun_type == ICE_ALL_TUNNELS) { *pkt = dummy_gre_udp_packet; *pkt_len = sizeof(dummy_gre_udp_packet); diff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h index bd634f98f..1ba85b16b 100644 --- a/drivers/net/ice/base/ice_switch.h +++ b/drivers/net/ice/base/ice_switch.h @@ -16,6 +16,10 @@ #define ICE_FLTR_TX_RX (ICE_FLTR_RX | ICE_FLTR_TX) /* Switch Profile IDs for Profile related switch rules */ +#define ICE_PROFID_IPV4_TCP 4 +#define ICE_PROFID_IPV4_UDP 5 +#define ICE_PROFID_IPV6_TCP 7 +#define ICE_PROFID_IPV6_UDP 8 #define ICE_PROFID_PPPOE_PAY 34 #define ICE_PROFID_PPPOE_IPV4_TCP 35 #define ICE_PROFID_PPPOE_IPV4_UDP 36 -- 2.13.6