From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by dpdk.org (Postfix) with ESMTP id 479375F25; Wed, 3 Oct 2018 14:48:30 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Oct 2018 05:48:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,336,1534834800"; d="scan'208";a="262505003" Received: from silpixa00399752.ir.intel.com (HELO silpixa00399752.ger.corp.intel.com) ([10.237.222.212]) by orsmga005.jf.intel.com with ESMTP; 03 Oct 2018 05:48:27 -0700 From: Ferruh Yigit To: Nikhil Rao , Jerin Jacob Cc: dev@dpdk.org, Ferruh Yigit , stable@dpdk.org, sunila.sahu@caviumnetworks.com, rasesh.mody@cavium.com, roy.fan.zhang@intel.com Date: Wed, 3 Oct 2018 14:48:11 +0100 Message-Id: <20181003134811.64662-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [dpdk-dev] [PATCH] eventdev: prefix global 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: , X-List-Received-Date: Wed, 03 Oct 2018 12:48:31 -0000 A global defined with name "stats". DPDK is a library, please don't define global variables with this generic name. Fixes: b1ce8ebd97ba ("eventdev: add PMD callbacks for eth Rx adapter") Cc: stable@dpdk.org Signed-off-by: Ferruh Yigit --- There are already questions about that "stats" variable: - Why a global variable defined in header file? - It seems it is not used at all, remove it? Forgotten to be removed in below commit, but because of generic "stats" name, it didn't cause any compile error but happily used global variable Fixes: 3810ae435783 ("eventdev: add interrupt driven queues to Rx adapter") But this patch mainly sent as an RFC, to ask what would you think about a cleanup patch to add the library prefix for all the global variables that are defined in libries? (yes we have lots of them) Like: zip_cc --> octeontx_zip_cc [1] valid_args --> qede_valid_args [2] scheduler --> crypto_scheduler [3] [1] Argh! This also looks wrong, I think intention was make this enum name instead of global variable, can you please check. (This was random sample I chosed.) Commit 43e610bb8565 ("compress/octeontx: introduce octeontx zip PMD") Cc: sunila.sahu@caviumnetworks.com [2] This is also wrong, it should be static, Commit f64b91b0eb5d ("net/qede: replace config option with run-time arg") Cc: rasesh.mody@cavium.com [3] This should be static too, Commit 100e4f7e44ab ("crypto/scheduler: add round-robin mode") Cc: roy.fan.zhang@intel.com --- lib/librte_eventdev/rte_event_eth_rx_adapter.c | 2 +- lib/librte_eventdev/rte_eventdev_pmd.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/librte_eventdev/rte_event_eth_rx_adapter.c b/lib/librte_eventdev/rte_event_eth_rx_adapter.c index 870ac8c3b..5d7d8435b 100644 --- a/lib/librte_eventdev/rte_event_eth_rx_adapter.c +++ b/lib/librte_eventdev/rte_event_eth_rx_adapter.c @@ -1125,7 +1125,7 @@ rxa_poll(struct rte_event_eth_rx_adapter *rx_adapter) wrr_pos = rx_adapter->wrr_pos; max_nb_rx = rx_adapter->max_nb_rx; buf = &rx_adapter->event_enqueue_buffer; - stats = &rx_adapter->stats; + rte_eventdev_stats = &rx_adapter->stats; /* Iterate through a WRR sequence */ for (num_queue = 0; num_queue < rx_adapter->wrr_len; num_queue++) { diff --git a/lib/librte_eventdev/rte_eventdev_pmd.h b/lib/librte_eventdev/rte_eventdev_pmd.h index 792fb3a23..14f9e4520 100644 --- a/lib/librte_eventdev/rte_eventdev_pmd.h +++ b/lib/librte_eventdev/rte_eventdev_pmd.h @@ -592,7 +592,7 @@ typedef int (*eventdev_eth_rx_adapter_stop_t) (const struct rte_eventdev *dev, const struct rte_eth_dev *eth_dev); -struct rte_event_eth_rx_adapter_stats *stats; +struct rte_event_eth_rx_adapter_stats *rte_eventdev_stats; /** * Retrieve ethernet Rx adapter statistics. -- 2.17.1