lkml.org 
[lkml]   [2023]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [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@dectris.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 :-).

    \
     
     \ /
      Last update: 2023-04-12 17:03    [W:3.218 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site