[v2,16/33] net/ice: support IPv6 NVGRE tunnel

Message ID 20220413160932.2074781-17-kevinx.liu@intel.com (mailing list archive)
State Superseded, archived
Headers
Series support full function of DCF |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Kevin Liu April 13, 2022, 4:09 p.m. UTC
  From: Alvin Zhang <alvinx.zhang@intel.com>

Add protocol definition and pattern matching for IPv6 NVGRE tunnel.

Signed-off-by: Junfeng Guo <junfeng.guo@intel.com>
Signed-off-by: Alvin Zhang <alvinx.zhang@intel.com>
Signed-off-by: Kevin Liu <kevinx.liu@intel.com>
---
 drivers/net/ice/ice_switch_filter.c | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/drivers/net/ice/ice_switch_filter.c b/drivers/net/ice/ice_switch_filter.c
index e90e109eca..4e9c85aed4 100644
--- a/drivers/net/ice/ice_switch_filter.c
+++ b/drivers/net/ice/ice_switch_filter.c
@@ -31,6 +31,7 @@ 
 #define ICE_PPP_IPV4_PROTO	0x0021
 #define ICE_PPP_IPV6_PROTO	0x0057
 #define ICE_IPV4_PROTO_NVGRE	0x002F
+#define ICE_IPV6_PROTO_NVGRE    0x002F
 #define ICE_SW_PRI_BASE 6
 
 #define ICE_SW_INSET_ETHER ( \
@@ -803,6 +804,10 @@  ice_switch_parse_pattern(const struct rte_flow_item pattern[],
 						break;
 					}
 				}
+				if ((ipv6_spec->hdr.proto &
+				     ipv6_mask->hdr.proto) ==
+				    ICE_IPV6_PROTO_NVGRE)
+					*tun_type = ICE_SW_TUN_AND_NON_TUN;
 				if (ipv6_mask->hdr.proto)
 					*input |= ICE_INSET_IPV6_NEXT_HDR;
 				if (ipv6_mask->hdr.hop_limits)