net/ice: refactor flow director filter structure
authorZhirun Yan <zhirun.yan@intel.com>
Tue, 2 Mar 2021 02:54:03 +0000 (10:54 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Fri, 5 Mar 2021 08:45:37 +0000 (09:45 +0100)
This patch use input_set_o and input_set_i to distinguish inner/outer
input set. input_set_i is only used for inner field.

Signed-off-by: Zhirun Yan <zhirun.yan@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/ice_ethdev.h
drivers/net/ice/ice_fdir_filter.c

index 7a7a5d5..2a8a816 100644 (file)
@@ -301,8 +301,8 @@ struct ice_fdir_filter_conf {
        struct ice_fdir_counter *counter; /* flow specific counter context */
        struct rte_flow_action_count act_count;
 
-       uint64_t input_set;
-       uint64_t outer_input_set; /* only for tunnel packets outer fields */
+       uint64_t input_set_o; /* used for non-tunnel or tunnel outer fields */
+       uint64_t input_set_i; /* only for tunnel inner fields */
        uint32_t mark_flag;
 };
 
index 4e99df1..570ec56 100644 (file)
@@ -1249,7 +1249,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,
        is_tun = ice_fdir_is_tunnel_profile(filter->tunnel_type);
 
        ret = ice_fdir_input_set_conf(pf, filter->input.flow_type,
-                                     filter->input_set, filter->outer_input_set,
+                                     filter->input_set_i, filter->input_set_o,
                                      filter->tunnel_type);
        if (ret) {
                rte_flow_error_set(error, -ret,
@@ -1982,7 +1982,7 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,
 
        filter->tunnel_type = tunnel_type;
        filter->input.flow_type = flow_type;
-       filter->input_set = input_set;
+       filter->input_set_o = input_set;
 
        return 0;
 }
@@ -2011,7 +2011,7 @@ ice_fdir_parse(struct ice_adapter *ad,
        ret = ice_fdir_parse_pattern(ad, pattern, error, filter);
        if (ret)
                goto error;
-       input_set = filter->input_set | filter->outer_input_set;
+       input_set = filter->input_set_o | filter->input_set_i;
        if (!input_set || input_set & ~item->input_set_mask) {
                rte_flow_error_set(error, EINVAL,
                                   RTE_FLOW_ERROR_TYPE_ITEM_SPEC,