From patchwork Tue Nov 17 17:14:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 84273 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9CDC9A04E6; Tue, 17 Nov 2020 18:15:06 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B38745937; Tue, 17 Nov 2020 18:15:02 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id B52635928; Tue, 17 Nov 2020 18:14:59 +0100 (CET) IronPort-SDR: emejCN7XBT7UmPbw5i4Isi+q87v961idBRF9YcOGE+h9Hy2FZq+ukD9I6//rDEWATQ/b81MGVv eIMLvwW3xhMA== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="157997949" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="157997949" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2020 09:14:54 -0800 IronPort-SDR: QNfSFkF9ddf2VTl3JfGVI8r1z08yhMqmO7YpyZyAV3FaLHc4XdZPOxP13uOwfDlTjGiSLLHU4v XxjvR8Sl4GPg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="330146823" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by orsmga006.jf.intel.com with ESMTP; 17 Nov 2020 09:14:51 -0800 From: Ferruh Yigit To: Maryam Tahhan , Reshma Pattan , Harry van Haaren , Roman Korynkevych Cc: Ferruh Yigit , dev@dpdk.org, stable@dpdk.org Date: Tue, 17 Nov 2020 17:14:32 +0000 Message-Id: <20201117171435.2303641-2-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201117171435.2303641-1-ferruh.yigit@intel.com> References: <20201117171435.2303641-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 1/4] app/procinfo: fix redundant condition X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" '_filters' is compared twice, second one will be always false, removing it using the message more relevant to the '_filters'. Fixes: 2deb6b5246d7 ("app/procinfo: add collectd format and host id") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- Cc: romanx.korynkevych@intel.com --- app/proc-info/main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index d743209f0d..35e5b596eb 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -420,11 +420,9 @@ static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len, } else if ((type_end != NULL) && (strncmp(cnt_name, "flow_", strlen("flow_"))) == 0) { if (strncmp(type_end, "_filters", strlen("_filters")) == 0) - strlcpy(cnt_type, "operations", cnt_type_len); + strlcpy(cnt_type, "filter_result", cnt_type_len); else if (strncmp(type_end, "_errors", strlen("_errors")) == 0) strlcpy(cnt_type, "errors", cnt_type_len); - else if (strncmp(type_end, "_filters", strlen("_filters")) == 0) - strlcpy(cnt_type, "filter_result", cnt_type_len); } else if ((type_end != NULL) && (strncmp(cnt_name, "mac_", strlen("mac_"))) == 0) { if (strncmp(type_end, "_errors", strlen("_errors")) == 0) From patchwork Tue Nov 17 17:14:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 84275 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 96EC9A04E6; Tue, 17 Nov 2020 18:15:50 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BF4FFC8F2; Tue, 17 Nov 2020 18:15:06 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 6BE8D592C; Tue, 17 Nov 2020 18:15:01 +0100 (CET) IronPort-SDR: ymlE72cYXxv6bDLfUxi3n9Bkz2ZUDN4ga43PIfxzDvh2B30YA+1b9+DqRb0fHV4yDo062fLgJ/ Tm7ebQkJhYKg== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="157997957" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="157997957" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2020 09:14:56 -0800 IronPort-SDR: tp9z+JQzL5zkKsgP1X1EmavPHUrrC//7DOMNbkBManylXReyLr/J9iM52z6EYdGgBbEo8fAc/J FwHLOIcmn3RQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="330146840" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by orsmga006.jf.intel.com with ESMTP; 17 Nov 2020 09:14:55 -0800 From: Ferruh Yigit To: Maryam Tahhan , Reshma Pattan , Kuba Kozak Cc: Ferruh Yigit , dev@dpdk.org, stable@dpdk.org Date: Tue, 17 Nov 2020 17:14:33 +0000 Message-Id: <20201117171435.2303641-3-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201117171435.2303641-1-ferruh.yigit@intel.com> References: <20201117171435.2303641-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 2/4] app/procinfo: fix negative check on unsigned variable X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 'parse_xstats_ids()' return 'int'. The return value is assigned to 'nb_xstats_ids' unsigned value, later negative check on this variable is wrong. Adding interim 'int' variable for negative check. Fixes: 7ac16a3660c0 ("app/proc-info: support xstats by ID and by name") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- Cc: kubax.kozak@intel.com --- app/proc-info/main.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 35e5b596eb..c11fe25af4 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -301,14 +301,13 @@ proc_info_parse_args(int argc, char **argv) } else if (!strncmp(long_option[option_index].name, "xstats-ids", MAX_LONG_OPT_SZ)) { - nb_xstats_ids = parse_xstats_ids(optarg, + int ret = parse_xstats_ids(optarg, xstats_ids, MAX_NB_XSTATS_IDS); - - if (nb_xstats_ids <= 0) { + if (ret <= 0) { printf("xstats-id list parse error.\n"); return -1; } - + nb_xstats_ids = (uint32_t)ret; } break; default: From patchwork Tue Nov 17 17:14:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 84274 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4D86CA04E6; Tue, 17 Nov 2020 18:15:29 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D3E1FC8C8; Tue, 17 Nov 2020 18:15:04 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id A0B655928; Tue, 17 Nov 2020 18:15:01 +0100 (CET) IronPort-SDR: O1G1d2qJEse497saTW0P12KUZtCwzcv/cjARUtiTJit86Jble90qTWQLULTPTglX/Q0sI/HYdS jLUGvKvk8KuQ== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="157997964" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="157997964" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2020 09:14:59 -0800 IronPort-SDR: yK/v7ru0kJ1w/l7ecXD8xCVJHZnbROq3280HwydV9FecaNs0LLARIJwvNsNlLTvZnG6ieQOeIe f5Dj0+1BPnUw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="330146858" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by orsmga006.jf.intel.com with ESMTP; 17 Nov 2020 09:14:58 -0800 From: Ferruh Yigit To: Maryam Tahhan , Reshma Pattan , John McNamara , Vipin Varghese Cc: Ferruh Yigit , dev@dpdk.org, stable@dpdk.org Date: Tue, 17 Nov 2020 17:14:34 +0000 Message-Id: <20201117171435.2303641-4-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201117171435.2303641-1-ferruh.yigit@intel.com> References: <20201117171435.2303641-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 3/4] app/procinfo: remove suspicious sizeof X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" The intention with the "sizeof(0)" usage is not clear, but the 'stats' already 'memset' by 'rte_cryptodev_stats_get()' API, removing 'memset' in application. Fixes: fe773600fe3e ("app/procinfo: add --show-crypto") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- Cc: vipin.varghese@intel.com --- app/proc-info/main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index c11fe25af4..dc5cc92209 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -1207,7 +1207,6 @@ show_crypto(void) display_crypto_feature_info(dev_info.feature_flags); - memset(&stats, 0, sizeof(0)); if (rte_cryptodev_stats_get(i, &stats) == 0) { printf("\t -- stats\n"); printf("\t\t + enqueue count (%"PRIu64")" From patchwork Tue Nov 17 17:14:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ferruh Yigit X-Patchwork-Id: 84276 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 70B0AA04E6; Tue, 17 Nov 2020 18:16:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A35D1C900; Tue, 17 Nov 2020 18:15:08 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id 6711BC8DA; Tue, 17 Nov 2020 18:15:05 +0100 (CET) IronPort-SDR: 99W2Dq8gGi6TPgYX2PnDngoBDHwFUfUDBf7ZKalUbj2evFUwPOhZuPYbWvGS0IgcjHT6WgIC9S ABaRfXuSYprg== X-IronPort-AV: E=McAfee;i="6000,8403,9808"; a="157997974" X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="157997974" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2020 09:15:03 -0800 IronPort-SDR: Z7GGm10a+PyrxDPYyj1aTY6VHax5TX+/jGWpK1nEgcAUzUuKXZeqS/sg/IHR7F6VPXt/hvkIag DI5a+GlkCc2g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.77,486,1596524400"; d="scan'208";a="330146955" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.180]) by orsmga006.jf.intel.com with ESMTP; 17 Nov 2020 09:15:01 -0800 From: Ferruh Yigit To: Maryam Tahhan , Reshma Pattan , Vipin Varghese , John McNamara Cc: Ferruh Yigit , dev@dpdk.org, stable@dpdk.org Date: Tue, 17 Nov 2020 17:14:35 +0000 Message-Id: <20201117171435.2303641-5-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201117171435.2303641-1-ferruh.yigit@intel.com> References: <20201117171435.2303641-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH 4/4] app/procinfo: remove useless assignment X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 'flag' initialized to '0' but it is overwritten later, initial assignment can be removed. Fixes: 0101a0ec6217 ("app/procinfo: add --show-mempool") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- Cc: vipin.varghese@intel.com --- app/proc-info/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index dc5cc92209..52975842fa 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -1264,7 +1264,7 @@ show_ring(char *name) static void show_mempool(char *name) { - uint64_t flags = 0; + uint64_t flags; snprintf(bdr_str, MAX_STRING_LEN, " show - MEMPOOL "); STATS_BDR_STR(10, bdr_str);