[v3,14/14] net/ice/base: allow support for GTP-U filter using only inner protocols

Message ID 20210413143038.2621294-15-qi.z.zhang@intel.com (mailing list archive)
State Accepted, archived
Delegated to: Qi Zhang
Headers
Series ice: base code update batch 2 |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/travis-robot success travis build: passed
ci/github-robot success github build: passed
ci/iol-abi-testing success Testing PASS
ci/iol-testing success Testing PASS

Commit Message

Qi Zhang April 13, 2021, 2:30 p.m. UTC
  Adds a support for switch filter: GTP-U using just inner fields.
If user doesn't specify outer protocol and its fields but wants to
add switch filter for GTP-U using inner protocols and related fields
such as inner L3 and/or inner L4, this patch enables such filtering.

Signed-off-by: Kiran Patil <kiran.patil@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
---
 drivers/net/ice/base/ice_protocol_type.h | 2 ++
 drivers/net/ice/base/ice_switch.c        | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)
  

Patch

diff --git a/drivers/net/ice/base/ice_protocol_type.h b/drivers/net/ice/base/ice_protocol_type.h
index d078061afb..8c9d098e22 100644
--- a/drivers/net/ice/base/ice_protocol_type.h
+++ b/drivers/net/ice/base/ice_protocol_type.h
@@ -110,6 +110,8 @@  enum ice_sw_tunnel_type {
 	ICE_SW_TUN_IPV4_GTPU_IPV6,
 	ICE_SW_TUN_IPV6_GTPU_IPV4,
 	ICE_SW_TUN_IPV6_GTPU_IPV6,
+	ICE_SW_TUN_GTP_IPV4,
+	ICE_SW_TUN_GTP_IPV6,
 	ICE_ALL_TUNNELS /* All tunnel types including NVGRE */
 };
 
diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c
index a567b6de81..45f83cd10c 100644
--- a/drivers/net/ice/base/ice_switch.c
+++ b/drivers/net/ice/base/ice_switch.c
@@ -7980,13 +7980,15 @@  ice_find_dummy_packet(struct ice_adv_lkup_elem *lkups, u16 lkups_cnt,
 	}
 
 	/* Support GTP tunnel + L3 */
-	if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4) {
+	if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV4 ||
+	    tun_type == ICE_SW_TUN_GTP_IPV4) {
 		*pkt = dummy_ipv4_gtpu_ipv4_packet;
 		*pkt_len = sizeof(dummy_ipv4_gtpu_ipv4_packet);
 		*offsets = dummy_ipv4_gtpu_ipv4_packet_offsets;
 		return;
 	}
-	if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6) {
+	if (tun_type == ICE_SW_TUN_IPV4_GTPU_IPV6 ||
+	    tun_type == ICE_SW_TUN_GTP_IPV6) {
 		*pkt = dummy_ipv4_gtpu_ipv6_packet;
 		*pkt_len = sizeof(dummy_ipv4_gtpu_ipv6_packet);
 		*offsets = dummy_ipv4_gtpu_ipv6_packet_offsets;