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 AB0EA41D9B; Tue, 28 Feb 2023 11:02:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 8C7BE40EE4; Tue, 28 Feb 2023 11:02:33 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2056.outbound.protection.outlook.com [40.107.92.56]) by mails.dpdk.org (Postfix) with ESMTP id 4C3694021F for ; Tue, 28 Feb 2023 11:02:31 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xxo37vKn0pBEUJTpcLkBKYvdo4KA3uMAEYV1TuJofh38EJ1DtkAEXBGPOv3vcdHbvn/AoXrtb8GiTQLx7Xfwywfm4uEYEGVxdRl2U4xJEAB6gPYcCcAV29Bigae3IyF3WYjGOmuMxogoC7KgYe82P8eAYeGX/vUF5qWZx7TrwvEC3rJwyxcL97h9inNkAd8qeTU3OAuv9HZHigxR1hPJtqLaZqwB/XndQAwlZMQGp/pwNzUmItckR8TpjcrzL6iBZuRpl/p7jzLfOzDBG5UkyBoetldOHb5+0uYmMqA1Q5/r5iEcv5BFnihy8/OtPX68XHXr7mkX/og4aHUGh4U72A== 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=QCcXnJ5og7B3awGU1t779lqTl4ZCMtZb5jxDAIViOuQ=; b=FaAS0ThcHjLAWVfdcJSyuaT7DNZmDdPxTz3izSyoVst4I1oksqAcQGVnKs+oNvcpA5SqXLDJmgqp7mzH98/ojXMWfA5PVw5TSV0Vk5zVxjJruQ8qZ+kryh9OB19Ep6AnQTwMb3a5AMauSo/jgf94cbQgDmoekM8vZHMY4i46tclYHhFxIrzoQ8BznOvDw21RA0Rgxcv+mtwk6aKzqFqEo5kuflAWdd+5+lKlY6dwGym5gV1/ULITbzfHLvtdHxzrfg46igTkVqYhzfUlZwb2XmvxMwT5XqJ6rXDFhZgv57IjdYlEuvaStiaL8iLDF6pYCW6oUPKJg4s2LRONXIWtuQ== 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=QCcXnJ5og7B3awGU1t779lqTl4ZCMtZb5jxDAIViOuQ=; b=YLKqTRbis45CBCAzO/YUi/AlmUVsJ4pLXHgWyivCno8SaXEHfhp64t1b7YY/GRM0e0bZh10PY97GOk3rEdwUslJOxiE1nVcJtAfDWeLPbnmsOOm3OxeRbWirgPnkJ2Z+9AqfD0XA0DetU9vl9Fx/5a+Dbn9+MskmPvQX7hba7qs= 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 SN7PR12MB7420.namprd12.prod.outlook.com (2603:10b6:806:2a7::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.30; Tue, 28 Feb 2023 10:02:29 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%7]) with mapi id 15.20.6134.030; Tue, 28 Feb 2023 10:02:29 +0000 Message-ID: <7450f46b-fc91-8a1e-c9f7-90ff1ca56d8e@amd.com> Date: Tue, 28 Feb 2023 10:01:34 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Content-Language: en-US To: "Liu, Mingxia" , "dev@dpdk.org" , "Xing, Beilei" , "Zhang, Yuying" References: <20230213021956.2953088-1-mingxia.liu@intel.com> <20230216003010.3439881-1-mingxia.liu@intel.com> <20230216003010.3439881-19-mingxia.liu@intel.com> From: Ferruh Yigit Subject: Re: [PATCH v7 18/21] net/cpfl: add HW statistics In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO2P265CA0364.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a3::16) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SN7PR12MB7420:EE_ X-MS-Office365-Filtering-Correlation-Id: 40e23cc7-b242-471e-24f5-08db1972e6df X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: zTpMPB8/WoSKxJU3N0X+2o9iqVnP16/NiCsT5B0skOndNqGWJAxnjcBLxCsZpou+4AOyl9O+JTjUlv5QAjsXLBZ/KninplYKoIcsSV6dSICucq0L8kp+RMb1dhxGtyiinjb5rAwcGATaSvBxFOm9X6V9bUHoSUg5rZ0xSAVqQhwFb0qqUdVdjuOGYKARw7f65VnmDG0RA6zryEmCrg95vUOTMgU7BiuFSRt9hvyId5R/XsCZyIRpHHnDfLwG1JlVU1WiD93+YwrbNxNHUR5EEdq4mZxHCxslNyZITWcTwabAe6KYV057tbqNk48ObUi+z3Q2/v8l9jWmHXzVSBY9mRa1P9fzIIjwXx6YtB/EB/DqYw8PP+REvQZKViDQ7psBllRvN2AP1eZEXs/0HHfQEtWdGjkNx25mwELhBtMrWt4jLZzGt6QP8oRzXO6GMZkr9g5pgxDNJ41F3ktMKRhB/EtxIwJ6SRGew7nZ3qSKr4VFH6sET6xTitH3N4wLIy9LC/1LfUknaggBXZJ8ip8Fu1UgbuQoZQCIMlRVI7ouaA4TGntCDdfiC5I0H4Z7sdanugptZjO+LC7M4BqfuDA5SpBxU0PnU2NUhEAwf99RGCq5nBVVaVBldKjo/Hh+Udaq6oHveHaBabUJjRCryaSie+9K7Bw/DPx1esY0/rk9GNv+3e6MwOl8jKKbWgD2vvLg+YhdslHn/o7jxVwrWWmFzlNp/anZ+ykdbYud8/j5h+I= 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:(13230025)(4636009)(346002)(39860400002)(396003)(366004)(376002)(136003)(451199018)(31686004)(86362001)(36756003)(41300700001)(66476007)(66946007)(66556008)(5660300002)(8936002)(31696002)(8676002)(44832011)(2906002)(38100700002)(6666004)(6486002)(478600001)(316002)(83380400001)(110136005)(26005)(2616005)(53546011)(186003)(6506007)(6512007)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?YkdRaXZPbHZnS2ozSXVLbFc1RkxHZ1Q1T29aR2NVZ2M0dW9YRWFCdlRUS1N3?= =?utf-8?B?cW51VHZhUE5GMC94N05aaHNucUg2ak9RRDd4Y2NpVEkrdC92Zml5MWFWelZF?= =?utf-8?B?UncvL2lCSk1mamRhRUpHc0VsT3lLUmRGZXRSb3NyVHB4MHNhNWk0UGRoM0tJ?= =?utf-8?B?aFlBU2RucFJ3ZU1HYVpWUmhHQ2lyeGI4dEZ6cEQzTlZCek1vUnI1UlZmNVJV?= =?utf-8?B?NTA3a29paDFWRWNtbHkwRmZVSFIxbm9LT1VtM05YZ2dtenpTTVdpdUhueXNz?=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tMUzhDL0pzRE4zbVNVT2Y4bkFpSUtzSVRMOUU0cTJi?= =?utf-8?Q?8xfIOH0rbzkUXII8Zu8H+j0BR?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 40e23cc7-b242-471e-24f5-08db1972e6df X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2023 10:02:29.5294 (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: NVL1PUdBYibt0JAXvwNse/GtdrZlU7VdHZV6IFzhUxKDcVpJ/lVG3u2LB3AbPaDD X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR12MB7420 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 2/28/2023 6:46 AM, Liu, Mingxia wrote: > > >> -----Original Message----- >> From: Ferruh Yigit >> Sent: Tuesday, February 28, 2023 5:52 AM >> To: Liu, Mingxia ; dev@dpdk.org; Xing, Beilei >> ; Zhang, Yuying >> Subject: Re: [PATCH v7 18/21] net/cpfl: add HW statistics >> >> On 2/16/2023 12:30 AM, Mingxia Liu wrote: >>> This patch add hardware packets/bytes statistics. >>> >>> Signed-off-by: Mingxia Liu >> >> <...> >> >>> +static int >>> +cpfl_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats >>> +*stats) { >>> + struct idpf_vport *vport = >>> + (struct idpf_vport *)dev->data->dev_private; >>> + struct virtchnl2_vport_stats *pstats = NULL; >>> + int ret; >>> + >>> + ret = idpf_vc_stats_query(vport, &pstats); >>> + if (ret == 0) { >>> + uint8_t crc_stats_len = (dev->data- >>> dev_conf.rxmode.offloads & >>> + RTE_ETH_RX_OFFLOAD_KEEP_CRC) ? >> 0 : >>> + RTE_ETHER_CRC_LEN; >>> + >>> + idpf_vport_stats_update(&vport->eth_stats_offset, pstats); >>> + stats->ipackets = pstats->rx_unicast + pstats->rx_multicast + >>> + pstats->rx_broadcast - pstats->rx_discards; >>> + stats->opackets = pstats->tx_broadcast + pstats->tx_multicast >> + >>> + pstats->tx_unicast; >>> + stats->imissed = pstats->rx_discards; >>> + stats->oerrors = pstats->tx_errors + pstats->tx_discards; >>> + stats->ibytes = pstats->rx_bytes; >>> + stats->ibytes -= stats->ipackets * crc_stats_len; >>> + stats->obytes = pstats->tx_bytes; >>> + >>> + dev->data->rx_mbuf_alloc_failed = >>> +cpfl_get_mbuf_alloc_failed_stats(dev); >> >> 'dev->data->rx_mbuf_alloc_failed' is also used by telemetry, updating here >> only in stats_get() will make it wrong for telemetry. >> >> Is it possible to update 'dev->data->rx_mbuf_alloc_failed' whenever alloc >> failed? (alongside 'rxq->rx_stats.mbuf_alloc_failed'). > [Liu, Mingxia] As I know, rte_eth_dev_data is not a public structure provided to user, user need to access through rte_ethdev APIs. > Because we already put rx and tx burst func to common/idpf which has no dependcy with ethdev lib. If I update "dev->data->rx_mbuf_alloc_failed" > when allocate mbuf fails, it will break the design of our common/idpf interface to net/cpfl or net.idpf. > > And I didn't find any reference of 'dev->data->rx_mbuf_alloc_failed' in lib code. > Please check 'eth_dev_handle_port_info()' function. As I said this is used by telemetry, not directly exposed to the user. I got the design concern, perhaps you can put a brief limitation to the driver documentation.