DPDK patches and discussions
 help / color / mirror / Atom feed
Subject: [dpdk-dev] (no subject)
Date: Mon, 08 Dec 2014 17:51:34 -0000	[thread overview]
Message-ID: <20141208175134.od2aVoOfghYH8FZLLpa6fJKNXO9SOgF9S9BQTHV2gGw@z> (raw)

>From stephen@networkplumber.org Mon Dec  8 09:46:51 2014
Message-Id: <20141208174651.181685914@networkplumber.org>
User-Agent: quilt/0.63-1
Date: Mon, 08 Dec 2014 09:45:57 -0800
From: Stephen Hemminger <stephen@networkplumber.org>
To: Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: dev@dpdk.org,
 Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH 3/6] qos: make RED optional
References: <20141208174554.889069531@networkplumber.org>
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-15
Content-Disposition: inline; filename=qos-optional-red.patch

We want to be able to build with RTE_SCHED_RED enabled but
allow disabling RED on a per-queue basis at runtime. This is
handled by allowing RED min/max to be zero to indicate that
RED is not being used.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>


--- a/lib/librte_sched/rte_sched.c	2014-12-08 09:28:20.782545529 -0800
+++ b/lib/librte_sched/rte_sched.c	2014-12-08 09:28:20.782545529 -0800
@@ -636,6 +636,12 @@ rte_sched_port_config(struct rte_sched_p
 		uint32_t j;
 
 		for (j = 0; j < e_RTE_METER_COLORS; j++) {
+			/* if min/max are both zero, then RED is disabled */
+			if ((params->red_params[i][j].min_th |
+			     params->red_params[i][j].max_th) == 0) {
+				continue;
+			}
+
 			if (rte_red_config_init(&port->red_config[i][j],
 				params->red_params[i][j].wq_log2,
 				params->red_params[i][j].min_th,
@@ -1069,6 +1075,9 @@ rte_sched_port_red_drop(struct rte_sched
 	color = rte_sched_port_pkt_read_color(pkt);
 	red_cfg = &port->red_config[tc_index][color];
 
+	if ( (red_cfg->min_th | red_cfg->max_th) == 0)
+		return 0;
+
 	qe = port->queue_extra + qindex;
 	red = &qe->red;
 

             reply	other threads:[~2014-12-08 17:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-08 17:51  [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-08-08  2:30 Tiwei Bie
2019-07-09  2:09 dev-bounces
2017-02-21 14:58 anders
2017-02-09 11:53 anders
2014-12-08 17:51 
2014-12-08 17:51 
2014-12-08 17:51 
2014-12-08 17:51 
2014-12-08 17:51 
2014-12-08 17:51 

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=20141208175134.od2aVoOfghYH8FZLLpa6fJKNXO9SOgF9S9BQTHV2gGw@z \
    --to=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).