net/ice/base: remove unused code in switch rule
authorQi Zhang <qi.z.zhang@intel.com>
Tue, 7 Apr 2020 00:25:23 +0000 (08:25 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 21 Apr 2020 11:57:06 +0000 (13:57 +0200)
Update a switch rule' action from "to VSI" to "to VSI List"
should only happen when the same rule has been programmed with
a different fwd destination. This is already handled by below
code block:

m_entry = ice_find_adv_rule_entry(...)
if (m_entry) {
...
ice_adv_add_update_vsi_list(...)
}

The following ice_update_pkt_fwd_rule is unnecessary and should be
removed due to:
1) If a switch rule's action is still to VSI, which means, it is
   the first time be issued,  we don't need to update it "to VSI
   List."
2) Actually the implementation does not match the comment, it still
   update the rule with "to VSI" action.

Fixes: fed0c5ca5f19 ("net/ice/base: support programming a new switch recipe")
Cc: stable@dpdk.org
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Xiaolong Ye <xiaolong.ye@intel.com>
drivers/net/ice/base/ice_switch.c

index b5aa5ab..07f8efd 100644 (file)
@@ -6695,24 +6695,8 @@ ice_add_adv_rule(struct ice_hw *hw, struct ice_adv_lkup_elem *lkups,
        sw->recp_list[rid].adv_rule = true;
        rule_head = &sw->recp_list[rid].filt_rules;
 
-       if (rinfo->sw_act.fltr_act == ICE_FWD_TO_VSI) {
-               struct ice_fltr_info tmp_fltr;
-
-               ice_memset(&tmp_fltr, 0, sizeof(tmp_fltr), ICE_NONDMA_MEM);
-               tmp_fltr.fltr_rule_id =
-                       LE16_TO_CPU(s_rule->pdata.lkup_tx_rx.index);
-               tmp_fltr.fltr_act = ICE_FWD_TO_VSI;
-               tmp_fltr.fwd_id.hw_vsi_id =
-                       ice_get_hw_vsi_num(hw, vsi_handle);
-               tmp_fltr.vsi_handle = vsi_handle;
-               /* Update the previous switch rule of "forward to VSI" to
-                * "fwd to VSI list"
-                */
-               status = ice_update_pkt_fwd_rule(hw, &tmp_fltr);
-               if (status)
-                       goto err_ice_add_adv_rule;
+       if (rinfo->sw_act.fltr_act == ICE_FWD_TO_VSI)
                adv_fltr->vsi_count = 1;
-       }
 
        /* Add rule entry to book keeping list */
        LIST_ADD(&adv_fltr->list_entry, rule_head);