From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pb0-f54.google.com (mail-pb0-f54.google.com [209.85.160.54]) by dpdk.org (Postfix) with ESMTP id A552C58E8 for ; Fri, 13 Jun 2014 03:39:54 +0200 (CEST) Received: by mail-pb0-f54.google.com with SMTP id jt11so1601448pbb.41 for ; Thu, 12 Jun 2014 18:40:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=Fu4zcvsmAPY2rD2KxqXwg3o/5Lhk6fraYp9OkkIyy6c=; b=DLC7l5fz+A1yDkXp0m+oGf7H1Q2yGAfYhkV2e8TnTYXl05HYbzR2IoMYDDAtGnuoTG Cp64KHmMPfxOd6iUqs2+XpFMp7QTVccwtc4mX6jwQUy/VTQt3HPxZukYLEmqstPbYytB iTAAJB1kd5Sbk4SX9+fcwmtKJLSYyvd45yDur2dAbxLlpt2uOAQTLKBtK7JEtUTicuDp I2jpceVm/fu9tPvc4fLILp5giYWQ7Ucd9rYAbIRhRVgP8gyRgzVUo0jVkSXwNwaygvSS 1f39njiSPYiMRz0N9FzFX1HYmRQ8yRyJEinh0AzO4Y6OFgit0+6VWaVm/vE281PWPnoa lzSQ== X-Gm-Message-State: ALoCoQlhnjsFMx5caliX/HrOuBD7TIyWCdE0+tpuPdvOgOM+ykINI3fG5jrmqhDHOompvGk4yz/H X-Received: by 10.66.142.73 with SMTP id ru9mr25100402pab.41.1402623609523; Thu, 12 Jun 2014 18:40:09 -0700 (PDT) Received: from nehalam.linuxnetplumber.net (static-50-53-83-51.bvtn.or.frontiernet.net. [50.53.83.51]) by mx.google.com with ESMTPSA id iz2sm408030pbb.95.2014.06.12.18.40.08 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Thu, 12 Jun 2014 18:40:09 -0700 (PDT) Date: Thu, 12 Jun 2014 18:38:47 -0700 From: Stephen Hemminger To: Stephen Hemminger Message-ID: <20140612183847.189520c1@nehalam.linuxnetplumber.net> In-Reply-To: <20140612183656.08516008@nehalam.linuxnetplumber.net> References: <20140612183656.08516008@nehalam.linuxnetplumber.net> X-Mailer: Claws Mail 3.9.3 (GTK+ 2.24.23; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Cc: dev@dpdk.org Subject: [dpdk-dev] [PATCH 4/5] vmxnet3: add per-queue stats 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: Fri, 13 Jun 2014 01:39:55 -0000 Update per-queue statistics and add missing multicast into statistics. Also, no need to zero statistics since they are already cleared in rte_stats_get. Signed-off-by: Stephen Hemminger --- lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c | 60 +++++++++++++++++--------------- 1 file changed, 32 insertions(+), 28 deletions(-) --- a/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c 2014-06-12 18:12:14.987836818 -0700 +++ b/lib/librte_pmd_vmxnet3/vmxnet3_ethdev.c 2014-06-12 18:13:35.020257298 -0700 @@ -598,39 +598,43 @@ vmxnet3_dev_stats_get(struct rte_eth_dev VMXNET3_WRITE_BAR1_REG(hw, VMXNET3_REG_CMD, VMXNET3_CMD_GET_STATS); - stats->opackets = 0; - stats->obytes = 0; - stats->oerrors = 0; - stats->ipackets = 0; - stats->ibytes = 0; - stats->rx_nombuf = 0; - stats->ierrors = 0; - stats->imcasts = 0; - stats->fdirmatch = 0; - stats->fdirmiss = 0; - + RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_TX_QUEUES); for (i = 0; i < hw->num_tx_queues; i++) { - stats->opackets += hw->tqd_start[i].stats.ucastPktsTxOK + - hw->tqd_start[i].stats.mcastPktsTxOK + - hw->tqd_start[i].stats.bcastPktsTxOK; - stats->obytes += hw->tqd_start[i].stats.ucastBytesTxOK + - hw->tqd_start[i].stats.mcastBytesTxOK + - hw->tqd_start[i].stats.bcastBytesTxOK; - stats->oerrors += hw->tqd_start[i].stats.pktsTxError + - hw->tqd_start[i].stats.pktsTxDiscard; + struct UPT1_TxStats *txStats = &hw->tqd_start[i].stats; + + stats->q_opackets[i] = txStats->ucastPktsTxOK + + txStats->mcastPktsTxOK + + txStats->bcastPktsTxOK; + stats->q_obytes[i] = txStats->ucastBytesTxOK + + txStats->mcastBytesTxOK + + txStats->bcastBytesTxOK; + + stats->opackets += stats->q_opackets[i]; + stats->obytes += stats->q_obytes[i]; + stats->oerrors += txStats->pktsTxError + + txStats->pktsTxDiscard; } + RTE_BUILD_BUG_ON(RTE_ETHDEV_QUEUE_STAT_CNTRS < VMXNET3_MAX_RX_QUEUES); for (i = 0; i < hw->num_rx_queues; i++) { - stats->ipackets += hw->rqd_start[i].stats.ucastPktsRxOK + - hw->rqd_start[i].stats.mcastPktsRxOK + - hw->rqd_start[i].stats.bcastPktsRxOK; - stats->ibytes += hw->rqd_start[i].stats.ucastBytesRxOK + - hw->rqd_start[i].stats.mcastBytesRxOK + - hw->rqd_start[i].stats.bcastBytesRxOK; - stats->rx_nombuf += hw->rqd_start[i].stats.pktsRxOutOfBuf; - stats->ierrors += hw->rqd_start[i].stats.pktsRxError; - } + struct UPT1_RxStats *rxStats = &hw->rqd_start[i].stats; + stats->q_ipackets[i] = rxStats->ucastPktsRxOK + + rxStats->mcastPktsRxOK + + rxStats->bcastPktsRxOK; + + stats->q_ibytes[i] = rxStats->ucastBytesRxOK + + rxStats->mcastBytesRxOK + + rxStats->bcastBytesRxOK; + + stats->ipackets += stats->q_ipackets[i]; + stats->ibytes += stats->q_ibytes[i]; + + stats->q_errors[i] = rxStats->pktsRxError; + stats->ierrors += rxStats->pktsRxError; + stats->imcasts += rxStats->mcastPktsRxOK; + stats->rx_nombuf += rxStats->pktsRxOutOfBuf; + } } static void