net/sfc: report user flag on EF100 native datapath
[dpdk.git] / drivers / net / ice / ice_switch_filter.c
index bbd2805..6b0c1bf 100644 (file)
@@ -31,6 +31,7 @@
 #define ICE_PPP_IPV4_PROTO     0x0021
 #define ICE_PPP_IPV6_PROTO     0x0057
 #define ICE_IPV4_PROTO_NVGRE   0x002F
+#define ICE_SW_PRI_BASE 6
 
 #define ICE_SW_INSET_ETHER ( \
        ICE_INSET_DMAC | ICE_INSET_SMAC | ICE_INSET_ETHERTYPE)
@@ -1370,7 +1371,7 @@ ice_switch_parse_pattern(const struct rte_flow_item pattern[],
                                return false;
                        }
                        if (gtp_psc_spec && gtp_psc_mask) {
-                               if (gtp_psc_mask->pdu_type) {
+                               if (gtp_psc_mask->hdr.type) {
                                        rte_flow_error_set(error, EINVAL,
                                                RTE_FLOW_ERROR_TYPE_ITEM,
                                                item,
@@ -1378,13 +1379,13 @@ ice_switch_parse_pattern(const struct rte_flow_item pattern[],
                                        return false;
                                }
                                input = &outer_input_set;
-                               if (gtp_psc_mask->qfi)
+                               if (gtp_psc_mask->hdr.qfi)
                                        *input |= ICE_INSET_GTPU_QFI;
                                list[t].type = ICE_GTP;
                                list[t].h_u.gtp_hdr.qfi =
-                                       gtp_psc_spec->qfi;
+                                       gtp_psc_spec->hdr.qfi;
                                list[t].m_u.gtp_hdr.qfi =
-                                       gtp_psc_mask->qfi;
+                                       gtp_psc_mask->hdr.qfi;
                                input_set_byte += 1;
                                t++;
                        }
@@ -1592,7 +1593,10 @@ ice_switch_parse_dcf_action(struct ice_dcf_adapter *ad,
        rule_info->sw_act.src = rule_info->sw_act.vsi_handle;
        rule_info->sw_act.flag = ICE_FLTR_RX;
        rule_info->rx = 1;
-       rule_info->priority = 6 - priority;
+       /* 0 denotes lowest priority of recipe and highest priority
+        * of rte_flow. Change rte_flow priority into recipe priority.
+        */
+       rule_info->priority = ICE_SW_PRI_BASE - priority;
 
        return 0;
 }
@@ -1671,7 +1675,10 @@ ice_switch_parse_action(struct ice_pf *pf,
        rule_info->sw_act.vsi_handle = vsi->idx;
        rule_info->rx = 1;
        rule_info->sw_act.src = vsi->idx;
-       rule_info->priority = priority + 5;
+       /* 0 denotes lowest priority of recipe and highest priority
+        * of rte_flow. Change rte_flow priority into recipe priority.
+        */
+       rule_info->priority = ICE_SW_PRI_BASE - priority;
 
        return 0;