Re: [PATCH bpf-next v2 08/10] xsk: Support UMEM chunk_size > PAGE_SIZE

From: Magnus Karlsson
Date: Tue Apr 04 2023 - 08:54:26 EST


On Tue, 4 Apr 2023 at 14:32, Kal Cutter Conley <kal.conley@xxxxxxxxxxx> wrote:
>
> > > > > > > Is not the max 64K as you test against XDP_UMEM_MAX_CHUNK_SIZE in
> > > > > > > xdp_umem_reg()?
> > > > > >
> > > > > > The absolute max is 64K. In the case of HPAGE_SIZE < 64K, then it
> > > > > > would be HPAGE_SIZE.
> > > > >
> > > > > Is there such a case when HPAGE_SIZE would be less than 64K? If not,
> > > > > then just write 64K.
> > > >
> > > > Yes. While most platforms have HPAGE_SIZE defined to a compile-time
> > > > constant >= 64K (very often 2M) there are platforms (at least ia64 and
> > > > powerpc) where the hugepage size is configured at boot. Specifically,
> > > > in the case of Itanium (ia64), the hugepage size may be configured at
> > > > boot to any valid page size > PAGE_SIZE (e.g. 8K). See:
> > > > https://elixir.bootlin.com/linux/latest/source/arch/ia64/mm/hugetlbpage.c#L159
> > >
> > > So for all practical purposes it is max 64K. Let us just write that then.
> >
> > What about when CONFIG_HUGETLB_PAGE is not defined? Should we keep it
> > set to PAGE_SIZE in that case, or would you like it to be a fixed
> > constant == 64K always?
>
> Sorry. Now it's not clear to me if you are suggesting the
> documentation be changed or the code or both?

The documentation.