From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2F363A00C2; Thu, 24 Nov 2022 17:59:30 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D14A142DCF; Thu, 24 Nov 2022 17:59:29 +0100 (CET) Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) by mails.dpdk.org (Postfix) with ESMTP id 8CBB042DBF for ; Thu, 24 Nov 2022 17:59:28 +0100 (CET) Received: by mail-pj1-f46.google.com with SMTP id g5so1783331pjd.4 for ; Thu, 24 Nov 2022 08:59:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20210112.gappssmtp.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ASiPXwwU4bTBJ2/CupNzHO5OTQoPQLFcGXAprBuBFwQ=; b=35CfdgFhEHPRgOuD/fL9sFLXt85TA/ertRRaFswXTGnFZyOBXG2suYAuQfr3f5XI7T a3prikei2Hdy6gORJm4ITGKJ3/vLAMJqOlCWW/LjcHmCF4dzOKgPkYkXDqgI0PxyT3eA JeD4ug85/4rO2g4nfW1olQsh1H9DZsSlknaqjvaC6gz5StaX32LJoZToaqLMf0Vad/SF XXpPvjLvMmropt7dtASBJ4pC4Fd2LUIhn8n/WMcer4+TjWADoChW69Ir3KA39/hi5O5q x6xEh8V1gnSYgjSeR0bV3kDdTdnVnsTs5ilrjsGYiQUSUB7dBTZqBJc96D4zNDZ6PdAo PGFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ASiPXwwU4bTBJ2/CupNzHO5OTQoPQLFcGXAprBuBFwQ=; b=a+70E06Vz83S0dKcFfCdKvqLYaOBL6tD+k/ZIloF26TjB/d5/mrtZSkWtjJAyJsKX+ oGuRW6zj09pFrMc2I4QDZAZVvVbHUF1xj4MoFZVHqPnH+ZVpCMYcaprGBTHMd06KvWv3 luqR5c05btENDB0osh0TpayGBsQ+MMuR8GsvKDr4AIuK9Y0TPNia6cKNDbUcdvQyMfwE OmjP/WHFSpJoQ2MX8HNBWBX5HZ8yOwGcZg/gDMyNFQqvskYFU+kYfHQ3Y0itIEqkNMVY 3HPHBVAFQ4TSZDhJWlu6Z2VQ3GbStIROdFe2NVYSdyaIDTzeexGK9W/0x+YTRA0YFJTN 2C5g== X-Gm-Message-State: ANoB5plcz/sXCKCzWm+91DRPmd+19Fme76bX3eTRIsrRXXXa+5M+hUsz Ak48iQ2OrgjofTlUYWLd7ERYzQ== X-Google-Smtp-Source: AA0mqf7CTcs1zGyxPAKb9fdW/FkSgMMVPlv4bawcKN+61mLTq6lpR1Rl8UmMMYO0q21qUrvh7UoWLg== X-Received: by 2002:a17:902:ea84:b0:189:4543:fb6b with SMTP id x4-20020a170902ea8400b001894543fb6bmr7531913plb.24.1669309167761; Thu, 24 Nov 2022 08:59:27 -0800 (PST) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id co7-20020a17090afe8700b00218cd71781csm1403250pjb.51.2022.11.24.08.59.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 24 Nov 2022 08:59:27 -0800 (PST) Date: Thu, 24 Nov 2022 08:59:26 -0800 From: Stephen Hemminger To: Junfeng Guo Cc: qi.z.zhang@intel.com, jingjing.wu@intel.com, ferruh.yigit@amd.com, beilei.xing@intel.com, dev@dpdk.org, jeroendb@google.com, rushilg@google.com, jrkim@google.com, Xiaoyun Li Subject: Re: [PATCH] net/gve: add support for basic stats Message-ID: <20221124085926.46430390@hermes.local> In-Reply-To: <20221124073335.3985214-1-junfeng.guo@intel.com> References: <20221124073335.3985214-1-junfeng.guo@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org On Thu, 24 Nov 2022 15:33:35 +0800 Junfeng Guo wrote: > +static int > +gve_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) > +{ > + uint16_t i; > + > + for (i = 0; i < dev->data->nb_tx_queues; i++) { > + struct gve_tx_queue *txq = dev->data->tx_queues[i]; > + if (txq == NULL) > + continue; > + > + stats->opackets += txq->packets; > + stats->obytes += txq->bytes; > + stats->oerrors += txq->errors; > + } > + > + for (i = 0; i < dev->data->nb_rx_queues; i++) { > + struct gve_rx_queue *rxq = dev->data->rx_queues[i]; > + if (rxq == NULL) > + continue; > + > + stats->ipackets += rxq->packets; > + stats->ibytes += rxq->bytes; > + stats->ierrors += rxq->errors; > + stats->rx_nombuf += rxq->no_mbufs; > + } > + > + return 0; > +} > + The driver should be filling in the per-queue stats as well. q_ipackets, q_opackets, q_ibytes, q_obytes, q_errors