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 95638A0C4E; Fri, 15 Oct 2021 14:11:49 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2D107411CB; Fri, 15 Oct 2021 14:11:49 +0200 (CEST) Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mails.dpdk.org (Postfix) with ESMTP id 307DC410F1 for ; Fri, 15 Oct 2021 14:11:48 +0200 (CEST) Received: by mail-wr1-f44.google.com with SMTP id v17so26077958wrv.9 for ; Fri, 15 Oct 2021 05:11: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:content-transfer-encoding:in-reply-to; bh=FX8XURkpEPnmHrP9Eq1j9rBzNYHJKfTndPB8oazuAVg=; b=CJMOxey0wFbjse+2cL4AfXRXQ4yws9x2E5JvE5NPcGzjKFCLWxXqgmooQfwn7dkt8n bP1CVrsjluBH3hd7rjPGHKCmb7r9qaQRKY3/o4dLWSeW4ct9I2cdIinrgE3kwlkuUt8N 5VHptW5NOCNy6v6kf0lryy23S7W+QmgFwlExAbNTXDHDEUEGLbsgs47yke+D6K8MB6Z0 /PowvhTCD6FVQY3T+hcAC740sZf/5WoIeS4fWpFtFzwHbtTglEU/HgtAzdaZjP1tB6f7 Q6Io9BfF6GLBS2zMdOCSfRHlL1plCp0N0EzFYCb4725OpBh8G6Nl1zdBYSLaAsYMpY3f FoWA== 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:content-transfer-encoding :in-reply-to; bh=FX8XURkpEPnmHrP9Eq1j9rBzNYHJKfTndPB8oazuAVg=; b=hQyUPU83QlyvXWtV/WpDbZDvlBxyM1HqmigHYGKOI98Qw6T52XzoIXmZtDQETJuMZj MFaBrHx+rL6ViPcGfSBM9zR6p/N+5xtTN1mYBoKVf9XOC0sIhI6MPrO0sMglOzhiYMTq d+5G08Q9KE6I4j0jLd0vuc2GCQU1WyjgCVG6fNiRalZTZfDmdGvgIX/p8ejL3RPnsKJJ yazkbjVv0tDmKqJrv7liqS9BMjjztOO4IRcV8+uf3HBYnYQ5KgC+NdNmyW9RA/UarMo8 7lIhn3MARua16NUsFHO2calw76ahMdBRdHg9B5FgsWB0SpxD6TqSQsGVcJkIXuAIqSAa DjyA== X-Gm-Message-State: AOAM530drItdvKwVJKonwchyizXi6IaWnt4gndsGxaM0EHsMuUpJY2oo ji20Y6BZzf78LbQNXXft7mAdKA== X-Google-Smtp-Source: ABdhPJyvG9C8QJWvJuOrIYOQUfD5VolFxMTAmFPh1U3d6uOimox+epwrJD27VBL4VPgKIEbj/MCrAQ== X-Received: by 2002:adf:d1ee:: with SMTP id g14mr13863489wrd.264.1634299907902; Fri, 15 Oct 2021 05:11:47 -0700 (PDT) Received: from 6wind.com ([2a01:e0a:5ac:6460:c065:401d:87eb:9b25]) by smtp.gmail.com with ESMTPSA id 1sm10976602wmb.24.2021.10.15.05.11.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Oct 2021 05:11:47 -0700 (PDT) Date: Fri, 15 Oct 2021 14:11:46 +0200 From: Olivier Matz To: Dmitry Kozlyuk Cc: Andrew Rybchenko , "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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 09:58:49AM +0000, Dmitry Kozlyuk wrote: > > > > -----Original Message----- > > From: Olivier Matz > > Sent: 15 октября 2021 г. 12:43 > > To: Andrew Rybchenko > > Cc: Dmitry Kozlyuk ; dev@dpdk.org; Matan Azrad > > > > Subject: Re: [PATCH v4 2/4] mempool: add non-IO flag > > > > External email: Use caution opening links or attachments > > > > > > 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. > > The flag hints to components, PMDs before all, > that objects from this mempool will never be used for IO, > so that the component can save some memory mapping or DMA configuration. > If the flag is set when even a single object may be used for IO, > the consumer of the flag will not be ready for that. > Whatever a corner case it is, Andrew is correct. > There is a subtle difference between "pool is not usable" > (as described now) and "objects from this mempool will never be used" > (as stated above), I'll highlight it in the flag description. OK, agreed, thanks.