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 BED86A0C4B; Fri, 15 Oct 2021 11:25:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id ABC3A410F1; Fri, 15 Oct 2021 11:25:46 +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 357AF40041 for ; Fri, 15 Oct 2021 11:25:45 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634289944; 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=++rwra7alzYWIEBnd32T++fWURqJD3oUCKiZo9sxaEs=; b=VsU9Dsi6DQtQh9LuM1dAiD90Rtrr9YGDdPTOhGvFftvs9iuyHFsPysy16jpJm/mUHDTYe6 oZzyrjrVfDxrzXOVH+8q9OI+rNiCGYMKzbwE9HaC7uMKS9RiPMvYrGVvogFjL77OC1q1kW fLrXY4Z+0WVQgRySM+O4Cc2W9wtZYm8= Received: from mail-lf1-f72.google.com (mail-lf1-f72.google.com [209.85.167.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-510-HhuoaUfHMBq_FzmGHDRoLA-1; Fri, 15 Oct 2021 05:25:43 -0400 X-MC-Unique: HhuoaUfHMBq_FzmGHDRoLA-1 Received: by mail-lf1-f72.google.com with SMTP id bp4-20020a056512158400b003fd96a37f3bso6243395lfb.21 for ; Fri, 15 Oct 2021 02:25:43 -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=++rwra7alzYWIEBnd32T++fWURqJD3oUCKiZo9sxaEs=; b=l2yWV+OqSDdbdeRjjhA0LIFEe45jN6tWKC/NNtefFpzUfzELvByR0Ofhp/8yXPVKH+ qJoFoTx2I7lgLdhaEpP0I8D1zsFxe/hJqE0SueokV/4Spu2Su2zorJTYpP4CwGEWUY/l fJ8DE5A547MU2xOMGTRTcfG4HbFEbpXnyb3vfYWYhFA67VghY3davJZjSOAina6es5Dz +Rq2hwP7fTpV5cLWwQXhVQ4a7x+HqjpKodR8W5zLdsfOVwCLbbCc3XU4jq8/V1HEhyOl O+7T8SCXc0WO6X4wFn2Xd3TiJmLUjnJgmq1Bf+JJl9GiEbv5kKEu4IFWbmvBOnsN6qZO rAXA== X-Gm-Message-State: AOAM532YxBrdJfJTOI2biMCJxMkazDkzImh7YjWKP0tmmI0BQQUdje5f UeVXbUhiWaPlIQnYT8z/Hkjl6pTx7arXWEAZJuZ4Bga/ahoxVXueOfOsygvs/1R/FY912p1g7nk LvCHzRr0hg3AN4rLbh5E= X-Received: by 2002:a05:6512:202a:: with SMTP id s10mr9849335lfs.560.1634289941859; Fri, 15 Oct 2021 02:25:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKKsgQ3xbsVn7y8XQFFqfia9zd/6+nBfsOTQV++QoSw9kfFaQNqCOpt2YmApxyDQqc30gWZUcH6T7tl5OfKgY= X-Received: by 2002:a05:6512:202a:: with SMTP id s10mr9849321lfs.560.1634289941640; Fri, 15 Oct 2021 02:25:41 -0700 (PDT) MIME-Version: 1.0 References: <20211012000409.2751908-1-dkozlyuk@nvidia.com> <20211013110131.2909604-1-dkozlyuk@nvidia.com> <20211013110131.2909604-3-dkozlyuk@nvidia.com> In-Reply-To: <20211013110131.2909604-3-dkozlyuk@nvidia.com> From: David Marchand Date: Fri, 15 Oct 2021 11:25:30 +0200 Message-ID: To: Dmitry Kozlyuk Cc: dev , Andrew Rybchenko , Matan Azrad , Olivier Matz 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 v4 2/4] mempool: add non-IO flag 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" Hello Dmitry, On Wed, Oct 13, 2021 at 1:02 PM Dmitry Kozlyuk wrote: > diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h > index 663123042f..029b62a650 100644 > --- a/lib/mempool/rte_mempool.h > +++ b/lib/mempool/rte_mempool.h > @@ -262,6 +262,8 @@ struct rte_mempool { > #define MEMPOOL_F_SC_GET 0x0008 /**< Default get is "single-consumer".*/ > #define MEMPOOL_F_POOL_CREATED 0x0010 /**< Internal: pool is created. */ > #define MEMPOOL_F_NO_IOVA_CONTIG 0x0020 /**< Don't need IOVA contiguous objs. */ > +#define MEMPOOL_F_NON_IO 0x0040 > + /**< Internal: pool is not usable for device IO (DMA). */ > > /** > * @internal When debug is enabled, store some statistics. > @@ -991,6 +993,9 @@ typedef void (rte_mempool_ctor_t)(struct rte_mempool *, void *); > * "single-consumer". Otherwise, it is "multi-consumers". > * - MEMPOOL_F_NO_IOVA_CONTIG: If set, allocated objects won't > * necessarily be contiguous in IO memory. > + * - MEMPOOL_F_NON_IO: If set, the mempool is considered to be > + * never used for device IO, i.e. for DMA operations. > + * It's a hint to other components and does not affect the mempool behavior. > * @return > * The pointer to the new allocated mempool, on success. NULL on error > * with rte_errno set appropriately. Possible rte_errno values include: - When rebasing on main, you probably won't be able to call this new flag. The diff should be something like: diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c index d886f4800c..35c80291fa 100644 --- a/app/test/test_mempool.c +++ b/app/test/test_mempool.c @@ -214,7 +214,7 @@ static int test_mempool_creation_with_unknown_flag(void) MEMPOOL_ELT_SIZE, 0, 0, NULL, NULL, NULL, NULL, - SOCKET_ID_ANY, MEMPOOL_F_NO_IOVA_CONTIG << 1); + SOCKET_ID_ANY, MEMPOOL_F_NON_IO << 1); if (mp_cov != NULL) { rte_mempool_free(mp_cov); diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c index 8d5f99f7e7..27d197fe86 100644 --- a/lib/mempool/rte_mempool.c +++ b/lib/mempool/rte_mempool.c @@ -802,6 +802,7 @@ rte_mempool_cache_free(struct rte_mempool_cache *cache) | MEMPOOL_F_SC_GET \ | MEMPOOL_F_POOL_CREATED \ | MEMPOOL_F_NO_IOVA_CONTIG \ + | MEMPOOL_F_NON_IO \ ) /* create an empty mempool */ struct rte_mempool * - While grepping, I noticed that proc-info also dumps mempool flags. This could be something to enhance, maybe amending current rte_mempool_dump() and having this tool use it. But for now, can you update this tool too? -- David Marchand