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 CB084A00C4; Thu, 6 Oct 2022 16:26:04 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BA15A42C8E; Thu, 6 Oct 2022 16:26:04 +0200 (CEST) Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2049.outbound.protection.outlook.com [40.107.223.49]) by mails.dpdk.org (Postfix) with ESMTP id 6CD8642C66 for ; Thu, 6 Oct 2022 16:26:02 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dcN1yKe5j3pv+5HFKaXy6fTaZIRdL7GR6/7qxE6eKAkS7krogVMES9I2mQRKKXHuobzErmpTaYq1xbQfTLyRDzSwjS/LJmd/wzjUfSmZDpI1aQSqQG6DgB2h9OV7kg8tbAq223VHb12cmRRIOnmZc4ggH9DBF3oIrSlnlOXXzNwOtg90qwE+zPqO5+jynW1eFiIa/527IVlgIbabgYAP6jkHHgkILOsp4pwkv0QB+iUuZMAgCDtMu+YCihzkVRDTJL3tAjsLQ7XnjU7ZOGOEusDrjcFIoQis6+ydcr/lLWJoIWVHJU3pL1UkkbunEIQ//v54QfoPCeG2aH0TbGTOHg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=GJIWF0QZqWK9Svkr0E/no+poDT3POkLKxQY/85/626Q=; b=RsmGmM8b/8raYuQ6WkpvrYXSstTFM1LVYBRGExsUIVzeCSSvvH4gFKZv2U88HnsUK050fyDwUYOkRM17l0u9iioX1Cf2D6TIdK700LynpobXib19lee11CgijhsCNnzjK5gskVh1oNfpSYBrV5A+ZkFpOUj4ifu7gM8qICTHR1TQuxniPjkr8Ux5rfL0awXBczHt35gSX9hvpn9n3rIYXDfKZJoVocF/Q22AAC4dl9YXmdW4yrrivFP34eQnrb9wN7252wAcFGZeYyiFdQfKSSgJx//jRugLx8xDlmrI1pDT7g6Nc42COAg013BgtkGoi9z0j/dREIQKdsIm17dxbA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=GJIWF0QZqWK9Svkr0E/no+poDT3POkLKxQY/85/626Q=; b=QXYbxvyZ5QchmAIzMywPBd6IR7clsfIpYL9Ca+d48Jn0e2mIXG8Rbo3Io+pKzhIM6BpWPwAm4X3z4RgIyOobA9VYG0cpPy0ktkjxDW4ci7UkldWHDTYNp8BAENZoW9dxBARI2l0JFsn3yH4et4DW+EJcVAlmJRd5P2VYLmCUghI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by CY8PR12MB7243.namprd12.prod.outlook.com (2603:10b6:930:58::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5676.24; Thu, 6 Oct 2022 14:25:59 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::d07a:463f:6f93:337f]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::d07a:463f:6f93:337f%7]) with mapi id 15.20.5676.036; Thu, 6 Oct 2022 14:25:59 +0000 Message-ID: <673129b9-55e9-5ea2-f3b1-002ad8587ab3@amd.com> Date: Thu, 6 Oct 2022 15:25:52 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v4 9/9] net/gve: add support for stats Content-Language: en-US To: Junfeng Guo , qi.z.zhang@intel.com, jingjing.wu@intel.com Cc: ferruh.yigit@xilinx.com, dev@dpdk.org, xiaoyun.li@intel.com, awogbemila@google.com, bruce.richardson@intel.com, xueqin.lin@intel.com References: <20220923093829.3019525-2-junfeng.guo@intel.com> <20220927073255.1803892-1-junfeng.guo@intel.com> <20220927073255.1803892-10-junfeng.guo@intel.com> From: Ferruh Yigit In-Reply-To: <20220927073255.1803892-10-junfeng.guo@intel.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: PA7P264CA0116.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:34c::7) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|CY8PR12MB7243:EE_ X-MS-Office365-Filtering-Correlation-Id: 99d5ce3e-8e3a-4f94-ed3d-08daa7a6b048 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: e+OpbbKJBLXxW9ueAi/49CC4FDeC619hpqtCzZF/wOZxr5TaKHhE6hTfRXueo0cCUONkDcP4x1eUKbbjDF/ZNT4LxgYgk8AGS+xEf1NlyRMI/oQnbgLUzf/Qpfb4q91PeSWJg4C7lQF2AEgJPyoTdZpuXafWr5TbUJxcjCXp1z9zD92/X+hhcD0HcC8m3MGf/SJ36a7ZYhzx43lcBHNb3bXqD5MsR+VxxAOWFgQBqLc9Y4XCZtESvt8U5uD/cH5t3TjcfztaAvKseTTXAD40h5Kmt3Xnr9rE3ry79i7/AyumG+ip4cQeg6NJqbAAs+iI9Hm4PPtjIvCxK+sjTcsiYcjAjmV9VqilzmGNUNFrg78Q7L3M/fTLRB90hkLxZUqExlPOLSBdDWYDB3gWW5K/D9evbAbM/krsFUf4JCA9ryd0dGvsvPrimuIbdbGUyHJbZcW5bMV1zSjUCQZYozFrW+/6Qe+ZMs0E2zcOmDrtcvmmlOqQLq5eHuY168XJpmFeZ6HOrDkV0KgXjt57WBVa9M0wpQ3Ys445NPS3/1Fgi8hOMbGCdAzpiyOdj67a3nI/8BhQCazPF2J8c0QHKqoz8t9qYNGEbIuwSdkPAt43Me0wSJGTPVeu4zSacSf7SBtUi96hSkzRDgirETnX/hDrD27iv0NbjdO5VKK6VKXkicO7+OEfvMXWKKV8pUOc1rN7JLxjiNOhB+a6aW8yd666jHrjzqIWf4xigZZuyBTHjdHT+nOaD2knDrVMrqONkohg3byEMxAlqhyfhHn2gpsKtSAjtFX5CEcacpjFAQ4/L4q8+eStcm9K7CZRqYs6Dike X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(4636009)(39860400002)(376002)(366004)(136003)(346002)(396003)(451199015)(966005)(31696002)(478600001)(66946007)(4326008)(8676002)(66476007)(66556008)(6486002)(6666004)(41300700001)(36756003)(38100700002)(44832011)(316002)(6512007)(6506007)(83380400001)(53546011)(26005)(5660300002)(86362001)(8936002)(2906002)(186003)(2616005)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?a2pQNnNpSklLUUFxWkNoSWFXM09MankwK3BqNVl2bkhuYklKZGk4SWI1TGx2?= =?utf-8?B?MEd1SmZ3TVRSUEMzTzFmdFBTbmpuVlRZTTdPSmM1akRYQ1Jhd1FpMG1kd2Y1?= =?utf-8?B?Tnl3cTZGQUh1b240NWRzMlJPOWRKa25DNDJK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VUwM0EwY0ZPMllBL0lFL3V6dlJ2ZjRhTW5Ia0V4SEcxdXlO?= =?utf-8?B?TGZ6MHduc1BnbS9DQXRTQXNMYUozUHZmd1RuRFJkTW5GcURjU0prckZ2aTht?= =?utf-8?B?SGxyU1BSL3JYbEpEek13czM3NDVzcVpaa29VekF1SzVwaXJQWEdlblU4ZWoz?= =?utf-8?Q?iNo8DlkmAG3NUxgF4pjuPgaB8?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 99d5ce3e-8e3a-4f94-ed3d-08daa7a6b048 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Oct 2022 14:25:59.2356 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: s/t03eKQe/ankXmYU0RLmfFqObn02arVIkS5zfWDskyL1msrUZCIbYVLfy3Q8lmz X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY8PR12MB7243 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 9/27/2022 8:32 AM, Junfeng Guo wrote: > > Update stats add support of dev_ops stats_get/reset. > > Signed-off-by: Xiaoyun Li > Signed-off-by: Junfeng Guo > --- > doc/guides/nics/features/gve.ini | 2 + > drivers/net/gve/gve_ethdev.c | 71 ++++++++++++++++++++++++++++++++ > drivers/net/gve/gve_ethdev.h | 11 +++++ > drivers/net/gve/gve_rx.c | 15 ++++++- > drivers/net/gve/gve_tx.c | 13 ++++++ > 5 files changed, 110 insertions(+), 2 deletions(-) > > diff --git a/doc/guides/nics/features/gve.ini b/doc/guides/nics/features/gve.ini > index cdc46b08a3..180408aa80 100644 > --- a/doc/guides/nics/features/gve.ini > +++ b/doc/guides/nics/features/gve.ini > @@ -10,6 +10,8 @@ MTU update = Y > TSO = Y > RSS hash = Y > L4 checksum offload = Y > +Basic stats = Y > +Stats per queue = Y "stats per queue" is something else, agree that it is bad naming, please check features.rst file. > Linux = Y > x86-32 = Y > x86-64 = Y > diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c > index b9b8e51b02..cd474b8128 100644 > --- a/drivers/net/gve/gve_ethdev.c > +++ b/drivers/net/gve/gve_ethdev.c > @@ -328,6 +328,75 @@ gve_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info) > return 0; > } > > +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; > + > + if (i < RTE_ETHDEV_QUEUE_STAT_CNTRS) { > + stats->q_opackets[i] = txq->packets; > + stats->q_obytes[i] = txq->bytes; Queue stats update is moved to xstat [1], we are waiting existing PMDs to adopt it but for new drivers it is better to implement new method. Can you please either drop queue stats completely, or implement it via xstats? [1] https://elixir.bootlin.com/dpdk/v22.07/source/doc/guides/rel_notes/deprecation.rst#L118