lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJ8uoz3=hPW7sTzq=aroZkrOdQSNfjZjEQHQRe0uZmKSHnDkNA@mail.gmail.com>
Date:   Wed, 12 Apr 2023 17:02:14 +0200
From:   Magnus Karlsson <magnus.karlsson@...il.com>
To:     Kal Cutter Conley <kal.conley@...tris.com>
Cc:     Magnus Karlsson <magnus.karlsson@...el.com>,
        Björn Töpel <bjorn@...nel.org>,
        Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
        Jonathan Lemon <jonathan.lemon@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Jonathan Corbet <corbet@....net>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        John Fastabend <john.fastabend@...il.com>,
        netdev@...r.kernel.org, bpf@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH bpf-next v5 2/4] xsk: Support UMEM chunk_size > PAGE_SIZE

On Wed, 12 Apr 2023 at 16:30, Kal Cutter Conley <kal.conley@...tris.com> wrote:
>
> > > -       pool->unaligned = unaligned;
> > >         pool->frame_len = umem->chunk_size - umem->headroom -
> > >                 XDP_PACKET_HEADROOM;
> > > +       pool->unaligned = unaligned;
> >
> > nit: This change is not necessary.
>
> Do you mind if we keep it? It makes the assignments better match the
> order in the struct declaration.

Do not mind.

> > > -static void xp_check_dma_contiguity(struct xsk_dma_map *dma_map)
> > > +static void xp_check_dma_contiguity(struct xsk_dma_map *dma_map, u32 page_size)
> > >  {
> > >         u32 i;
> > >
> > > -       for (i = 0; i < dma_map->dma_pages_cnt - 1; i++) {
> > > -               if (dma_map->dma_pages[i] + PAGE_SIZE == dma_map->dma_pages[i + 1])
> > > +       for (i = 0; i + 1 < dma_map->dma_pages_cnt; i++) {
> >
> > I think the previous version is clearer than this new one.
>
> I like using `i + 1` since it matches the subscript usage. I'm used to
> writing it like this for SIMD code where subtraction may wrap if the
> length is unsigned, that doesn't matter in this case though. I can
> restore the old way if you want.

Please restore it in that case. I am not used to SIMD code :-).

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ