From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 172EE694A for ; Mon, 30 May 2016 12:48:25 +0200 (CEST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP; 30 May 2016 03:48:25 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.26,389,1459839600"; d="scan'208";a="817650958" Received: from rhorton-mobl.ger.corp.intel.com (HELO VM.ir.intel.com) ([163.33.228.212]) by orsmga003.jf.intel.com with ESMTP; 30 May 2016 03:48:24 -0700 From: Remy Horton To: dev@dpdk.org, Thomas Monjalon , Helin Zhang , Wenzhuo Lu , Jing Chen , Huawei Xie Date: Mon, 30 May 2016 11:48:11 +0100 Message-Id: <1464605292-4599-10-git-send-email-remy.horton@intel.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1464605292-4599-1-git-send-email-remy.horton@intel.com> References: <1464605292-4599-1-git-send-email-remy.horton@intel.com> Subject: [dpdk-dev] [PATCH v3 09/10] remove name field from struct rte_eth_xstats X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 May 2016 10:48:26 -0000 The current extended ethernet statistics fetching involve doing several string operations, which causes performance issues if there are lots of statistics and/or network interfaces. This patch removes the name field and all its usage of the old API. Signed-off-by: Remy Horton --- drivers/net/e1000/igb_ethdev.c | 2 -- drivers/net/fm10k/fm10k_ethdev.c | 3 --- drivers/net/i40e/i40e_ethdev.c | 4 ---- drivers/net/i40e/i40e_ethdev_vf.c | 1 - drivers/net/ixgbe/ixgbe_ethdev.c | 3 --- drivers/net/virtio/virtio_ethdev.c | 2 -- lib/librte_ether/rte_ethdev.c | 3 --- lib/librte_ether/rte_ethdev.h | 2 -- 8 files changed, 20 deletions(-) diff --git a/drivers/net/e1000/igb_ethdev.c b/drivers/net/e1000/igb_ethdev.c index 6d5e46f..2bfd3f8 100644 --- a/drivers/net/e1000/igb_ethdev.c +++ b/drivers/net/e1000/igb_ethdev.c @@ -1741,7 +1741,6 @@ eth_igb_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, /* Extended stats */ for (i = 0; i < IGB_NB_XSTATS; i++) { - xstats[i].name[0] = '\0'; xstats[i].id = i; xstats[i].value = *(uint64_t *)(((char *)hw_stats) + rte_igb_stats_strings[i].offset); @@ -1824,7 +1823,6 @@ eth_igbvf_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, return 0; for (i = 0; i < IGBVF_NB_XSTATS; i++) { - xstats[i].name[0] = '\0'; xstats[i].id = i; xstats[i].value = *(uint64_t *)(((char *)hw_stats) + rte_igbvf_stats_strings[i].offset); diff --git a/drivers/net/fm10k/fm10k_ethdev.c b/drivers/net/fm10k/fm10k_ethdev.c index 179441d..be7431d 100644 --- a/drivers/net/fm10k/fm10k_ethdev.c +++ b/drivers/net/fm10k/fm10k_ethdev.c @@ -1310,7 +1310,6 @@ fm10k_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, /* Global stats */ for (i = 0; i < FM10K_NB_HW_XSTATS; i++) { - xstats[count].name[0] = '\0'; xstats[count].value = *(uint64_t *)(((char *)hw_stats) + fm10k_hw_stats_strings[count].offset); count++; @@ -1319,14 +1318,12 @@ fm10k_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, /* PF queue stats */ for (q = 0; q < FM10K_MAX_QUEUES_PF; q++) { for (i = 0; i < FM10K_NB_RX_Q_XSTATS; i++) { - xstats[count].name[0] = '\0'; xstats[count].value = *(uint64_t *)(((char *)&hw_stats->q[q]) + fm10k_hw_stats_rx_q_strings[i].offset); count++; } for (i = 0; i < FM10K_NB_TX_Q_XSTATS; i++) { - xstats[count].name[0] = '\0'; xstats[count].value = *(uint64_t *)(((char *)&hw_stats->q[q]) + fm10k_hw_stats_tx_q_strings[i].offset); diff --git a/drivers/net/i40e/i40e_ethdev.c b/drivers/net/i40e/i40e_ethdev.c index e0ce695..cc77370 100644 --- a/drivers/net/i40e/i40e_ethdev.c +++ b/drivers/net/i40e/i40e_ethdev.c @@ -2284,7 +2284,6 @@ i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, /* Get stats from i40e_eth_stats struct */ for (i = 0; i < I40E_NB_ETH_XSTATS; i++) { - xstats[count].name[0] = '\0'; xstats[count].id = count; xstats[count].value = *(uint64_t *)(((char *)&hw_stats->eth) + rte_i40e_stats_strings[i].offset); @@ -2293,7 +2292,6 @@ i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, /* Get individiual stats from i40e_hw_port struct */ for (i = 0; i < I40E_NB_HW_PORT_XSTATS; i++) { - xstats[count].name[0] = '\0'; xstats[count].id = count; xstats[count].value = *(uint64_t *)(((char *)hw_stats) + rte_i40e_hw_port_strings[i].offset); @@ -2302,7 +2300,6 @@ i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, for (i = 0; i < I40E_NB_RXQ_PRIO_XSTATS; i++) { for (prio = 0; prio < 8; prio++) { - xstats[count].name[0] = '\0'; xstats[count].id = count; xstats[count].value = *(uint64_t *)(((char *)hw_stats) + @@ -2314,7 +2311,6 @@ i40e_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, for (i = 0; i < I40E_NB_TXQ_PRIO_XSTATS; i++) { for (prio = 0; prio < 8; prio++) { - xstats[count].name[0] = '\0'; xstats[count].id = count; xstats[count].value = *(uint64_t *)(((char *)hw_stats) + diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c index c3301c5..ad6238d 100644 --- a/drivers/net/i40e/i40e_ethdev_vf.c +++ b/drivers/net/i40e/i40e_ethdev_vf.c @@ -1022,7 +1022,6 @@ static int i40evf_dev_xstats_get(struct rte_eth_dev *dev, /* loop over xstats array and values from pstats */ for (i = 0; i < I40EVF_NB_XSTATS; i++) { - xstats[i].name[0] = '\0'; xstats[i].id = i; xstats[i].value = *(uint64_t *)(((char *)pstats) + rte_i40evf_stats_strings[i].offset); diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index bb5940b..4c121ba 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -2808,7 +2808,6 @@ ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, count = 0; for (i = 0; i < IXGBE_NB_HW_STATS; i++) { xstats[count].id = count; - xstats[count].name[0] = '\0'; xstats[count].value = *(uint64_t *)(((char *)hw_stats) + rte_ixgbe_stats_strings[i].offset); count++; @@ -2818,7 +2817,6 @@ ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, for (stat = 0; stat < IXGBE_NB_RXQ_PRIO_STATS; stat++) { for (i = 0; i < IXGBE_NB_RXQ_PRIO_VALUES; i++) { xstats[count].id = count; - xstats[count].name[0] = '\0'; xstats[count].value = *(uint64_t *)(((char *)hw_stats) + rte_ixgbe_rxq_strings[stat].offset + (sizeof(uint64_t) * i)); @@ -2830,7 +2828,6 @@ ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, for (stat = 0; stat < IXGBE_NB_TXQ_PRIO_STATS; stat++) { for (i = 0; i < IXGBE_NB_TXQ_PRIO_VALUES; i++) { xstats[count].id = count; - xstats[count].name[0] = '\0'; xstats[count].value = *(uint64_t *)(((char *)hw_stats) + rte_ixgbe_txq_strings[stat].offset + (sizeof(uint64_t) * i)); diff --git a/drivers/net/virtio/virtio_ethdev.c b/drivers/net/virtio/virtio_ethdev.c index 9d549de..bfd3748 100644 --- a/drivers/net/virtio/virtio_ethdev.c +++ b/drivers/net/virtio/virtio_ethdev.c @@ -780,7 +780,6 @@ virtio_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, unsigned t; for (t = 0; t < VIRTIO_NB_Q_XSTATS; t++) { - xstats[count].name[0] = '\0'; xstats[count].id = count; xstats[count].value = *(uint64_t *)(((char *)rxvq) + rte_virtio_q_stat_strings[t].offset); @@ -797,7 +796,6 @@ virtio_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats, unsigned t; for (t = 0; t < VIRTIO_NB_Q_XSTATS; t++) { - xstats[count].name[0] = '\0'; xstats[count].id = count; xstats[count].value = *(uint64_t *)(((char *)txvq) + rte_virtio_q_stat_strings[t].offset); diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c index 86fb0bc..0a533e6 100644 --- a/lib/librte_ether/rte_ethdev.c +++ b/lib/librte_ether/rte_ethdev.c @@ -1627,7 +1627,6 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats, stats_ptr = RTE_PTR_ADD(ð_stats, rte_stats_strings[i].offset); val = *stats_ptr; - xstats[count].name[0] = '\0'; xstats[count].id = count + xcount; xstats[count++].value = val; } @@ -1639,7 +1638,6 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats, rte_rxq_stats_strings[i].offset + q * sizeof(uint64_t)); val = *stats_ptr; - xstats[count].name[0] = '\0'; xstats[count].id = count + xcount; xstats[count++].value = val; } @@ -1652,7 +1650,6 @@ rte_eth_xstats_get(uint8_t port_id, struct rte_eth_xstats *xstats, rte_txq_stats_strings[i].offset + q * sizeof(uint64_t)); val = *stats_ptr; - xstats[count].name[0] = '\0'; xstats[count].id = count + xcount; xstats[count++].value = val; } diff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h index d663d60..a82794d 100644 --- a/lib/librte_ether/rte_ethdev.h +++ b/lib/librte_ether/rte_ethdev.h @@ -915,8 +915,6 @@ struct rte_eth_txq_info { * structure. */ struct rte_eth_xstats { - /* FIXME: Remove name[] once remaining drivers converted */ - char name[RTE_ETH_XSTATS_NAME_SIZE]; uint64_t id; uint64_t value; }; -- 2.5.5