net/ice/base: fix flow director rule passthrough mode
authorSimei Su <simei.su@intel.com>
Fri, 8 May 2020 01:22:22 +0000 (09:22 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 18 May 2020 18:35:57 +0000 (20:35 +0200)
This patch adds support for FDIR passthrough mode. When FDIR rule
hits, FDIR just forward this packet to the next stage filter.

Fixes: 55daca4e45fc ("net/ice/base: change function to static")

Signed-off-by: Simei Su <simei.su@intel.com>
Tested-by: Xiaoxiao Zeng <xiaoxiaox.zeng@intel.com>
Acked-by: Qi Zhang <qi.z.zhang@intel.com>
drivers/net/ice/base/ice_fdir.c

index 4ec057b..f899641 100644 (file)
@@ -465,6 +465,10 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input,
        if (input->dest_ctl == ICE_FLTR_PRGM_DESC_DEST_DROP_PKT) {
                fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_YES;
                fdir_fltr_ctx.qindex = 0;
+       } else if (input->dest_ctl ==
+                       ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER) {
+               fdir_fltr_ctx.drop = ICE_FXD_FLTR_QW0_DROP_NO;
+               fdir_fltr_ctx.qindex = 0;
        } else {
                if (input->dest_ctl ==
                    ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QGROUP)
@@ -476,7 +480,10 @@ ice_fdir_get_prgm_desc(struct ice_hw *hw, struct ice_fdir_fltr *input,
        fdir_fltr_ctx.cnt_index = input->cnt_index;
        fdir_fltr_ctx.fd_vsi = ice_get_hw_vsi_num(hw, input->dest_vsi);
        fdir_fltr_ctx.evict_ena = ICE_FXD_FLTR_QW0_EVICT_ENA_FALSE;
-       fdir_fltr_ctx.toq_prio = 3;
+       if (input->dest_ctl == ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_OTHER)
+               fdir_fltr_ctx.toq_prio = 0;
+       else
+               fdir_fltr_ctx.toq_prio = 3;
        fdir_fltr_ctx.pcmd = (add) ? ICE_FXD_FLTR_QW1_PCMD_ADD :
                ICE_FXD_FLTR_QW1_PCMD_REMOVE;
        fdir_fltr_ctx.swap = ICE_FXD_FLTR_QW1_SWAP_NOT_SET;