[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHS8izOdh7iWbhosGmsffG09=to2JYJ-aQGOS6vuRqe1f6gdUQ@mail.gmail.com>
Date: Thu, 3 Oct 2024 18:42:43 -0700
From: Mina Almasry <almasrymina@...gle.com>
To: Stanislav Fomichev <stfomichev@...il.com>
Cc: Stanislav Fomichev <sdf@...ichev.me>, netdev@...r.kernel.org, davem@...emloft.net,
edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com
Subject: Re: [PATCH net-next v2 02/12] selftests: ncdevmem: Separate out
dmabuf provider
On Thu, Oct 3, 2024 at 3:08 PM Stanislav Fomichev <stfomichev@...il.com> wrote:
>
> > > @@ -464,14 +515,11 @@ int do_server(void)
> > > void run_devmem_tests(void)
> > > {
> > > struct netdev_queue_id *queues;
> > > - int devfd, memfd, buf;
> > > + struct memory_buffer *mem;
> > > struct ynl_sock *ys;
> > > - size_t dmabuf_size;
> > > size_t i = 0;
> > >
> > > - dmabuf_size = getpagesize() * NUM_PAGES;
> > > -
> > > - create_udmabuf(&devfd, &memfd, &buf, dmabuf_size);
> > > + mem = provider->alloc(getpagesize() * NUM_PAGES);
> > >
> >
> > There is some weirdness here where run_devmem_tests() allocates its
> > own provider, but do_server() uses a provider allocated in main(). Any
> > reason these are not symmetric? I would marginally prefer do_server()
> > to allocate its own provider just like run_devmem_tests(), or at least
> > make them both match, if possible.
>
> I wanted to keep them separate in case we end up adding more to
> the selftest part. For example, not sure what would happen now if we pass
> a udmabuf with just one page? Do we need some test for the drivers
> to make sure they handle this case?
The size of the udmabuf (or more generically, any dmabuf) is the
address space for the page pool; if the dmabuf is too small, like 1
page, the rest of the pp allocations will return -ENOMEM.
--
Thanks,
Mina
Powered by blists - more mailing lists