net/ice/base: refine MAC rule adding
authorQi Zhang <qi.z.zhang@intel.com>
Tue, 10 Aug 2021 02:51:27 +0000 (10:51 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Wed, 11 Aug 2021 02:24:35 +0000 (04:24 +0200)
Move replay_pre_init function to interface.
Add further MAC rules, despite unicast address is already on list.

Signed-off-by: Marcin Domagala <marcinx.domagala@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Junfeng Guo <junfeng.guo@intel.com>
drivers/net/ice/base/ice_common.c
drivers/net/ice/base/ice_common.h
drivers/net/ice/base/ice_switch.c

index e98145b..a77bf32 100644 (file)
@@ -5069,7 +5069,7 @@ static bool ice_is_main_vsi(struct ice_hw *hw, u16 vsi_handle)
  *
  * Initializes required config data for VSI, FD, ACL, and RSS before replay.
  */
-static enum ice_status
+enum ice_status
 ice_replay_pre_init(struct ice_hw *hw, struct ice_switch_info *sw)
 {
        enum ice_status status;
index 770db8f..ac6b487 100644 (file)
@@ -221,6 +221,8 @@ enum ice_status
 ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u16 q_handle,
                u8 num_qgrps, struct ice_aqc_add_tx_qgrp *buf, u16 buf_size,
                struct ice_sq_cd *cd);
+enum ice_status
+ice_replay_pre_init(struct ice_hw *hw, struct ice_switch_info *sw);
 enum ice_status ice_replay_vsi(struct ice_hw *hw, u16 vsi_handle);
 void ice_replay_post(struct ice_hw *hw);
 struct ice_q_ctx *
index 0b2347b..2d8904d 100644 (file)
@@ -4730,7 +4730,7 @@ ice_add_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list,
                        if (ice_find_rule_entry(rule_head,
                                                &m_list_itr->fltr_info)) {
                                ice_release_lock(rule_lock);
-                               return ICE_ERR_ALREADY_EXISTS;
+                               continue;
                        }
                        ice_release_lock(rule_lock);
                        num_unicast++;