From: alangordondewar@gmail.com Subject: [PATCH] sched: make RED scaling configurable Date: Fri, 1 Sep 2017 14:41:30 +0100 Message-ID: <1504273290-5429-1-git-send-email-alan.dewar@att.com> Cc: dev@dpdk.org, Alan Dewar To: tomasz.kantecki@intel.com Return-path: Received: from mail-wr0-f193.google.com (mail-wr0-f193.google.com [209.85.128.193]) by dpdk.org (Postfix) with ESMTP id A2BAC374F for ; Fri, 1 Sep 2017 15:41:40 +0200 (CEST) Received: by mail-wr0-f193.google.com with SMTP id a47so130332wra.2 for ; Fri, 01 Sep 2017 06:41:40 -0700 (PDT) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Alan Dewar The RED code stores the maximum threshold is a 32-bit integer as a pseudo fixed-point floating number with 10 fractional bits. Twelve other bits are used to encode the filter weight, leaving just 10 bits for the queue length. This limits the maximum queue length supported by RED queues as 1024 packets. Move the "hard" definitions from red.h into config/common_base so that RED scaling can be configured during build. Signed-off-by: Alan Dewar --- config/common_base | 2 ++ lib/librte_sched/rte_red.h | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/config/common_base b/config/common_base index 5e97a08..5501dfe 100644 --- a/config/common_base +++ b/config/common_base @@ -666,6 +666,8 @@ CONFIG_RTE_SCHED_COLLECT_STATS=n CONFIG_RTE_SCHED_SUBPORT_TC_OV=n CONFIG_RTE_SCHED_PORT_N_GRINDERS=8 CONFIG_RTE_SCHED_VECTOR=n +CONFIG_RTE_RED_SCALING=10 +CONFIG_RTE_RED_MAX_TH_MAX=1023 # # Compile the distributor library diff --git a/lib/librte_sched/rte_red.h b/lib/librte_sched/rte_red.h index ca12227..49d3379 100644 --- a/lib/librte_sched/rte_red.h +++ b/lib/librte_sched/rte_red.h @@ -51,10 +51,9 @@ extern "C" { #include #include #include +#include -#define RTE_RED_SCALING 10 /**< Fraction size for fixed-point */ #define RTE_RED_S (1 << 22) /**< Packet size multiplied by number of leaf queues */ -#define RTE_RED_MAX_TH_MAX 1023 /**< Max threshold limit in fixed point format */ #define RTE_RED_WQ_LOG2_MIN 1 /**< Min inverse filter weight value */ #define RTE_RED_WQ_LOG2_MAX 12 /**< Max inverse filter weight value */ #define RTE_RED_MAXP_INV_MIN 1 /**< Min inverse mark probability value */ -- 2.1.4