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 C08E0A0C43; Thu, 16 Sep 2021 11:36:22 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 45DC540151; Thu, 16 Sep 2021 11:36:22 +0200 (CEST) Received: from shelob.oktetlabs.ru (shelob.oktetlabs.ru [91.220.146.113]) by mails.dpdk.org (Postfix) with ESMTP id 400284003F for ; Thu, 16 Sep 2021 11:36:21 +0200 (CEST) Received: from [192.168.38.17] (aros.oktetlabs.ru [192.168.38.17]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by shelob.oktetlabs.ru (Postfix) with ESMTPSA id 8D1127F4FE; Thu, 16 Sep 2021 12:36:20 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 shelob.oktetlabs.ru 8D1127F4FE DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=oktetlabs.ru; s=default; t=1631784980; bh=zhR4kHQMe+cLoAztI7oR68MM4c9HfHCHAQwbIXsOOtA=; h=Subject:To:Cc:References:From:Date:In-Reply-To; b=AnT327ziYgwYn1STSvcNAtDEvXgvCgiaOVKjQZwT3dceXNzDAO1OwmgShiDnIwYoT dh7TDRl6iDpDfB/Xt0wKtZ8o/m6TGRDc9rMQ4THTPEX3ANkpZUzWe1RA17WqDH1Z0S OZImc8u3Rsolwb4dsGy5BqHliwGQI+CfIdbbzX/o= To: Thomas Monjalon , Cristian Dumitrescu Cc: dev@dpdk.org, Ferruh Yigit , Ori Kam References: <20210915210444.3126008-1-thomas@monjalon.net> <6302489.YdC8p3pGMF@thomas> From: Andrew Rybchenko Organization: OKTET Labs Message-ID: <6ea12281-d4cf-96d5-07a1-9c151421923e@oktetlabs.ru> Date: Thu, 16 Sep 2021 12:36:20 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <6302489.YdC8p3pGMF@thomas> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] ethdev: replace bit shifts with macros 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 Sender: "dev" On 9/16/21 11:55 AM, Thomas Monjalon wrote: > 16/09/2021 08:52, Andrew Rybchenko: >> On 9/16/21 12:04 AM, Thomas Monjalon wrote: >>> The macros RTE_BIT32 and RTE_BIT64 are used to replace bit shifts. >>> The macro UINT64C is also used to replace remaining occurrences of ULL. >>> >>> Only bit shifts of ETH_RSS_LEVEL_* are kept for aesthetic reason. >>> >>> Signed-off-by: Thomas Monjalon >> >> Good cleanup, many thanks. >> >>> diff --git a/lib/ethdev/rte_mtr.h b/lib/ethdev/rte_mtr.h >>> index dc246dd7af..babc9968d0 100644 >>> --- a/lib/ethdev/rte_mtr.h >>> +++ b/lib/ethdev/rte_mtr.h >>> @@ -60,28 +60,28 @@ extern "C" { >>> */ >>> enum rte_mtr_stats_type { >>> /** Number of packets passed as green by the policer. */ >>> - RTE_MTR_STATS_N_PKTS_GREEN = 1 << 0, >>> + RTE_MTR_STATS_N_PKTS_GREEN = RTE_BIT64(0), >> >> I think it is a bad idea to initialize enum members to >> uint64_t value. > > Yes probably. > The targets are 64-bit wide so there is an inconsistency in the API I think. > Yes, I agree. That's why I dislike usage of enums for definition of mask bits.