From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by inbox.dpdk.org (Postfix) with ESMTP id CE20CA04C5;
	Sat,  5 Sep 2020 00:31:39 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 423021BC25;
	Sat,  5 Sep 2020 00:31:39 +0200 (CEST)
Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com
 [209.85.210.169]) by dpdk.org (Postfix) with ESMTP id DE414E07
 for <dev@dpdk.org>; Sat,  5 Sep 2020 00:31:37 +0200 (CEST)
Received: by mail-pf1-f169.google.com with SMTP id z19so3197166pfn.8
 for <dev@dpdk.org>; Fri, 04 Sep 2020 15:31:37 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=networkplumber-org.20150623.gappssmtp.com; s=20150623;
 h=from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding;
 bh=XqadQiZnKn/njX9k1VGw0ZqYt2ci8Vs8fBYeoVNK1GU=;
 b=ZWaf9umLf8xUSMWqQ8Dl1JW/9T4IpW9Hljq+U+UfE3lzUf2yZIwLcnE6LDx2q/MSY8
 nSd0k8o3AF8+zNIHgF7a+ZeyoOPuMvYoq9E9Am470UssNtgFcLgRXfiHHrornhmE21wm
 FerzZFOfUyTP7TElMnkr0xYk2RVzA3e2ElIL04BSCBajJ7La4Lp6PqVfpuTYUh0eMsuf
 Ymvni4qFraes34Bmqm0xXlCeqlnuzR3XMWv7OWcv/BSA12N9cPZ3pQi9rGWVIwh73Fl5
 72lB28NOxZopkzgyMPHJYALea+SDoB4ydpv/pVQKBNB0A8bx5bax68Nrq6kkvfIQHw1R
 LjFg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to
 :references:mime-version:content-transfer-encoding;
 bh=XqadQiZnKn/njX9k1VGw0ZqYt2ci8Vs8fBYeoVNK1GU=;
 b=H9y5PdPSwl2P/APHRSZpngk/3VmA+McxmlgaGGMawxacdxSPHFiXLyReDlNU8Gb1Fc
 k1pCJzsH0PHi5fQkefhAIcsup/qsBG/SB/E+Xjq9901mTHE2sjMPFMJisNYOFTJQbJeY
 6EEfyW1rrDQLe8wVdKldCG1e6xbOvkS74frOJwNjP+XVQqz2xcgFDHupEuDueLwyKMKI
 hbP8VZK9+B+Gx6oC48ufJd/3lofxGtmOsa1FdTGFtFESghOAwt/FtllgIrCKT+VIo+ru
 d6bGHCkuYzhg7aOG8jhu4qXJi2eeHe9FToNcik0vN6K7AI/SbqZcY1rtjU2c2Suc1Qt5
 YgmA==
X-Gm-Message-State: AOAM5311aNnfFMkWKHsBO6iUBohbra4iYdWrOjezk4xNmBsbbtoZzaxL
 9ZOhGCXnPnsMTlJWZfhmSCplIuuf5DuKPg==
X-Google-Smtp-Source: ABdhPJx7qz5SaLoq3DLTMIrAEu0QSdRhNoM7mxODstYrM8vhQb2zMbEQebt+m7dqsGBENvMytskX2g==
X-Received: by 2002:a63:7056:: with SMTP id a22mr9047132pgn.12.1599258696543; 
 Fri, 04 Sep 2020 15:31:36 -0700 (PDT)
Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])
 by smtp.gmail.com with ESMTPSA id gk14sm4267118pjb.41.2020.09.04.15.31.35
 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
 Fri, 04 Sep 2020 15:31:35 -0700 (PDT)
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Date: Fri,  4 Sep 2020 15:31:19 -0700
Message-Id: <20200904223118.10002-1-stephen@networkplumber.org>
X-Mailer: git-send-email 2.27.0
In-Reply-To: <20200702172852.6201-1-stephen@networkplumber.org>
References: <20200702172852.6201-1-stephen@networkplumber.org>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH] rte_metrics: move maximum number of metrics into
	rte_config
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>

If using lots of queues and ports, and having per port or per queue
metrics it is easy to exceed the upper bound of the metric library.
Move the limit into rte_config where user can change it.

Ideally, there would be no upper bound and a dynamic structure
such as red-black tree or hash table would be used for these.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 config/rte_config.h              | 3 +++
 lib/librte_metrics/rte_metrics.h | 1 -
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/config/rte_config.h b/config/rte_config.h
index 9bb915347cb6..b880974f5787 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -104,6 +104,9 @@
 #define RTE_GRAPH_BURST_SIZE 256
 #define RTE_LIBRTE_GRAPH_STATS 1
 
+/* rte_metrics defines */
+#define RTE_METRICS_MAX_METRICS 256
+
 /****** driver defines ********/
 
 /* QuickAssist device */
diff --git a/lib/librte_metrics/rte_metrics.h b/lib/librte_metrics/rte_metrics.h
index fbe64ddf2b47..40f015b8bb93 100644
--- a/lib/librte_metrics/rte_metrics.h
+++ b/lib/librte_metrics/rte_metrics.h
@@ -34,7 +34,6 @@ extern int metrics_initialized;
 
 /** Maximum length of metric name (including null-terminator) */
 #define RTE_METRICS_MAX_NAME_LEN 64
-#define RTE_METRICS_MAX_METRICS 256
 
 /**
  * Global metric special id.
-- 
2.27.0