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 00785A0543; Thu, 15 Dec 2022 19:02:33 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 996B740E50; Thu, 15 Dec 2022 19:02:33 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id ED48440695 for ; Thu, 15 Dec 2022 19:02:31 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 4748420B87E9; Thu, 15 Dec 2022 10:02:31 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4748420B87E9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1671127351; bh=ypSDl70sSJYfVZmABctLRMYrEEIsOYBDYl4z2xbBwJE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=oI9IinT9xwvXA+capRCh1iMGcC/d9CKOsrn/ZAoBPnXYvCORQpKSwJ5kbHo0qe5WO bxvsx3lpUDJCxL5wuU5dZMyICEylhPckUvIcW7LJAKLbB9ZtTX/JKo5uP/zzV7BLYb 2Gg8r1YuV+uij3wmjnnYmpRNMwMNm7FJSmOmvzR0= Date: Thu, 15 Dec 2022 10:02:31 -0800 From: Tyler Retzlaff To: Bruce Richardson Cc: "lihuisong (C)" , dev@dpdk.org, Morten =?iso-8859-1?Q?Br=F8rup?= Subject: Re: [RFC PATCH 2/7] telemetry: add uint type as alias for u64 Message-ID: <20221215180231.GD17591@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20221213182730.97065-1-bruce.richardson@intel.com> <20221213182730.97065-3-bruce.richardson@intel.com> <61b3f999-ec7d-9201-dcf3-cbdfbc0d705c@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) 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 Thu, Dec 15, 2022 at 09:42:40AM +0000, Bruce Richardson wrote: > On Thu, Dec 15, 2022 at 09:49:06AM +0800, lihuisong (C) wrote: > > > > 在 2022/12/14 2:27, Bruce Richardson 写道: > > > For future standardization on the "uint" name for unsigned values rather > > > than the existing "u64" one, we can for now: > > > * rename all internal values to use uint rather than u64 > > > * add new function names to alias the existing u64 ones > > > > > > Suggested-by: Morten Brørup > > > Signed-off-by: Bruce Richardson > > > --- > > > lib/telemetry/rte_telemetry.h | 36 ++++++++++++++++++++++++++++++++++ > > > lib/telemetry/telemetry.c | 16 +++++++-------- > > > lib/telemetry/telemetry_data.c | 28 ++++++++++++++++++-------- > > > lib/telemetry/telemetry_data.h | 4 ++-- > > > lib/telemetry/version.map | 7 +++++++ > > > 5 files changed, 73 insertions(+), 18 deletions(-) > > > > > > diff --git a/lib/telemetry/rte_telemetry.h b/lib/telemetry/rte_telemetry.h > > > index c2ad65effe..60877dae0a 100644 > > > --- a/lib/telemetry/rte_telemetry.h > > > +++ b/lib/telemetry/rte_telemetry.h > > > @@ -8,6 +8,8 @@ > > > #ifndef _RTE_TELEMETRY_H_ > > > #define _RTE_TELEMETRY_H_ > > > +#include > > > + > > > #ifdef __cplusplus > > > extern "C" { > > > #endif > > > @@ -121,6 +123,22 @@ int > > > rte_tel_data_add_array_int(struct rte_tel_data *d, int x); > > > /** > > > + * Add an unsigned value to an array. > > > + * The array must have been started by rte_tel_data_start_array() with > > > + * RTE_TEL_UINT_VAL as the type parameter. > > > + * > > > + * @param d > > > + * The data structure passed to the callback > > > + * @param x > > > + * The number to be returned in the array > > > + * @return > > > + * 0 on success, negative errno on error > > > + */ > > > +__rte_experimental > > > +int > > > +rte_tel_data_add_array_uint(struct rte_tel_data *d, uint64_t x); > > > + > > > + /** > > > * Add a uint64_t to an array. > > > * The array must have been started by rte_tel_data_start_array() with > > > * RTE_TEL_UINT_VAL as the type parameter. > > > @@ -193,6 +211,24 @@ int > > > rte_tel_data_add_dict_int(struct rte_tel_data *d, const char *name, int val); > > > /** > > > + * Add an unsigned value to a dictionary. > > > + * The dict must have been started by rte_tel_data_start_dict(). > > > + * > > > + * @param d > > > + * The data structure passed to the callback > > > + * @param name > > > + * The name the value is to be stored under in the dict > > > + * Must contain only alphanumeric characters or the symbols: '_' or '/' > > > + * @param val > > > + * The number to be stored in the dict > > > + * @return > > > + * 0 on success, negative errno on error, E2BIG on string truncation of name. > > > + */ > > > +int __rte_experimental > > __rte_experimental > > int > > > > Right? > > Yes, that is right. actually, it is consistent with how it is used in the rest of dpdk and most compilers accept it before the return type. but actually it applies to the symbol name. this is not an argument to change the existing pattern, just pointing it out the details.