The inner_l3/inner_l4 tracking was introduced to handle L2TPv2 tunnel
inner protocols separately from outer ones. However, the conditions used
to branch into the inner tracking than specifically L2TPv2 tunnels.
This caused VXLAN and GTPU FDIR rules with inner L3/L4 items to fail
because the inner IPv4/IPv6/TCP/UDP/SCTP items no longer updated
flow_type and l3, resulting in stale flow_type values.
Fix by narrowing the inner protocol tracking conditions to only apply
when tunnel_type is ICE_FDIR_TUNNEL_TYPE_L2TPV2.
Fixes: 733640dae75e ("net/ice: support L2TPv2 flow pattern matching")
Signed-off-by: Shaiq Wani <[email protected]>
---
drivers/net/intel/ice/ice_fdir_filter.c | 34 ++++++++++++-------------
1 file changed, 16 insertions(+), 18 deletions(-)
diff --git a/drivers/net/intel/ice/ice_fdir_filter.c
b/drivers/net/intel/ice/ice_fdir_filter.c
index 5b27f5a077..3522d77123 100644
--- a/drivers/net/intel/ice/ice_fdir_filter.c
+++ b/drivers/net/intel/ice/ice_fdir_filter.c
@@ -2094,13 +2094,13 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter
*ad,
ð_spec->hdr.ether_type,
sizeof(eth_spec->hdr.ether_type));
break;
case RTE_FLOW_ITEM_TYPE_IPV4:
- /* Only set flow_type for outer IPv4, track inner L3
for tunnels */
- if (is_outer || !tunnel_type) {
- flow_type = ICE_FLTR_PTYPE_NONF_IPV4_OTHER;
- l3 = RTE_FLOW_ITEM_TYPE_IPV4;
+ if (!is_outer &&
+ tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
+ inner_l3 = RTE_FLOW_ITEM_TYPE_IPV4;
current_l3 = RTE_FLOW_ITEM_TYPE_IPV4;
} else {
- inner_l3 = RTE_FLOW_ITEM_TYPE_IPV4;
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV4_OTHER;
+ l3 = RTE_FLOW_ITEM_TYPE_IPV4;
current_l3 = RTE_FLOW_ITEM_TYPE_IPV4;
}
@@ -2203,12 +2203,13 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter
*ad,
break;
case RTE_FLOW_ITEM_TYPE_IPV6:
- if (is_outer || !tunnel_type) {
- flow_type = ICE_FLTR_PTYPE_NONF_IPV6_OTHER;
- l3 = RTE_FLOW_ITEM_TYPE_IPV6;
+ if (!is_outer &&
+ tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
+ inner_l3 = RTE_FLOW_ITEM_TYPE_IPV6;
current_l3 = RTE_FLOW_ITEM_TYPE_IPV6;
} else {
- inner_l3 = RTE_FLOW_ITEM_TYPE_IPV6;
+ flow_type = ICE_FLTR_PTYPE_NONF_IPV6_OTHER;
+ l3 = RTE_FLOW_ITEM_TYPE_IPV6;
current_l3 = RTE_FLOW_ITEM_TYPE_IPV6;
}
@@ -2294,11 +2295,10 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter
*ad,
break;
case RTE_FLOW_ITEM_TYPE_TCP:
- if (!is_outer && tunnel_type) {
- /* For inner TCP in tunnels, track inner_l4 */
+ if (!is_outer &&
+ tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
inner_l4 = RTE_FLOW_ITEM_TYPE_TCP;
} else {
- /* For outer TCP, update flow_type normally */
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
flow_type =
ICE_FLTR_PTYPE_NONF_IPV4_TCP;
if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
@@ -2361,11 +2361,10 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter
*ad,
}
break;
case RTE_FLOW_ITEM_TYPE_UDP:
- if (!is_outer && tunnel_type) {
- /* For inner UDP in tunnels, track inner_l4 */
+ if (!is_outer &&
+ tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
inner_l4 = RTE_FLOW_ITEM_TYPE_UDP;
} else {
- /* For outer UDP, update flow_type normally */
l4 = RTE_FLOW_ITEM_TYPE_UDP;
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
flow_type =
ICE_FLTR_PTYPE_NONF_IPV4_UDP;
@@ -2424,11 +2423,10 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter
*ad,
}
break;
case RTE_FLOW_ITEM_TYPE_SCTP:
- if (!is_outer && tunnel_type) {
- /* For inner SCTP in tunnels, track inner_l4 */
+ if (!is_outer &&
+ tunnel_type == ICE_FDIR_TUNNEL_TYPE_L2TPV2) {
inner_l4 = RTE_FLOW_ITEM_TYPE_SCTP;
} else {
- /* For outer SCTP, update flow_type normally */
if (l3 == RTE_FLOW_ITEM_TYPE_IPV4)
flow_type =
ICE_FLTR_PTYPE_NONF_IPV4_SCTP;
if (l3 == RTE_FLOW_ITEM_TYPE_IPV6)
--
2.43.0