net/ice/base: rename and add setter for unicast MAC flag
authorQi Zhang <qi.z.zhang@intel.com>
Tue, 10 Aug 2021 02:51:38 +0000 (10:51 +0800)
committerQi Zhang <qi.z.zhang@intel.com>
Wed, 11 Aug 2021 02:25:25 +0000 (04:25 +0200)
Rename ucast_shared to umac_shared, as "umac" is a more widely
used shorthand for "unicast MAC".

Also add a helper function to set this flag. This helper is
expected to be called by core drivers.

Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@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
drivers/net/ice/base/ice_type.h

index ad9df0d..9c6649b 100644 (file)
@@ -864,6 +864,17 @@ void ice_print_rollback_msg(struct ice_hw *hw)
                 nvm_str, hw->fw_maj_ver, hw->fw_min_ver);
 }
 
+/**
+ * ice_set_umac_shared
+ * @hw: pointer to the hw struct
+ *
+ * Set boolean flag to allow unicast MAC sharing
+ */
+void ice_set_umac_shared(struct ice_hw *hw)
+{
+       hw->umac_shared = true;
+}
+
 /**
  * ice_init_hw - main hardware initialization routine
  * @hw: pointer to the hardware structure
index ac6b487..e843084 100644 (file)
@@ -23,6 +23,7 @@ enum ice_fw_modes {
 
 enum ice_status ice_init_fltr_mgmt_struct(struct ice_hw *hw);
 void ice_cleanup_fltr_mgmt_struct(struct ice_hw *hw);
+void ice_set_umac_shared(struct ice_hw *hw);
 enum ice_status ice_init_hw(struct ice_hw *hw);
 void ice_deinit_hw(struct ice_hw *hw);
 enum ice_status ice_check_reset(struct ice_hw *hw);
index 2d8904d..9179f66 100644 (file)
@@ -4681,7 +4681,7 @@ ice_aq_get_res_descs(struct ice_hw *hw, u16 num_entries,
  * @sw: pointer to switch info struct for which function add rule
  * @lport: logic port number on which function add rule
  *
- * IMPORTANT: When the ucast_shared flag is set to false and m_list has
+ * IMPORTANT: When the umac_shared flag is set to false and m_list has
  * multiple unicast addresses, the function assumes that all the
  * addresses are unique in a given add_mac call. It doesn't
  * check for duplicates in this case, removing duplicates from a given
@@ -4724,7 +4724,7 @@ ice_add_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list,
                if (m_list_itr->fltr_info.lkup_type != ICE_SW_LKUP_MAC ||
                    IS_ZERO_ETHER_ADDR(add))
                        return ICE_ERR_PARAM;
-               if (IS_UNICAST_ETHER_ADDR(add) && !hw->ucast_shared) {
+               if (IS_UNICAST_ETHER_ADDR(add) && !hw->umac_shared) {
                        /* Don't overwrite the unicast address */
                        ice_acquire_lock(rule_lock);
                        if (ice_find_rule_entry(rule_head,
@@ -4735,7 +4735,7 @@ ice_add_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list,
                        ice_release_lock(rule_lock);
                        num_unicast++;
                } else if (IS_MULTICAST_ETHER_ADDR(add) ||
-                          (IS_UNICAST_ETHER_ADDR(add) && hw->ucast_shared)) {
+                          (IS_UNICAST_ETHER_ADDR(add) && hw->umac_shared)) {
                        m_list_itr->status =
                                ice_add_rule_internal(hw, recp_list, lport,
                                                      m_list_itr);
@@ -5424,7 +5424,7 @@ ice_remove_mac_rule(struct ice_hw *hw, struct LIST_HEAD_TYPE *m_list,
 
                list_itr->fltr_info.fwd_id.hw_vsi_id =
                                        ice_get_hw_vsi_num(hw, vsi_handle);
-               if (IS_UNICAST_ETHER_ADDR(add) && !hw->ucast_shared) {
+               if (IS_UNICAST_ETHER_ADDR(add) && !hw->umac_shared) {
                        /* Don't remove the unicast address that belongs to
                         * another VSI on the switch, since it is not being
                         * shared...
index 4e33d14..56ee628 100644 (file)
@@ -1194,7 +1194,8 @@ struct ice_hw {
        /* INTRL granularity in 1 us */
        u8 intrl_gran;
 
-       u8 ucast_shared;        /* true if VSIs can share unicast addr */
+       /* true if VSIs can share unicast MAC addr */
+       u8 umac_shared;
 
 #define ICE_PHY_PER_NAC                1
 #define ICE_MAX_QUAD           2