From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by dpdk.org (Postfix) with ESMTP id CE9E4CE7 for ; Mon, 8 Dec 2014 18:51:33 +0100 (CET) Received: by mail-pd0-f176.google.com with SMTP id y10so5545769pdj.35 for ; Mon, 08 Dec 2014 09:51:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:user-agent:date:from:to:cc:subject :references:mime-version:content-type:content-disposition; bh=4lzYg3Tj1gHf1p5nbO2YngcH7xn1pbePmGy9g4G192Y=; b=S4t9kf6srFAGzgJninlK3EgfRePDYkaVJ8q8VPAHJ5jcO0cXXFOcnOmNeTZ1mgUGiy yqc6M6+1gn6+UHPdTbcID/WYdvtmm7W2tbTxK+kYn30Srj+LHMr1K5ugnvyBx2Nhz3+7 GQyphFIAMbB5RJ1htbkjdmrNrdutiUH8YF9am0FuC925oy07s4gbZYy0ks26+LCKi0QC j7mU9rl9L/Kgt1A++4FRTJ4KnPx6q6QwqTkSikapX0ZXhHVaZCbfdpnOwqKZ5pmJ/fir Dw3efl6QwQ/VGD1K6v+HxAGVVNEGVAKwPAukfha1DhtKSq44KICIDht2/VFhKxDtledM VK4A== X-Gm-Message-State: ALoCoQkPVAV45mklrokhnOhKASfv112HGRXFecJP5rc6P0OppBdn72MH2FNC+qwDv8ebFi+pTCsP X-Received: by 10.66.162.37 with SMTP id xx5mr56142646pab.10.1418061093123; Mon, 08 Dec 2014 09:51:33 -0800 (PST) Received: from localhost (static-50-53-82-155.bvtn.or.frontiernet.net. [50.53.82.155]) by mx.google.com with ESMTPSA id im5sm36846662pbb.43.2014.12.08.09.51.31 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 08 Dec 2014 09:51:32 -0800 (PST) X-Mailman-Approved-At: Mon, 08 Dec 2014 20:36:25 +0100 Subject: [dpdk-dev] (no subject) 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: , Date: Mon, 08 Dec 2014 17:51:34 -0000 X-List-Received-Date: Mon, 08 Dec 2014 17:51:34 -0000 Content-Type: text/plain; charset="UTF-8" Message-ID: <20141208175134.od2aVoOfghYH8FZLLpa6fJKNXO9SOgF9S9BQTHV2gGw@z> >>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 To: Thomas Monjalon Cc: dev@dpdk.org, Stephen Hemminger 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 --- 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;