[PATCH v2 072/148] net/ice/base: update strict status when assigning BW limits

Anatoly Burakov anatoly.burakov at intel.com
Wed Jun 12 17:01:06 CEST 2024


From: Ian Stokes <ian.stokes at intel.com>

In the BW configuration performed by DCF functions, the strict/WFQ and priority
field (referred to as Generic in the EAS) is not updated in the FW.  This needs
to be updated so as to not incorrectly allocate BW credits in the traffic
shaping Tx scheduler.

Call the function "ice_sched_replay_node_prio" in the configuration flow once
the node has been determined and the value of strict verified.

Signed-off-by: Dave Ertman <david.m.ertman at intel.com>
Signed-off-by: Ian Stokes <ian.stokes at intel.com>
---
 drivers/net/ice/base/ice_sched.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/drivers/net/ice/base/ice_sched.c b/drivers/net/ice/base/ice_sched.c
index af8f8cc7a9..d39106173b 100644
--- a/drivers/net/ice/base/ice_sched.c
+++ b/drivers/net/ice/base/ice_sched.c
@@ -4659,6 +4659,10 @@ ice_sched_save_tc_node_bw(struct ice_port_info *pi, u8 tc,
 	return 0;
 }
 
+#define ICE_SCHED_GENERIC_STRICT_MODE		BIT(4)
+#define ICE_SCHED_GENERIC_PRIO_M		0xE
+#define ICE_SCHED_GENERIC_PRIO_S		1
+
 /**
  * ice_sched_set_tc_node_bw_lmt - sets TC node BW limit
  * @pi: port information structure
@@ -4683,6 +4687,17 @@ ice_sched_set_tc_node_bw_lmt(struct ice_port_info *pi, u8 tc,
 	tc_node = ice_sched_get_tc_node(pi, tc);
 	if (!tc_node)
 		goto exit_set_tc_node_bw;
+
+	/* update node's generic field */
+	buf = tc_node->info;
+	data = &buf.data;
+	data->valid_sections = ICE_AQC_ELEM_VALID_GENERIC;
+	data->generic = (tc << ICE_SCHED_GENERIC_PRIO_S) |
+		ICE_SCHED_GENERIC_STRICT_MODE;
+	status = ice_sched_update_elem(pi->hw, tc_node, &buf);
+	if (status)
+		goto exit_set_tc_node_bw;
+
 	if (bw == ICE_SCHED_DFLT_BW)
 		status = ice_sched_set_node_bw_dflt_lmt(pi, tc_node, rl_type);
 	else
-- 
2.43.0



More information about the dev mailing list