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 1B4D6423B0; Wed, 11 Jan 2023 15:01:18 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E5A0F40E25; Wed, 11 Jan 2023 15:01:17 +0100 (CET) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id 7693A40A7D for ; Wed, 11 Jan 2023 15:01:16 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673445676; x=1704981676; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=eQk7ojU2e5LIdkwJq565AQDwbT14gLF2dv3nxldsad4=; b=Tzingm75/4oOzRjZ56Z9GMqZ6Nq+7hJ3vVZ9N+yb/IItXTZ9nefGuSYi +w1wvnEnYMlUVhdI+ZtJDs9kQXNWEYM/f6T4ZPHQ+UJ3C7LZsWQ4clbgF KSXP7rStV4STINOeUqWKwJFG3YM6R0HXz41cWWM3RLrQvu3O56VhmYfp1 TJZBaa71INEvaK3oXmHQ9Tnco3wgV5kG3HGv3EdBDnFiAM58vQMLU5qGk 3GpKcX99IcPvGjR17/veoHjgo2WQqNCK5ZQXt0f/wKwMMfGw0z3mRzvCU cseJFEQUK/ksyyL3XH2cJN6g45PJ7q0Gpy3D+KE/ZKuZ+o7l4SSShA/l5 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="350646076" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="350646076" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jan 2023 06:01:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10586"; a="725931954" X-IronPort-AV: E=Sophos;i="5.96,317,1665471600"; d="scan'208";a="725931954" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga004.fm.intel.com with ESMTP; 11 Jan 2023 06:01:15 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 11 Jan 2023 06:01:14 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) 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.16; Wed, 11 Jan 2023 06:01:14 -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.16 via Frontend Transport; Wed, 11 Jan 2023 06:01:14 -0800 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.101) 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; Wed, 11 Jan 2023 06:01:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=jFCL6kgw63bI2YOvRVRKD22fobCJHTwfZdcYI+inkWmf7X9/HUOV8MHxWZ3+ybRs8IAL+cRZ0o2SxmacHaH5sY63F8o0gRrOJKOq8AHYFoGPMlUEfVLrXJLAlOcgXuR+X8FoMuOPhRt4IsKnFAf/fpkuLn4ay/kDyUsL7/fUU8U3iVKc1MbepLlb2G2AorsapoDWAKt+1VVX5DW8LY6DdNCUhSqOx/DUa1tNyBZuiG5bfn+QQT1BAhSA9AUfxqWKOVsH+qdAXj24bgNxXLvwuu9Tk0owls/LGMroz0Z4dI4ceXKO0rA5LUsqB1RN9otId/kFuSZmmL2HLK/9karnJg== 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=VGQqYUVJJ1/FTcnzuOAuDNpcyU3c67vL1kcLOcM2z30=; b=oKruVfbvDn0o5ZY3MRUbFGrcovP0hOGNtPAApWFt9rXUJ4vxtnCJ/c1TxXwmBKjEqW4NmFDbAkQ6pSGKBRqQoes04IflvwUn5sco2tTS8q3NnjcdAPs9sflUolkdfj8SIgM+8N1cfjUyzeundYjvIHEWLvNLIZEGkyTwR2a6SOy158ve2VHdIc/yycugKafHrXiYCVLjfuUi3aF/2qsGW2OL4qFfJ2f3YPPB+M2utdufITplfRjFbWCYtH4IrK6t2YZJBWCr3ipQ70woMalNzyvYzBhozENKE2rztMuSGKGJyQhHeWTuSioSCJvd1Mzy5I9Z0O0Ar3m1RLvUtFZPgA== 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 CH3PR11MB8238.namprd11.prod.outlook.com (2603:10b6:610:155::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6002.13; Wed, 11 Jan 2023 14:01:11 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee%8]) with mapi id 15.20.5986.018; Wed, 11 Jan 2023 14:01:11 +0000 Date: Wed, 11 Jan 2023 14:01:04 +0000 From: Bruce Richardson To: Chengwen Feng CC: , , , , , Subject: Re: [PATCH v2 2/5] telemetry: fix repeat display when callback don't set dict Message-ID: References: <20221219090723.29356-1-fengchengwen@huawei.com> <20230111120630.31172-1-fengchengwen@huawei.com> <20230111120630.31172-3-fengchengwen@huawei.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20230111120630.31172-3-fengchengwen@huawei.com> X-ClientProxiedBy: LO4P265CA0227.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:315::13) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|CH3PR11MB8238:EE_ X-MS-Office365-Filtering-Correlation-Id: 2098a5fd-0f3b-4b1b-b748-08daf3dc4b64 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: GFx3dVVmpHb+hfBmyYqWjThJIVyhmrFhQ9wgj5sskugAkcHgeYaETdWFs2D9JKpRDe3Y+D0Atux4lzfRXCrcQx3Uialx3juQ46rK5W0SgEn9cC4HJEylkSIwWLOqZU3NAJwn7Qr+4Dxf8DdiHSFNSQFIOzaGxOsDtWvul5B83Tpyda4y6N2p8GVYrSofdSHL0JaWbJRELZuBG4UWesbbwGPVgfb5ntuEaxHvy+feTt7cMbjurdY0LhfPvDo+DH+GwQLWnZaHuIZIlitDACKYKhCep4sfF3Ba04KD3ou237BEvl6yAEeHiTgGCQAOK5W9veTTI9EUZdA7Efm2KPqjqciSkM5VpMLgmvg7Ou+zUPIhDAAB2lLtAGd7hxzjnKnhkGdGL+ZC+/WE+lJhAmXgMTntzhsqma13mBp2Sb+vF0KPxbDmU1u5LJhkTPXsABHays6Z3sF2wAlGne9wXtAPMwRGy/D4t8ySNQNDMjEU3cxG2gsB0LS5z5+2an0qqPaVTbTRoS0+Go0VhEdSwZlm/MJr/MiESUQdy+67oVNsfIFp+Os5WPO0go8UIsLnX5NZhvi+lGjcb6gxi0e4vAvcsXfEdrD6lnm7sERAqwT3tpDzzwNGCXFO9UTCDnTO3fwmnhvMUHw60NcdI/Vby68eAw== 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:(13230022)(346002)(39860400002)(396003)(136003)(376002)(366004)(451199015)(107886003)(6666004)(6506007)(2906002)(8676002)(4326008)(6916009)(5660300002)(8936002)(44832011)(83380400001)(38100700002)(6512007)(82960400001)(478600001)(41300700001)(6486002)(26005)(66556008)(66476007)(66946007)(186003)(86362001)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?yVhbwBJESGh1zvaHesbAyHuLLJJSfVS2IR2DxpszlNp2vXaSAAhEfIX/e4L2?= =?us-ascii?Q?A+zVw6XVnUOdhpyECcdYfeRzbEG0/M4bIqXu0uW9P0gb1ROpuWUPmCbVsRpE?= =?us-ascii?Q?UZA3ySQluzIWByNckrXVhSDHJ1T6U701eO+vPQyTFgT0goZIbO5uw0/LVj17?= =?us-ascii?Q?eqMPMddv5hXlIR3hKdmtEKpqt0Ozn9pjf9Unkaz+plpiACb09cAPJlPuNVoe?= =?us-ascii?Q?b6OsiNNPdMI7LnpmvoXMu2VInPxEW1SGHE+eSi8jLtettfHoRwVCheXoky0H?= =?us-ascii?Q?BHeQAdTeZN1Irp6ToeQZNLbJ3lIs4WLfuRLKUOik/9A8qzgFlOBiQMATiaI7?= =?us-ascii?Q?TBs1Q5symPG+IcBpTEjxInjQgMfFcDpv9KEXHu3vJAFYNC1yMXbL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aZMCcad/HY+ufT2Ba/JtQ+gOJHIUwMSfJao?= =?us-ascii?Q?DkgWX4a786PNGmBFCTM4NJqsIPnNNZHaNT3O93FVqECqTRNa4EisoK6pwb64?= =?us-ascii?Q?gpBkERphFo6j/8MPHRQc6SZckYQNTz0x5Oe1jMAvX7JTkVnpzgF7rw7CSb2W?= =?us-ascii?Q?KnC6qYIThz0neGnKmHXgHEby7hmT0jjaCyxGvVGdFng29E83CvQj+Sss+UQO?= =?us-ascii?Q?th7mW2xHYEonmFPFfxZlEULAKtfdtK/86znApuwqHZPQxxoSvhnohgBspFIo?= =?us-ascii?Q?j1lWiU6JuTOux7gV+aQMQ2rjVkgMLyPAifdqj/j0rgqDR+GD9lfV/Pu2Xasp?= =?us-ascii?Q?UA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 2098a5fd-0f3b-4b1b-b748-08daf3dc4b64 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Jan 2023 14:01:11.2093 (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: EhRJxs+hTqFOeG/QK/vUvSABKoTABvj2rguPAXx538eCh9GwUg2kIzRIiYT9d8P2cWWInfoZoxLHCwICoR5qy2RGWEr+PxfxDMiuhtu6Ut0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR11MB8238 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 Wed, Jan 11, 2023 at 12:06:27PM +0000, Chengwen Feng wrote: > When telemetry callback didn't set dict and return a non-negative I'd suggest rewording the "didn't set dict", since it's not required that a telemetry callback do anything with dictionaries. I'd suggest: "When a telemetry callback doesn't initialize the telemetry data structure and returns a non-negative number..." > number, the telemetry will repeat to display the last result. This > patch zero the dict to avoid the problem. s/zero the dict/zero the data-structure/ > > Fixes: 6dd571fd07c3 ("telemetry: introduce new functionality") > Cc: stable@dpdk.org > > Signed-off-by: Chengwen Feng > --- Reviewed-by: Bruce Richardson > lib/telemetry/telemetry.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c > index 8fbb4f3060..7b905355cd 100644 > --- a/lib/telemetry/telemetry.c > +++ b/lib/telemetry/telemetry.c > @@ -333,7 +333,7 @@ output_json(const char *cmd, const struct rte_tel_data *d, int s) > static void > perform_command(telemetry_cb fn, const char *cmd, const char *param, int s) > { > - struct rte_tel_data data; > + struct rte_tel_data data = {0}; > > int ret = fn(cmd, param, &data); > if (ret < 0) { > -- > 2.17.1 >