net/ice/base: introduce Tx rate limiting on port level
authorQi Zhang <qi.z.zhang@intel.com>
Wed, 26 Aug 2020 10:30:23 +0000 (18:30 +0800)
committerFerruh Yigit <ferruh.yigit@intel.com>
Fri, 18 Sep 2020 16:55:09 +0000 (18:55 +0200)
The PSM Configuration has a Rate Limiter for each associated
switch port based on its relative speed from the total BW of
switch ports connected to LAN controller. The rate limiters
will be dynamic get readjusted if switch port speeds are
changed at the root node layer of the scheduler tree. Adding
a function to directly modify the EIR of root node.

Signed-off-by: Shibin Koikkara Reeny <shibin.koikkara.reeny@intel.com>
Signed-off-by: Qi Zhang <qi.z.zhang@intel.com>
Acked-by: Qiming Yang <qiming.yang@intel.com>
drivers/net/ice/base/ice_common.c
drivers/net/ice/base/ice_common.h
drivers/net/ice/base/ice_sched.c
drivers/net/ice/base/ice_type.h

index 3d24891..46754a3 100644 (file)
@@ -4382,6 +4382,7 @@ static bool ice_is_main_vsi(struct ice_hw *hw, u16 vsi_handle)
 static enum ice_status
 ice_replay_pre_init(struct ice_hw *hw, struct ice_switch_info *sw)
 {
+       enum ice_status status;
        u8 i;
 
        /* Delete old entries from replay filter list head if there is any */
@@ -4395,6 +4396,10 @@ ice_replay_pre_init(struct ice_hw *hw, struct ice_switch_info *sw)
                                  &sw->recp_list[i].filt_replay_rules);
        ice_sched_replay_agg_vsi_preinit(hw);
 
+       status = ice_sched_replay_root_node_bw(hw->port_info);
+       if (status)
+               return status;
+
        return ice_sched_replay_tc_node_bw(hw->port_info);
 }
 
index d176f74..393e2d3 100644 (file)
@@ -202,6 +202,7 @@ void ice_sched_replay_agg_vsi_preinit(struct ice_hw *hw);
 void ice_sched_replay_agg(struct ice_hw *hw);
 enum ice_status ice_sched_replay_tc_node_bw(struct ice_port_info *pi);
 enum ice_status ice_replay_vsi_agg(struct ice_hw *hw, u16 vsi_handle);
+enum ice_status ice_sched_replay_root_node_bw(struct ice_port_info *pi);
 enum ice_status
 ice_sched_replay_q_bw(struct ice_port_info *pi, struct ice_q_ctx *q_ctx);
 struct ice_q_ctx *
index d05fbfc..1374b9a 100644 (file)
@@ -5381,6 +5381,26 @@ void ice_sched_replay_agg_vsi_preinit(struct ice_hw *hw)
        ice_release_lock(&pi->sched_lock);
 }
 
+/**
+ * ice_sched_replay_root_node_bw - replay root node BW
+ * @pi: port information structure
+ *
+ * Replay root node BW settings.
+ */
+enum ice_status ice_sched_replay_root_node_bw(struct ice_port_info *pi)
+{
+       enum ice_status status = ICE_SUCCESS;
+
+       if (!pi->hw)
+               return ICE_ERR_PARAM;
+       ice_acquire_lock(&pi->sched_lock);
+
+       status = ice_sched_replay_node_bw(pi->hw, pi->root,
+                                         &pi->root_node_bw_t_info);
+       ice_release_lock(&pi->sched_lock);
+       return status;
+}
+
 /**
  * ice_sched_replay_tc_node_bw - replay TC node(s) BW
  * @pi: port information structure
index c558a1c..997f97e 100644 (file)
@@ -776,6 +776,7 @@ struct ice_port_info {
                sib_head[ICE_MAX_TRAFFIC_CLASS][ICE_AQC_TOPO_MAX_LEVEL_NUM];
        /* List contain profile ID(s) and other params per layer */
        struct LIST_HEAD_TYPE rl_prof_list[ICE_AQC_TOPO_MAX_LEVEL_NUM];
+       struct ice_bw_type_info root_node_bw_t_info;
        struct ice_bw_type_info tc_node_bw_t_info[ICE_MAX_TRAFFIC_CLASS];
        struct ice_dcbx_cfg local_dcbx_cfg;     /* Oper/Local Cfg */
        /* DCBX info */