From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1916DA04BA; Fri, 11 Sep 2020 15:19:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D46961C1C2; Fri, 11 Sep 2020 15:16:37 +0200 (CEST) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 50FAC1C1A9 for ; Fri, 11 Sep 2020 15:16:28 +0200 (CEST) IronPort-SDR: i5/iyo879WF7lbR14AmemLDA2CRKC6hO2ne873iwir2FYT0zranqZ2FT8ppFeBghmMb7Ha4Z7m UC7QCzIj7b1A== X-IronPort-AV: E=McAfee;i="6000,8403,9740"; a="146482259" X-IronPort-AV: E=Sophos;i="5.76,415,1592895600"; d="scan'208";a="146482259" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Sep 2020 06:16:27 -0700 IronPort-SDR: 3Xfsy37KAcKHWa6aIMp33A2tM4pHSmlpMW5HgzyemsnOaoaMKhR70Zp7kNJg3B+qd81lcz//tq DXIFQvnNGpOg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.76,415,1592895600"; d="scan'208";a="342296617" Received: from dpdk51.sh.intel.com ([10.67.111.82]) by FMSMGA003.fm.intel.com with ESMTP; 11 Sep 2020 06:16:26 -0700 From: Qi Zhang To: ferruh.yigit@intel.com Cc: dev@dpdk.org, Qi Zhang , Shibin Koikkara Reeny Date: Fri, 11 Sep 2020 21:19:32 +0800 Message-Id: <20200911131954.15999-19-qi.z.zhang@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20200911131954.15999-1-qi.z.zhang@intel.com> References: <20200907112826.48493-1-qi.z.zhang@intel.com> <20200911131954.15999-1-qi.z.zhang@intel.com> Subject: [dpdk-dev] [PATCH v2 18/40] net/ice/base: introduce Tx rate limiting on port level X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- drivers/net/ice/base/ice_common.c | 5 +++++ drivers/net/ice/base/ice_common.h | 1 + drivers/net/ice/base/ice_sched.c | 20 ++++++++++++++++++++ drivers/net/ice/base/ice_type.h | 1 + 4 files changed, 27 insertions(+) diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c index 3d2489113..46754a333 100644 --- a/drivers/net/ice/base/ice_common.c +++ b/drivers/net/ice/base/ice_common.c @@ -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); } diff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h index d176f7495..393e2d3f6 100644 --- a/drivers/net/ice/base/ice_common.h +++ b/drivers/net/ice/base/ice_common.h @@ -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 * diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c index d05fbfccd..1374b9a09 100644 --- a/drivers/net/ice/base/ice_sched.c +++ b/drivers/net/ice/base/ice_sched.c @@ -5382,6 +5382,26 @@ void ice_sched_replay_agg_vsi_preinit(struct ice_hw *hw) } /** + * 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 * diff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h index c558a1cb0..997f97e0d 100644 --- a/drivers/net/ice/base/ice_type.h +++ b/drivers/net/ice/base/ice_type.h @@ -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 */ -- 2.13.6