From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-la0-f46.google.com (mail-la0-f46.google.com [209.85.215.46]) by dpdk.org (Postfix) with ESMTP id 7F123FE5 for ; Sun, 1 Feb 2015 11:04:02 +0100 (CET) Received: by mail-la0-f46.google.com with SMTP id s18so32921165lam.5 for ; Sun, 01 Feb 2015 02:04:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=CZ67Bx3NECy+V6Xaij9UPjjXXAS2Yuj5qjY+254qWDU=; b=mqxSum2VU71qF9c9qIYxjp7gWFVbBIc8Zc97DkkPelnIHSJr4HzO423KmQVx0dyeqN UlilWg46iiECChvuUn+GX+pqFB1bz+NP5j0dXUVKHeSfPYlZuCABq1aPAinMd41cvtYE LfBlZDSBbyXRXHNk4bA/aiP3i1aPagUT9qi+jUhYVqqsS/W0JQXorddHa+oWR2qOJJxr fXlbpE1iuTWoiaMOvr4ZAoBiOYaaFHakPj300y5KvnDE71MrMY6YwZAZUTSEHt/w35pg WOnm12mWJ8G6dkkEUu1MHaTsikSC0x5z2KEDAyY9tf9uFPslOnunhgp2ysqAusO32JMx tLcg== X-Gm-Message-State: ALoCoQlM8rn2mgmIcI4aFBqr65jyKsgjr8Vp/h6T/7pgDBFPRVcLUh0XTFYuASDKFK/Vr5JNiVnj X-Received: by 10.112.167.68 with SMTP id zm4mr14354089lbb.93.1422785042280; Sun, 01 Feb 2015 02:04:02 -0800 (PST) Received: from uryu.fosdem.net. ([2001:67c:1810:f0ff:c685:8ff:feca:841f]) by mx.google.com with ESMTPSA id c4sm1608100lbp.32.2015.02.01.02.04.00 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 01 Feb 2015 02:04:01 -0800 (PST) From: Stephen Hemminger To: dev@dpdk.org Date: Sun, 1 Feb 2015 10:03:45 +0000 Message-Id: <1422785031-11494-1-git-send-email-stephen@networkplumber.org> X-Mailer: git-send-email 2.1.4 Cc: Stephen Hemminger Subject: [dpdk-dev] [PATCH 1/7] rte_sched: make RED optional at runtime X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Feb 2015 10:04:02 -0000 From: Stephen Hemminger Want to be able to build with RTE_SCHED_RED enabled but allow disabling RED on a per-queue basis at runtime. RED is disabled unless min/max thresholds set. Signed-off-by: Stephen Hemmminger --- lib/librte_sched/rte_sched.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/librte_sched/rte_sched.c b/lib/librte_sched/rte_sched.c index 95dee27..6928c98 100644 --- a/lib/librte_sched/rte_sched.c +++ b/lib/librte_sched/rte_sched.c @@ -636,6 +636,12 @@ rte_sched_port_config(struct rte_sched_port_params *params) 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_port *port, struct rte_mbuf *pkt, uint3 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; -- 2.1.4