diff mbox

[dpdk-dev,RFC,3/7] ring: use linear-tid as ring debug stats index

Message ID 1418263490-21088-4-git-send-email-cunming.liang@intel.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Cunming Liang Dec. 11, 2014, 2:04 a.m. UTC
Signed-off-by: Cunming Liang <cunming.liang@intel.com>
---
 lib/librte_ring/rte_ring.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/lib/librte_ring/rte_ring.h b/lib/librte_ring/rte_ring.h
index 3920830..c038a4f 100644
--- a/lib/librte_ring/rte_ring.h
+++ b/lib/librte_ring/rte_ring.h
@@ -189,9 +189,9 @@  struct rte_ring {
  */
 #ifdef RTE_LIBRTE_RING_DEBUG
 #define __RING_STAT_ADD(r, name, n) do {		\
-		unsigned __lcore_id = rte_lcore_id();	\
-		r->stats[__lcore_id].name##_objs += n;	\
-		r->stats[__lcore_id].name##_bulk += 1;	\
+		unsigned __thread_id = rte_linear_thread_id(); \
+		r->stats[__thread_id].name##_objs += n;	\
+		r->stats[__thread_id].name##_bulk += 1;	\
 	} while(0)
 #else
 #define __RING_STAT_ADD(r, name, n) do {} while(0)