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 0B6ACA0C43; Mon, 18 Oct 2021 14:07:07 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0516640141; Mon, 18 Oct 2021 14:07:06 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id A27F64003C for ; Mon, 18 Oct 2021 14:07:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634558824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=3Yl7+IHSdsfWdgLb9IA5/0KXS/pzGCHGiE8m7arhB10=; b=eGh7jLukwO1zl5uH8VJfIREIuWrNp/qP7Jr4f7p56gPf2hTVktLLFvv3w0b++35BjJF2st UAR25r9i0lChlcVAgoujUpjTDKSgnjJfdZasJihnvD/65DdJpaY21c3XmSHEtugTzeejBA //Uxc3Uj+v4vIc1dglv0CaTPivBK2T0= Received: from mail-lf1-f71.google.com (mail-lf1-f71.google.com [209.85.167.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-542-D7QQLo1RM72c_Z7p5TH84g-1; Mon, 18 Oct 2021 08:07:03 -0400 X-MC-Unique: D7QQLo1RM72c_Z7p5TH84g-1 Received: by mail-lf1-f71.google.com with SMTP id g10-20020a05651222ca00b003fda3f05c17so9902819lfu.11 for ; Mon, 18 Oct 2021 05:07:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3Yl7+IHSdsfWdgLb9IA5/0KXS/pzGCHGiE8m7arhB10=; b=bNOMHDtEM7fMNpJXHk7j1KaWhqibyr4awY4Ff4D15tyRCWERfFTgmZH+Rg/slhHaGG hfCxmtrESTiE+qD7KYeJI9zWGVsY38lF0Mrj/LtgneQjpCy/KUOAGhcxfj3R1QbZiepf 3GJhI4U+YZ9MavorHiSvFRefyoTtHJWPYfYbsX84KO9iFc8MwOmNK9C5QCAUvaNdZwEm kBTZwIMSYItYLQ/CtbX9bAUZbHLXcq/vT5JaACVT++wZwwpgtl+y3lYTyREm88k4jn+H XxptmSGiZTs/+zrJvSb7alsXPDnz7qph8bkFmV7c25pukQKOFCqKY+5siOCskSa4cuwR nTPw== X-Gm-Message-State: AOAM531cbfombA4bIScj/i/7dJybxk+LQ6trYxybFwuBF37VeIUIiiJL 9bVf5Rzks38TIXpTFKTXwY75Nl0xfiNQQcXcjeGc11i9pcpw3+BK4Kxc9SWZYvmb8F5wjrqXUGd 9UE3G51wKrdBgrsQwvmw= X-Received: by 2002:a2e:a54a:: with SMTP id e10mr15558337ljn.159.1634558821494; Mon, 18 Oct 2021 05:07:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzojsZBNeJ2A9ZyRwixZ+vmDax+0jM6Nt6XshGRfwTNATjvc9xhUrwfAXo/9iKViKiJgc8t2hRsfyvoatAaRbo= X-Received: by 2002:a2e:a54a:: with SMTP id e10mr15558301ljn.159.1634558821213; Mon, 18 Oct 2021 05:07:01 -0700 (PDT) MIME-Version: 1.0 References: <20211018082635.2054-1-david.marchand@redhat.com> <79f4f029-ca13-6048-396c-232fe5ef5fb7@oktetlabs.ru> <8d96bea0-abeb-090a-6589-62bd082bb7ca@oktetlabs.ru> In-Reply-To: <8d96bea0-abeb-090a-6589-62bd082bb7ca@oktetlabs.ru> From: David Marchand Date: Mon, 18 Oct 2021 14:06:49 +0200 Message-ID: To: Andrew Rybchenko , Thomas Monjalon Cc: Olivier Matz , Dmitry Kozlyuk , Ray Kinsella , Stephen Hemminger , dev Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" 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:05 AM Andrew Rybchenko wrote: > >>> +/** > >>> + * 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. > > > > I dreamed to finish with renanamings in core libraries in 2021. Sadly, you are not the only one. > May be it is to naive :( > > I see that rc1 is already delayed and adding a couple of > more patches could delay it even more. I'm ready to do it > without coccinelle today, so, it is a question to @Thomas and > @David if that late patch will be considered at all. Thomas? As usual, we must avoid unannounced API changes unless waived by Techboard. I am not against it if we keep compatilibity (marking RTE_DEPRECATED can wait next releases), and seeing how it only impacts a relatively low number of places in DPDK. Risks are mainly on compilation side, and conflicts with other patches in mempool for rc1, but I can only think of Dmitry series and the conflict is easy to solve. It should be quick to do: when could you send such a patch? What I have seen: $ git grep -iE "(define|inline).*\<(|__)mempool" -- lib/mempool/*.h lib/mempool/rte_mempool.h:#define MEMPOOL_PG_SHIFT_MAX (sizeof(uintptr_t) * CHAR_BIT - 1) lib/mempool/rte_mempool.h:#define MEMPOOL_PG_NUM_DEFAULT 1 ^^^ bit-rot, both can be dropped. lib/mempool/rte_mempool.h:#define MEMPOOL_F_NO_SPREAD 0x0001 lib/mempool/rte_mempool.h:#define MEMPOOL_F_NO_CACHE_ALIGN 0x0002 /**< Do not align objs on cache lines.*/ lib/mempool/rte_mempool.h:#define MEMPOOL_F_SP_PUT 0x0004 /**< Default put is "single-producer".*/ lib/mempool/rte_mempool.h:#define MEMPOOL_F_SC_GET 0x0008 /**< Default get is "single-consumer".*/ lib/mempool/rte_mempool.h:#define MEMPOOL_F_POOL_CREATED 0x0010 /**< Internal: pool is created. */ lib/mempool/rte_mempool.h:#define MEMPOOL_F_NO_IOVA_CONTIG 0x0020 /**< Don't need IOVA contiguous objs. */ lib/mempool/rte_mempool.h:#define MEMPOOL_VALID_USER_FLAGS (MEMPOOL_F_NO_SPREAD \ lib/mempool/rte_mempool.h:#define __MEMPOOL_STAT_ADD(mp, name, n) do { \ lib/mempool/rte_mempool.h:#define __MEMPOOL_STAT_ADD(mp, name, n) do {} while(0) lib/mempool/rte_mempool.h:#define MEMPOOL_HEADER_SIZE(mp, cs) \ lib/mempool/rte_mempool.h:static inline struct rte_mempool_objhdr *__mempool_get_header(void *obj) lib/mempool/rte_mempool.h:static inline struct rte_mempool_objtlr *__mempool_get_trailer(void *obj) lib/mempool/rte_mempool.h:#define __mempool_check_cookies(mp, obj_table_const, n, free) \ lib/mempool/rte_mempool.h:#define __mempool_check_cookies(mp, obj_table_const, n, free) do {} while(0) lib/mempool/rte_mempool.h:#define __mempool_contig_blocks_check_cookies(mp, first_obj_table_const, n, \ lib/mempool/rte_mempool.h:#define __mempool_contig_blocks_check_cookies(mp, first_obj_table_const, n, \ ^^ Internal stuff, but I would prefix in any case. lib/mempool/rte_mempool.h:#define MEMPOOL_REGISTER_OPS(ops) \ -- David Marchand