DPDK patches and discussions
 help / color / mirror / Atom feed
From: Marcin Danilewicz <marcinx.danilewicz@intel.com>
To: dev@dpdk.org
Subject: [dpdk][PATCH 2/2] sched: fix to manage TC OV at runtime
Date: Thu,  7 Apr 2022 14:51:53 +0000	[thread overview]
Message-ID: <20220407145153.238969-2-marcinx.danilewicz@intel.com> (raw)
In-Reply-To: <20220407145153.238969-1-marcinx.danilewicz@intel.com>

Added changes after review and increased throughput.

Signed-off-by: Marcin Danilewicz <marcinx.danilewicz@intel.com>

diff --git a/lib/sched/rte_sched.c b/lib/sched/rte_sched.c
index 1d05089d00..6e7d81df46 100644
--- a/lib/sched/rte_sched.c
+++ b/lib/sched/rte_sched.c
@@ -155,7 +155,6 @@ struct rte_sched_subport {
 	uint64_t tc_credits[RTE_SCHED_TRAFFIC_CLASSES_PER_PIPE];
 
 	/* TC oversubscription */
-	uint8_t is_tc_ov_enabled;
 	uint64_t tc_ov_wm;
 	uint64_t tc_ov_wm_min;
 	uint64_t tc_ov_wm_max;
@@ -214,6 +213,9 @@ struct rte_sched_subport {
 	uint8_t *bmp_array;
 	struct rte_mbuf **queue_array;
 	uint8_t memory[0] __rte_cache_aligned;
+
+	/* TC oversubscription activation */
+	int is_tc_ov_enabled;
 } __rte_cache_aligned;
 
 struct rte_sched_port {
@@ -1187,7 +1189,7 @@ rte_sched_subport_tc_ov_config(struct rte_sched_port *port,
 	}
 
 	s = port->subports[subport_id];
-	s->is_tc_ov_enabled = tc_ov_enable;
+	s->is_tc_ov_enabled = tc_ov_enable ? 1 : 0;
 
 	if (s->is_tc_ov_enabled) {
 		/* TC oversubscription */
@@ -1294,6 +1296,9 @@ rte_sched_subport_config(struct rte_sched_port *port,
 		s->n_pipe_profiles = params->n_pipe_profiles;
 		s->n_max_pipe_profiles = params->n_max_pipe_profiles;
 
+		/* TC over-subscription is disabled by default */
+		s->is_tc_ov_enabled = 0;
+
 #ifdef RTE_SCHED_CMAN
 		if (params->cman_params != NULL) {
 			s->cman_enabled = true;
@@ -1356,9 +1361,6 @@ rte_sched_subport_config(struct rte_sched_port *port,
 
 		for (i = 0; i < RTE_SCHED_PORT_N_GRINDERS; i++)
 			s->grinder_base_bmp_pos[i] = RTE_SCHED_PIPE_INVALID;
-
-		/* TC over-subscription is disabled by default */
-		s->is_tc_ov_enabled = 0;
 	}
 
 	{
@@ -2514,12 +2516,15 @@ grinder_schedule(struct rte_sched_port *port,
 	uint32_t pkt_len = pkt->pkt_len + port->frame_overhead;
 	uint32_t be_tc_active;
 
-	if (unlikely(subport->is_tc_ov_enabled)) {
+	switch (subport->is_tc_ov_enabled) {
+	case 1:
 		if (!grinder_credits_check_with_tc_ov(port, subport, pos))
 			return 0;
-	} else {
+		break;
+	case 0:
 		if (!grinder_credits_check(port, subport, pos))
 			return 0;
+		break;
 	}
 
 	/* Advance port time */
-- 
2.25.1

--------------------------------------------------------------
Intel Research and Development Ireland Limited
Registered in Ireland
Registered Office: Collinstown Industrial Park, Leixlip, County Kildare
Registered Number: 308263


This e-mail and any attachments may contain confidential material for the sole
use of the intended recipient(s). Any review or distribution by others is
strictly prohibited. If you are not the intended recipient, please contact the
sender and delete all copies.


  reply	other threads:[~2022-04-07 14:52 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 14:51 [dpdk][PATCH 1/2] sched: enable/disable " Marcin Danilewicz
2022-04-07 14:51 ` Marcin Danilewicz [this message]
2022-04-14  9:53   ` [dpdk][PATCH 2/2] sched: fix to manage " Thomas Monjalon
2022-04-27  9:23   ` [PATCH v3] sched: enable/disable " Marcin Danilewicz
2022-04-27 15:48     ` Singh, Jasvinder
2022-05-09 20:05     ` Dumitrescu, Cristian
2022-05-10  6:40       ` Ajmera, Megha
2022-05-10  9:09         ` Dumitrescu, Cristian
2022-05-24 13:33           ` Marcin Danilewicz
2022-05-24 14:52             ` Stephen Hemminger
2022-05-26 23:12               ` Danilewicz, MarcinX
2022-05-24 13:38     ` [PATCH v4] sched: enable traffic class oversubscription conditionally Marcin Danilewicz
2022-05-24 13:43     ` Marcin Danilewicz
2022-05-24 14:30       ` Dumitrescu, Cristian
2022-05-25 14:18         ` Danilewicz, MarcinX
2022-05-27  0:09           ` Danilewicz, MarcinX
2022-05-27  0:09       ` [PATCH v5] " Marcin Danilewicz
2022-05-30  8:45         ` [PATCH v6] " Marcin Danilewicz
2022-05-30 10:35           ` Dumitrescu, Cristian
2022-05-30 11:59             ` Danilewicz, MarcinX
2022-05-30 10:54           ` Dumitrescu, Cristian
2022-05-30 12:02             ` Danilewicz, MarcinX
2022-05-30 10:58           ` Dumitrescu, Cristian
2022-05-30 12:04             ` Danilewicz, MarcinX
2022-05-30 11:55           ` [PATCH v7] " Marcin Danilewicz
2022-05-30 12:14             ` Dumitrescu, Cristian
2022-05-30 13:34               ` Danilewicz, MarcinX
2022-05-30 13:55                 ` Dumitrescu, Cristian
2022-05-30 14:05                   ` Danilewicz, MarcinX
2022-05-30 13:38             ` [PATCH v8] " Marcin Danilewicz
2022-05-30 18:47               ` [PATCH v9] " Marcin Danilewicz
2022-05-30 21:13                 ` Dumitrescu, Cristian
2022-05-31  9:49                 ` [PATCH v10] " Marcin Danilewicz
2022-05-31 13:09                   ` Dumitrescu, Cristian
2022-05-31 16:42                     ` Thomas Monjalon
2022-05-31 18:45                       ` Danilewicz, MarcinX
2022-04-08 12:50 ` [dpdk][PATCH 1/2] sched: enable/disable TC OV at runtime Singh, Jasvinder

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220407145153.238969-2-marcinx.danilewicz@intel.com \
    --to=marcinx.danilewicz@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).