]> git.droids-corp.org - dpdk.git/commitdiff
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 3d248911353a8c348446de1d7b0213fb87b3bbeb..46754a3339b2d3b3fc8562e63a0f965c19cb11d1 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 d176f74955711892173731b4e1408b1bb36d237c..393e2d3f6dc8d8bed155037f632564df1576f33d 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 d05fbfccd4aa3364fed280717a15930814fdb7b8..1374b9a0968c900d012a343b0fa5b8ee36fceb75 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 c558a1cb0844c54321e0cc314e2cf68ccb99c772..997f97e0decee856004087c98adbc13312bac7a7 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 */