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 38FC4A0C43; Mon, 18 Oct 2021 10:58:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D071940141; Mon, 18 Oct 2021 10:58:49 +0200 (CEST) Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) by mails.dpdk.org (Postfix) with ESMTP id B8DDD4003C for ; Mon, 18 Oct 2021 10:58:48 +0200 (CEST) Received: by mail-wm1-f54.google.com with SMTP id v127so8040651wme.5 for ; Mon, 18 Oct 2021 01:58:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ZnNlNP2oLRNNlK/qQM7Gpb4OIW3jHpqNc3jlRGBU9QQ=; b=boW1u926l6kfMi8RfZ0EDBrbixSPyzOkEIiwOyOonuisH8aokPxiXSQd6s5A1726ST RWgcSdtkyru/E1JuGlENr7xvs+AFQqPq2PttEW8BmOhJmaESbIvON7FoKfTbEJT+cRKW +wTSGsF4PZuWaniFBSrWJuckvh/oQ9LJHI7tWqkv0Gn5KDpsDgnUxk84xpfIie3qeq0e ZOFuNTwL030xWV40xiOYqFIdOJM/BdUEjF5wDluQCFTMK2YZhh5WOlN8ay6+ptFTjscH +y4Gwqo/HGkcmMkf8y6uxxxUvQ2WPYB6MpXP4K19RNENFHkIxA/PWODdtsmqAfM+Kvme xHfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZnNlNP2oLRNNlK/qQM7Gpb4OIW3jHpqNc3jlRGBU9QQ=; b=RWqg9m09w/V7crZct/6MIVl4sVie7V18SohMKD5fWugybQBrO8mBE0NlV+66aFCILm CGA90KYtFbWqpcVwTf6dhMOYwSzaGpGNNWaV1yG8a0mbgYwW0yyivQ9Hd7FoQRBsIjLF 2pCwqXfmAnGZ3GhDGOrC/8EVeN7AXDUsrNPpscQy96gUcWYCTkeMsE9Q65I5eoZ7tlqz g+zWH6mg9LjptLtjumZXqAK0HZBO6lc0Mkwl5k/Bw4MqVBm661/sOugmrA4/Yx+Nm4BL co7MLUx7AMvNjnMFZx4fk/2EdaOm5/RWHO9ewbijHZtzWFVDymCcy8ry2gISNxxCS4oz UaAQ== X-Gm-Message-State: AOAM53399HOQPYBBVr4QEzL1cbqc3eqJ9psX0H9MRpCJlfaxC6pe0pA2 XUEiCJQxY7kUKoEd7Y6FimorfQ== X-Google-Smtp-Source: ABdhPJw8AA9Oq/dmdFSWBTAleY9UHXp8y4FzUMHqEAW24/MvrcLmjgFy4ahmO67ndgLahtN8V9q+1Q== X-Received: by 2002:a05:600c:354d:: with SMTP id i13mr29234149wmq.189.1634547528419; Mon, 18 Oct 2021 01:58:48 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id f20sm976467wmq.38.2021.10.18.01.58.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Oct 2021 01:58:48 -0700 (PDT) Date: Mon, 18 Oct 2021 10:58:47 +0200 From: Olivier Matz To: Andrew Rybchenko Cc: David Marchand , Dmitry Kozlyuk , Ray Kinsella , Stephen Hemminger , dev@dpdk.org Message-ID: References: <20211018082635.2054-1-david.marchand@redhat.com> <79f4f029-ca13-6048-396c-232fe5ef5fb7@oktetlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <79f4f029-ca13-6048-396c-232fe5ef5fb7@oktetlabs.ru> Subject: Re: [dpdk-dev] [PATCH] mempool: accept user flags only 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 Mon, Oct 18, 2021 at 11:37:32AM +0300, Andrew Rybchenko wrote: > On 10/18/21 11:26 AM, David Marchand wrote: > > As reported by Dmitry, MEMPOOL_F_POOL_CREATED is a flag only manipulated > > internally. > > This flag is not supposed to be requested from an application and would > > probably result in an incorrect behavior if an application did pass it. > > > > Other internal flags may be introduced later. > > > > Rework the check and export a mask of valid user flags for use in the > > unit test. > > > > Fixes: b240af8b10f9 ("mempool: enforce valid flags at creation") > > > > Reported-by: Dmitry Kozlyuk > > Signed-off-by: David Marchand (...) > > --- a/lib/mempool/rte_mempool.h > > +++ b/lib/mempool/rte_mempool.h > > @@ -258,6 +258,15 @@ struct rte_mempool { > > #define MEMPOOL_F_POOL_CREATED 0x0010 /**< Internal: pool is created. */ > > #define MEMPOOL_F_NO_IOVA_CONTIG 0x0020 /**< Don't need IOVA contiguous objs. */ > > > > +/** > > + * This macro lists all the mempool flags an application may request. > > + */ > > +#define MEMPOOL_VALID_USER_FLAGS (MEMPOOL_F_NO_SPREAD \ > > I think RTE_ prefix is missing here since it is in a public > header now. I discussed about this offline with David. I was ok to omit the RTE_ prefix for consistency. > > + | MEMPOOL_F_NO_CACHE_ALIGN \ > > + | MEMPOOL_F_SP_PUT \ > > + | MEMPOOL_F_SC_GET \ > > + | MEMPOOL_F_NO_IOVA_CONTIG \ > > + ) > > /** > > * @internal When debug is enabled, store some statistics. > > * > > > > Should we make a patch to add defines with RTE_ prefix and > add a deprecation for old flags without RTE_ prefix? > > Olivier, what do you think? If you have time to care about it, > it would be great. (I'm unfamiliar with coccinelle yet). I was joking with David about keeping some work for 2022 :) I will try to have a look. As a side note, I was not that convinced by coccinelle for simple replacements like this, because it does not update the comments or documentation, it can (rarely) break the indentation, it is slow, and the syntax is quite complex.