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 C825941D93; Mon, 27 Feb 2023 22:52:36 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id B9750410EE; Mon, 27 Feb 2023 22:52:36 +0100 (CET) Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2042.outbound.protection.outlook.com [40.107.243.42]) by mails.dpdk.org (Postfix) with ESMTP id 8680A40A7D for ; Mon, 27 Feb 2023 22:52:35 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RLcCoKL0ct8FAdxemlZB8IwkDkPGX9KJXnCfz+jwldObqbrnwcQ5LNKQjdb6m5aXl68l/eWi5KT+hPYUGJtHeXflusCPvKZPqkDGwHWUIsVuj7NOFSZzoiz/xyD7E8tfwMz35lLUx0s9WGlKxdrqUP46cG4sKgCzNSzdp+sIbBPrhTsHxMF8wWxQ6n1lAHSgVlJiARfiUlQrlAnlSk0gYPEG4lqq53uDh5eTKgBbfIXluXAGcm6izpLIX5scDQN2A3sgxa0oKeEinaFzGvGf4Ycn6fwY7AWE843cwYCZaO4v/UngbwA294JJB2HePZcDhvEqQEppXqpJT33Xw4vI1w== 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=Is3yhY9jfyYdrTO5HSvMrui3ZAzJIiC3FE0Ft+85meY=; b=De7igMZPOiSEZKhLOAVKzBr6Ie14YR6ndE3MTWYR6wHTdhf8tnzTvvDexNlPwx+weds7urHBlHRelHQuG6y/1Td9/GMi98R8bQsQZpQtbD/JxLatymzYdLP1S6w1p/H8lGf8T0Bl5ODrWPkOnasO61ydztJht2dLayX+XRCcpmywvW4C7uEnJrSYk///vNY8elzMLZNHjfyDVROeY8WU9alaGM4mAh3FeYqUM4Mx+wywdOB7EVjwoWMTW1EHwtS5RY81TCYyK6a54xRJIEjoMXNUy2E/VxnOMhAEVqIuO2UC6hnkBJ6dphkPPX1FlssM+ai9tKeFY+sYQ19Y8EHwbA== 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=Is3yhY9jfyYdrTO5HSvMrui3ZAzJIiC3FE0Ft+85meY=; b=WxpgxKvKujq1pMeqTFVT0Sd9urLlGA9Pl7+eM/TYS8Mp4MsywH4ywrj4rLt2KLP/XKQONKLfhP/CqRiLJgywFXt3GSg6GebjoUDGrRzCJAkx9fQ1COXWO4fFr+Rar3PxK2ybQthg1hZFXrgay0y67MvzqrZkXIsVmv3HgU5n+uc= 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 SJ0PR12MB7006.namprd12.prod.outlook.com (2603:10b6:a03:486::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6134.21; Mon, 27 Feb 2023 21:52:33 +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.029; Mon, 27 Feb 2023 21:52:33 +0000 Message-ID: Date: Mon, 27 Feb 2023 21:52:28 +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: Mingxia Liu , dev@dpdk.org, beilei.xing@intel.com, yuying.zhang@intel.com 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: <20230216003010.3439881-19-mingxia.liu@intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0230.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:315::6) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|SJ0PR12MB7006:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d906a3f-d791-499f-fc50-08db190cee8f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ufQyB9Caey/wiQCaUl3s5KZVb1H/w6Os/hrwmBdx/lOC7DyfiEdoBw8YP+h450s2MhyFi1MURSGvbi27y9ux9aLLbSEyCPUtUHQH+VUqORhKnspgCrDsRM2ZjVyBJM7eqw9M/KPgGvTixWopoIqNWn/nGWhuRIl/FtZ+6o52a0DVxOtTqMF50D+15C0G2fSGamQ1oI1iI5f6zNNWj+WAxYDoq4cuS6rcznaiVZVZqrn+vnhpCwLMujFn4fOxAqX1Z9NpZEFVABbQ3UakzFh1MneYhVHfNGT8PWFsTZTmnf2tCY+L/6HwUiBEUVFiXQInl3nP1O2cc0QzdH4BtsCoofxodaDJWYGuvElsAtfljBqwX9pen1doOri4q70KrRIz5cugAVIVEvECLpCLhycwZZUS7nBXbxXJVrvGI7PyERkQ+idkQKHdxXbN7+7i4JZ5XbNl2yGmhrxdQYcb5Y0+Z32Y8dglzkdUc/rAcGsHUivekD/KIxiyRIye2XbQbsTjKUGtonKX1wAL3sB6EbEJpnJJnl6/WxWMI2DsYYgHip5LjsZl0XjRz2UL43pfAZFto0m0TA7OvltZVkCy8+UccBn4GAyH329F7yjwT1gwvTxZ/8bWiRw/XWJru51ONhJWe/CChllGQEDOfQl3vaATeXzjhHnG7XGLKzSwBsjy2C8BNBDEO7G24nRu1UGMCpORBBKrVm4r0FiZE3seRbRDaHnTMsKlNjvqR6TMH0lcLAc= 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)(366004)(136003)(376002)(346002)(396003)(39860400002)(451199018)(86362001)(66946007)(6486002)(83380400001)(66556008)(5660300002)(6506007)(8676002)(66476007)(41300700001)(316002)(8936002)(2616005)(53546011)(478600001)(26005)(186003)(6666004)(6512007)(36756003)(2906002)(38100700002)(44832011)(31696002)(31686004)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?alZXQkU4NDBaaCtjMEx5bmV0SkVPQ2lDSEUrNGcwL2EyQTZDY3VvbVNZdGI2?= =?utf-8?B?bTRCNjlhK0dDZlRHZlhOZVJYNUlSRlE2RVBSeGd3N2M3NER2SU5DamNqSy9X?= =?utf-8?B?dHhVcTdRTzIrVnFwVGpvOHJvZUs5cDFtaHFDQ2VnVml1N0oxWEhZUlpFOHBH?= =?utf-8?B?dWVmcG5XR08xVUZFOHpGeXF0UGlKV0l6R0NZK0VEMVZMYWhGODZXNDJIbnQr?= =?utf-8?B?d0c4czFXNWhsS3hCTVp5U0dISFM1dVFWd1FHcktNQ25iVnd2YlNpc1FPYS9Z?= =?utf-8?B?bHQvb1czaXBIeElxcm9qZ2JRUFZsQmph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?= =?utf-8?Q?zHOrHQyZsz5Ry7XalhOjLVQ0m?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d906a3f-d791-499f-fc50-08db190cee8f X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2023 21:52:33.8116 (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: Nlax/qcmlITbzRDAfi9jJ/TV/rImLRIR514SW3vtVxq3VjqBmypo8QxhLiBiV7NV X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB7006 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/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').