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 B3DDB41C71; Sun, 19 Feb 2023 01:31:17 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A57D74161A; Sun, 19 Feb 2023 01:31:17 +0100 (CET) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by mails.dpdk.org (Postfix) with ESMTP id 7100340698 for ; Sun, 19 Feb 2023 01:31:16 +0100 (CET) Received: by mail-wm1-f49.google.com with SMTP id o14so1243594wms.5 for ; Sat, 18 Feb 2023 16:31:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ojw7brShlqANtZJeX6MdADa/SSElLS2NWyiU7zyQG+Y=; b=TB+50PqVmWcUMwB4Bki6728FkKakyXgdje/brnRcVXQLPfb6Wx68Y9ShdNmlPzKp/F Fc6nTORdeQhAPPXRWiDOBC2M5bQEgwmoP18eFg7WyVpQJ8x4lRpwaJa+kDd9WLqFPU18 46bh7mQso7GzoJoReLx5Vcm2E7yZ0i//n/cPred52Hy5t+vU9wYQlYn1HtuY3EoaZsLc iI4AJKuF/ZVBF+GCDtHcJVVwSppfrQZR/cJLzAxSDLeN3UKuOwnaGP1gX7dwMeJUzILa Bd8l1uls3eustUEsV4pN4dhL4hI7cbBWiCT1Z4zjHOJ8gN31JE6/6ckNXz8uaJV/KRy1 OKjQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ojw7brShlqANtZJeX6MdADa/SSElLS2NWyiU7zyQG+Y=; b=zZ70EDK8nYUTEyiQJTiJ83gyaZK9vo2cCyVN4h+ThttL9K8TBvsI2q3edYCW2bv+fG Ra3bnIUYgJt7XekHhyjdz4dtVCHFPWncsgFKrCk+OpicQd0LdI6lXi5NrVeTdam4Wb9j q9msv0ogz3iZKOoQXpb3wkC6yjKLHq446b1edh9CwqcN6tTT6xDydTv3w8uHM9RDgByY T92Aw+6MobjAAzSSMPEj5g2j1ZXB5SiaH47emFOVAW9OQBjbFg/VwkxMhH0clceSFF6J hKmDvIwghgUyZT97znrMKdwlwbESvLAw+kQO5aN3Pvvn7fG3aQh7PCKWyt10IhcQY3RE nX/g== X-Gm-Message-State: AO0yUKW4JGDd+xLmAtKxBwSsqZJ+hAtkh//EYzhUhMmur9LgNCTbK59g ndFY2DY0rtUglZNr/R/uvG38WTuxdDs= X-Google-Smtp-Source: AK7set/wD4PnKI8TUuAAmL3B7sK0DX+dT6mEoATYq81mfwLFre8H/IdNjHchuGrFpLY7pcTE/FpDaQ== X-Received: by 2002:a05:600c:4d98:b0:3e2:bf1:9eb0 with SMTP id v24-20020a05600c4d9800b003e20bf19eb0mr8083849wmp.9.1676766675986; Sat, 18 Feb 2023 16:31:15 -0800 (PST) Received: from localhost.localdomain ([176.41.28.141]) by smtp.gmail.com with ESMTPSA id b13-20020a05600010cd00b002c54d970fd8sm1107924wrx.36.2023.02.18.16.31.15 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sat, 18 Feb 2023 16:31:15 -0800 (PST) From: Levend Sayar To: junfeng.guo@intel.com Cc: dev@dpdk.org, Levend Sayar Subject: [PATCH] net/gve: add Rx/Tx queue statistics Date: Sun, 19 Feb 2023 03:31:11 +0300 Message-Id: <20230219003111.85508-1-levendsayar@gmail.com> X-Mailer: git-send-email 2.37.1 (Apple Git-137.1) MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 Google Virtual NIC PMD is enriched with rx/tx queue statistics info. Signed-off-by: Levend Sayar --- drivers/net/gve/gve_ethdev.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c index fef2458a16..2a6cb11da3 100644 --- a/drivers/net/gve/gve_ethdev.c +++ b/drivers/net/gve/gve_ethdev.c @@ -213,6 +213,7 @@ gve_dev_start(struct rte_eth_dev *dev) } } + dev->data->dev_flags |= RTE_ETH_DEV_AUTOFILL_QUEUE_XSTATS; dev->data->dev_started = 1; gve_link_update(dev, 0); @@ -331,6 +332,9 @@ gve_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->opackets += txq->packets; stats->obytes += txq->bytes; stats->oerrors += txq->errors; + + stats->q_opackets[i] = txq->packets; + stats->q_obytes[i] = txq->bytes; } for (i = 0; i < dev->data->nb_rx_queues; i++) { @@ -342,6 +346,10 @@ gve_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats) stats->ibytes += rxq->bytes; stats->ierrors += rxq->errors; stats->rx_nombuf += rxq->no_mbufs; + + stats->q_ipackets[i] = rxq->packets; + stats->q_ibytes[i] = rxq->bytes; + stats->q_errors[i] = rxq->errors; } return 0; -- 2.37.1 (Apple Git-137.1)