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 65B26A0C4B; Fri, 15 Oct 2021 11:43:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBFFD410F1; Fri, 15 Oct 2021 11:43:24 +0200 (CEST) Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) by mails.dpdk.org (Postfix) with ESMTP id 4305F40692 for ; Fri, 15 Oct 2021 11:43:24 +0200 (CEST) Received: by mail-wm1-f46.google.com with SMTP id g198-20020a1c20cf000000b0030d60cd7fd6so1904097wmg.0 for ; Fri, 15 Oct 2021 02:43:24 -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=PkbfvHdD9CD33ATrZVbHhcve0T0o5YjFUdNtkN2IfcM=; b=EvgQ4iOqToaLfkOZo35k5R6GoFyRwZVWOpZaug9ngJy3TIEm0QUMGNmEpGiX8sbJTM aHCNgCcdfeJIIYGG0MY5NE/uLgQncCctdsNtMLstG6T04Nbq3U8geTK24s9FYoVbBQbD ZY1wEiBmdqMSGHEOR08XYbtewqIkD160oegUvNTOP+w0ma4+wnT64pxu4f7oJYoT5He0 JH2JCIXSYD9o8RAdvB3A+yecSQpp2vWJA126W8Q00WnjOZHaUvCi7i5Ss/EEfSX47HXr S2NYMg9tKW2Y/9oQ+yvfdL6ZrcQt13Iqj5I60fqdbE1jXpFBoc4CK3067DcK4Lb5fbxh hXNA== 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=PkbfvHdD9CD33ATrZVbHhcve0T0o5YjFUdNtkN2IfcM=; b=bDcN1kA9p6mCZSWA0eoK6QsBIrqWyQ1etEUMX2rJbmL8HkMUhqyDK1cuW2C0Jniij6 c/2dTBs3QHYRp2Ke0tJwIAUVw9FoOvxIoBngKl3KPR4G/EA78dItP2k0xHeaKOAhuT/L 2bKuIzuzpUygOUT1qILtNvzl2lGU/+yt4d7rd72Fee9ofR0yzn5+cYb32fBNNcb8th85 8nslSELwexbSh3iS6weXJ7IHNvVX68Ea5+FprXt9etj3cMeAJImcT+ZRgSo5qTeSR6eB GKY4GNvj7PFwg/tFM4QSTDKUJfE0+Y3FlRMOxUH4DoTkW27Ii+nkcRmM8u+y+3f6maGr eAWQ== X-Gm-Message-State: AOAM531zsUgnsfA5GsIraoQ8ixHN9kVPSk1+Q8Aa0RGvv9zOmEU/h+NW S/KqRWD2z6cjA/9hsBXg8gbLCQ== X-Google-Smtp-Source: ABdhPJz9FSENcHuHT/xmxz0gcUAvAw4/unRUUf+v1CjEINkiz170pxeDQz3eleVxjSQqV/beZ9+1hA== X-Received: by 2002:a05:600c:1989:: with SMTP id t9mr11105190wmq.48.1634291004020; Fri, 15 Oct 2021 02:43:24 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id p3sm10327686wmp.43.2021.10.15.02.43.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 02:43:23 -0700 (PDT) Date: Fri, 15 Oct 2021 11:43:22 +0200 From: Olivier Matz To: Andrew Rybchenko Cc: Dmitry Kozlyuk , "dev@dpdk.org" , Matan Azrad Message-ID: References: <20211012000409.2751908-1-dkozlyuk@nvidia.com> <20211013110131.2909604-1-dkozlyuk@nvidia.com> <20211013110131.2909604-3-dkozlyuk@nvidia.com> <7fe50e1d-e4d8-8c92-56fd-13d5b5e413f8@oktetlabs.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7fe50e1d-e4d8-8c92-56fd-13d5b5e413f8@oktetlabs.ru> 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" On Fri, Oct 15, 2021 at 12:33:31PM +0300, Andrew Rybchenko wrote: > On 10/15/21 12:18 PM, Dmitry Kozlyuk wrote: > >> -----Original Message----- > >> From: Andrew Rybchenko > >> [...] > >>> diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c > >>> index 51c0ba2931..2204f140b3 100644 > >>> --- a/lib/mempool/rte_mempool.c > >>> +++ b/lib/mempool/rte_mempool.c > >>> @@ -371,6 +371,8 @@ rte_mempool_populate_iova(struct rte_mempool *mp, > >>> char *vaddr, > >>> > >>> STAILQ_INSERT_TAIL(&mp->mem_list, memhdr, next); > >>> mp->nb_mem_chunks++; > >>> + if (iova == RTE_BAD_IOVA) > >>> + mp->flags |= MEMPOOL_F_NON_IO; > >> > >> As I understand rte_mempool_populate_iova() may be called few times for > >> one mempool. The flag must be set if all invocations are done with > >> RTE_BAD_IOVA. So, it should be set by default and just removed when iova > >> != RTE_BAD_IOVA happens. > > > > I don't agree at all. If any object of the pool is unsuitable for IO, > > the pool cannot be considered suitable for IO. So if there's a single > > invocation with RTE_BAD_IOVA, the flag must be set forever. > > If so, some objects may be used for IO, some cannot be used. > What should happen if an application allocates an object > which is suitable for IO and try to use it this way? If the application can predict if the allocated object is usable for IO before allocating it, I would be surprised to have it used for IO. I agree with Dmitry here.