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 2F56A41D9C; Tue, 28 Feb 2023 13:12:49 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 113DB40EE4; Tue, 28 Feb 2023 13:12:49 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id C954D4021F for ; Tue, 28 Feb 2023 13:12:46 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1677586366; x=1709122366; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=Dp8uOvaCu/Qg6Og0REAtLKOCzCGkFl3kiFQjglxwjMk=; b=S6vi5VSZhHObrM6REGgyVfEDrS0dKJsSV86RgLb/ewmYRAqPGfLAG5xC +DCqabOlzniF+n+uraWhXB++cedcx5S4p/9MdSl8rw8QTqJ/SPvD6hJ1K ndmUrkj20qfjvVDBTahLtwd7+WObXkOvN2nA0oVJ6qsZy0Ccw3GGe82mG C+EvPnv7UHE9e0R38kz2vVmJMZ5J+ONxVudQS/iNQDlZopsesCpF1XbQM bTs5BIdwRMTtxlTXaeCsqhVlBZLTzpZcOS4qS92R9IGlJ31OIk5+r+6Il YIqvEXWbixiYNJRyFtrU4IrFytE9TuBsS7qsM5GSGl/BPQ1Ofjk+fCeaC g==; X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="396688392" X-IronPort-AV: E=Sophos;i="5.98,221,1673942400"; d="scan'208";a="396688392" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Feb 2023 04:12:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10634"; a="783812081" X-IronPort-AV: E=Sophos;i="5.98,221,1673942400"; d="scan'208";a="783812081" Received: from orsmsx602.amr.corp.intel.com ([10.22.229.15]) by fmsmga002.fm.intel.com with ESMTP; 28 Feb 2023 04:12:45 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX602.amr.corp.intel.com (10.22.229.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 28 Feb 2023 04:12:44 -0800 Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Tue, 28 Feb 2023 04:12:44 -0800 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (104.47.58.169) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Tue, 28 Feb 2023 04:12:44 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cKXgN/J44+oLpIWpuQdWLRBzPrgL9hD6wIFl/1LyLTqYglKIbwyosXqrH25ewthusJ0q5VFwH1A11z7MD5f3E87N0EijUwTtTNDms00mQlmuNVuIFQDjgf9z234Cg/KQlwudl3NafSJMtvLBl4yRdu2asM8Q2Lnm2aGMzOE/NeCoS9eADJUHaSmcHJR4zMgQh3K5Hr2f4CjJIKbiTxRCz9UZPQMhMMTJ9kIpnmorhks1gWalReHJxc3g8zdGaJ2c1Oz/ulkuweYQPyckctJE6GrUB8PcysniI7qfq0ZF0v82U1fzx5o0O6EuclDa30tWTEKA8B1QoZm22j708bjNkQ== 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=SjJj4yoItSoIFmW0KCZDdJxfQGHuB87HuSaej+06Og8=; b=hsHsokxU3Zw+pc1C51C9sOShM66FBK0OHU2GfIP7OBc3T1+PnwxNMgfqE7f9lEz3KSRmJs9n9BEBbpqimcymzy7Sd7lYvASOEtEQ0Vws9vrAh3TdUay6CgJ8KW4FSEMCPqXTZcGhixdOICD+jaOpdgewlbrsJKyMg5KgiaABl3HMk29r0q3aWEAUtCYgiLehv2jcyFBKyR38Qf2Hxm74v8dfW4F7RicJdIN60irvpQ1qUv00Ynfbof8weywb7HKJ8Uqr7Sj19sy/t/nLlWn6uYHJvXFlo+6FIyNIRyfHUbI1B7CtgKYY9u8kzDY0m5i6HuUGxlNi/HpOyDMl5UrH3Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by MN0PR11MB6254.namprd11.prod.outlook.com (2603:10b6:208:3c5::17) 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 12:12:42 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::18d0:ac53:aa1d:d19c]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::18d0:ac53:aa1d:d19c%9]) with mapi id 15.20.6134.030; Tue, 28 Feb 2023 12:12:42 +0000 Date: Tue, 28 Feb 2023 12:12:35 +0000 From: Bruce Richardson To: Ferruh Yigit CC: "Liu, Mingxia" , "dev@dpdk.org" , "Xing, Beilei" , "Zhang, Yuying" , "Wu, Jingjing" Subject: Re: [PATCH v7 18/21] net/cpfl: add HW statistics Message-ID: References: <20230213021956.2953088-1-mingxia.liu@intel.com> <20230216003010.3439881-1-mingxia.liu@intel.com> <20230216003010.3439881-19-mingxia.liu@intel.com> <7450f46b-fc91-8a1e-c9f7-90ff1ca56d8e@amd.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: LO3P123CA0018.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:ba::23) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|MN0PR11MB6254:EE_ X-MS-Office365-Filtering-Correlation-Id: 864de42d-baaf-4c86-1ee4-08db1985177d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QlZFDRMi8t+sfiOzNfxtiY67hrrXar7e5622AQ5jVU3aNcjT/JVM80yoEqhS6H45BEeJB8LAzKXSCNOoA/R4gjugf07M90rt7pqqjRWw6iJesRwCLer6iZHK90gbcWP1tfYkaP/Hx/NklAMQTm1E6JNo86xKHL+/gslIoxYuoc6LlJsogLUdSe+e/lsqMs5CODn73m9c7gfsgHFoPfZpC/1QmsaPrFCzIlJ7ViqQaI0EjA+t8eCYn2B4nlqQkdu/zlNniNNygbJMlIJ8xKujujI+xOqYN02cgvZ7zcPKvEn/94ZDCIQeDiKxgyXCUpQP+R3izZPVlr+ersTtr0Aym0QNmi6q+f2DE6aaO/HlV+tiTFwnHeL1ADKHGhm1BrHYP2gjn1UKWAOs301j4hMvUnIxDpTvg+o23+lV82gXtIJduYE/DqOSnrzqJgrtr7DWhQ8Lks4vT+RuWbHZTXuPKRiHhNmdvdy4W1cebqs+GSbq4gBIOZM8jySxvPxTDD/9XVHH7203CwKqI9Fc0ZVa2H311g2MlPwb4G+QRNVgObYrs9sIhqf0ftZWc22x7tbqTR0wrQXnmGy1ABWlLcOBtWB2d8XnY5cIdR0eoxXqF48bhWJAUu/0LyYwn01CRlv4wYB3go3AA/ttPvHzQXBTNQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(396003)(346002)(376002)(366004)(39860400002)(136003)(451199018)(8936002)(8676002)(5660300002)(44832011)(41300700001)(38100700002)(82960400001)(4326008)(6916009)(6506007)(66556008)(66476007)(53546011)(6666004)(316002)(6512007)(2906002)(186003)(26005)(107886003)(54906003)(66946007)(83380400001)(6486002)(86362001)(478600001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?BDBmZsoNGU326XCweTOUtjORbi9n1BFcngToNxLbEe+OZT6xvIkp7MV+h764?= =?us-ascii?Q?Zv4s80iahsIG061o19vi9ZxFslfv9mc2wkD2Bqe6CtnphsuIPteXV4bhTgwm?= =?us-ascii?Q?SZEKdzcpP2EEYs78leWXSSh6JCpQ7GcQTOcjx9/6qCZby9bv4PIu1NIKbS62?= =?us-ascii?Q?XDHnE00+l6NJH4eI5AQsby0U+gXZdnbsyRteUkS84aUV+h0ZZ/g6cShbFQZK?= =?us-ascii?Q?9IYBnB3/Iff5Hp/mEEqSE8gmfPXRqzWJtzCh0x1ivisHgSLgEcsh85rlklWP?= =?us-ascii?Q?AQAvzzBJva7IRNuL0wSkEt+8+p3c9UgskKAUb5WVE5tFSz6d/SStI+jNYm41?= =?us-ascii?Q?PNhYCDJ+8oexpQM0WWvbVa2bPIJoWfLRA8aAFSAIRSMoz8vKbjCSiHmA5Y0I?= =?us-ascii?Q?FbFA4V1iDEqAXbRpbhXV1EN+/awURrvATF3vcjeqaXijQuR+bkKWx+lCXzMB?= =?us-ascii?Q?Y/Y3R55UIltC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d9c/?= =?us-ascii?Q?tnJWw/Ux1Gz1awLNRvMHwg7ch6msDlcqkGVkwoOngwxhsLeZdvVnTdD5V9rp?= =?us-ascii?Q?f1858PzRpctDL2T/PfpX4dNNsllvnnQ8cIWQKCSkb0s95mPOWnti/Qin23o7?= =?us-ascii?Q?dp3T9Y5rgEgtfh2qHukVyylANoKy/6DzwInjanyWbnl0cyDaj87c+a4Mzuva?= =?us-ascii?Q?xv5gnaNP1v8HiBUWrCoNk2N5oKHOmSAWY8nt7kZpFaEUATw0ul57evMbTXw0?= =?us-ascii?Q?xQ=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 864de42d-baaf-4c86-1ee4-08db1985177d X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Feb 2023 12:12:42.1574 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: m+73Y8T7eRP15UKeO0+v+CGFKnfGyc60OQocuTzZvlwMPHiXwAc6Er7XCf2YtiXKOdofhzXL9JWDyVhIiAKapaXeistzTIgMVMd93/LuE2Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN0PR11MB6254 X-OriginatorOrg: intel.com 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 Tue, Feb 28, 2023 at 12:04:53PM +0000, Ferruh Yigit wrote: > On 2/28/2023 11:47 AM, Liu, Mingxia wrote: > > Comment moved down, please don't top post, it makes very hard to follow > discussion. > > >> -----Original Message----- From: Ferruh Yigit > >> Sent: Tuesday, February 28, 2023 6:02 PM To: Liu, Mingxia > >> ; dev@dpdk.org; Xing, Beilei > >> ; Zhang, Yuying > >> Subject: Re: [PATCH v7 18/21] net/cpfl: add HW statistics > >> > >> 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. > >> > > OK, got it. > > > > As our previous design did have flaws. And if we don't want to affect > > correctness of telemetry, we have to redesign the idpf common module > > code, which means a lot of work to do, so can we lower the priority of > > this issue? > > > I don't believe this is urgent, can you but a one line limitation to the > documentation for now, and fix it later? > > And for the fix, updating 'dev->data->rx_mbuf_alloc_failed' where ever > 'rxq->rx_stats.mbuf_alloc_failed' updated is easy, although you may need > to store 'dev->data' in rxq struct for this. > > But, I think it is also fair to question the assumption telemetry has > that 'rx_mbuf_alloc_fail' is always available data, and consider moving > it to the 'eth_dev_handle_port_stats()' handler. +Bruce for comment. > That's not really a telemetry assumption, it's one from the stats, structure. Telemetry just outputs the contents of data reported by ethdev stats, and rx_nombuf is just one of those fields. /Bruce