net/ice/base: preserve default aggregator VSI information
[dpdk.git] / drivers / net / ice / ice_fdir_filter.c
index 745d729..c4b7265 100644 (file)
@@ -778,30 +778,15 @@ ice_fdir_cross_prof_conflict(struct ice_pf *pf,
                        goto err;
                break;
        case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER:
-               cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER;
+               cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_UDP;
                if (!ice_fdir_prof_resolve_conflict
                        (pf, cflct_ptype, is_tunnel))
                        goto err;
-               cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER;
+               cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP;
                if (!ice_fdir_prof_resolve_conflict
                        (pf, cflct_ptype, is_tunnel))
                        goto err;
-               cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER;
-               if (!ice_fdir_prof_resolve_conflict
-                       (pf, cflct_ptype, is_tunnel))
-                       goto err;
-               break;
-       /* IPv6 GTPU */
-       case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER:
-               cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER;
-               if (!ice_fdir_prof_resolve_conflict
-                       (pf, cflct_ptype, is_tunnel))
-                       goto err;
-               cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER;
-               if (!ice_fdir_prof_resolve_conflict
-                       (pf, cflct_ptype, is_tunnel))
-                       goto err;
-               cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER;
+               cflct_ptype = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP;
                if (!ice_fdir_prof_resolve_conflict
                        (pf, cflct_ptype, is_tunnel))
                        goto err;
@@ -1025,30 +1010,26 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow,
        case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP:
        case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP:
        case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER:
-               if (ttype == ICE_FDIR_TUNNEL_TYPE_GTPU)
-                       ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP |
-                                         ICE_FLOW_SEG_HDR_IPV4 |
-                                         ICE_FLOW_SEG_HDR_IPV_OTHER);
-               else if (ttype == ICE_FDIR_TUNNEL_TYPE_GTPU_EH)
-                       ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH |
-                                         ICE_FLOW_SEG_HDR_GTPU_IP |
-                                         ICE_FLOW_SEG_HDR_IPV4 |
-                                         ICE_FLOW_SEG_HDR_IPV_OTHER);
-               else
-                       PMD_DRV_LOG(ERR, "not supported tunnel type.");
+               ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP |
+                                 ICE_FLOW_SEG_HDR_IPV4 |
+                                 ICE_FLOW_SEG_HDR_IPV_OTHER);
+               break;
+       case ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_OTHER:
+               ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH |
+                                 ICE_FLOW_SEG_HDR_GTPU_IP |
+                                 ICE_FLOW_SEG_HDR_IPV4 |
+                                 ICE_FLOW_SEG_HDR_IPV_OTHER);
                break;
        case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER:
-               if (ttype == ICE_FDIR_TUNNEL_TYPE_GTPU)
-                       ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP |
-                                         ICE_FLOW_SEG_HDR_IPV6 |
-                                         ICE_FLOW_SEG_HDR_IPV_OTHER);
-               else if (ttype == ICE_FDIR_TUNNEL_TYPE_GTPU_EH)
-                       ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH |
-                                         ICE_FLOW_SEG_HDR_GTPU_IP |
-                                         ICE_FLOW_SEG_HDR_IPV6 |
-                                         ICE_FLOW_SEG_HDR_IPV_OTHER);
-               else
-                       PMD_DRV_LOG(ERR, "not supported tunnel type.");
+               ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_IP |
+                                 ICE_FLOW_SEG_HDR_IPV6 |
+                                 ICE_FLOW_SEG_HDR_IPV_OTHER);
+               break;
+       case ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_IPV6_OTHER:
+               ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH |
+                                 ICE_FLOW_SEG_HDR_GTPU_IP |
+                                 ICE_FLOW_SEG_HDR_IPV6 |
+                                 ICE_FLOW_SEG_HDR_IPV_OTHER);
                break;
        case ICE_FLTR_PTYPE_NON_IP_L2:
                ICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_ETH_NON_IP);
@@ -2007,13 +1988,18 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
                }
        }
 
-       if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU ||
-           tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU_EH) {
-               if (flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP)
-                       flow_type = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER;
-               else
-                       flow_type = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER;
-       }
+       if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU &&
+               flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP)
+               flow_type = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER;
+       else if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU_EH &&
+               flow_type == ICE_FLTR_PTYPE_NONF_IPV4_UDP)
+               flow_type = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_EH_IPV4_OTHER;
+       else if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU &&
+               flow_type == ICE_FLTR_PTYPE_NONF_IPV6_UDP)
+               flow_type = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_IPV6_OTHER;
+       else if (tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU_EH &&
+               flow_type == ICE_FLTR_PTYPE_NONF_IPV6_UDP)
+               flow_type = ICE_FLTR_PTYPE_NONF_IPV6_GTPU_EH_IPV6_OTHER;
 
        filter->tunnel_type = tunnel_type;
        filter->input.flow_type = flow_type;