Re: Question/Bug about AF_XDP idx_cq from xsk_ring_cons__peek?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jun 18, 2019 at 5:51 AM Björn Töpel <bjorn.topel@xxxxxxxxx> wrote:
>
> On Sat, 15 Jun 2019 at 01:25, William Tu <u9012063@xxxxxxxxx> wrote:
> >
> > Hi,
> >
> > In my implementation[1], I'm doing s.t like
> >     tx_done = xsk_ring_cons__peek(&xsk->umem->cq, BATCH_SIZE, &idx_cq);
> >     if (tx_done > 0) {
> >         xsk_ring_cons__release(&xsk->umem->cq, tx_done);
> >         xsk->outstanding_tx -= tx_done;
> >     }
> >
> > I expect if tx_done returns 32, then after calling xsk_ring_cons__release,
> > the next time I call xsk_ring_cons__peek, I should get idx_cq + 32.
> > However, sometimes I see the same value of idx_cq is returned as previous, even
> > when tx_done > 0. Is this the expected behavior?
> >
> > I experiment with xdpsock_user.c with the patch below and run
> > ~/bpf-next/samples/bpf# ./xdpsock -l -N -z -i eth3
> > using bpf-next commit 5e2ac390fbd08b2a462db66cef2663e4db0d5191
> >
>
> Will, apologies for the slow response.
>
> Hmm, it looks like a bug. We'll take a look!
>
No worries, thanks for the update!
Or let me know if I can try something to get more info.

the xsk_ring_cons__peek just keeps doing
        *idx = cons->cached_cons;
        cons->cached_cons += entries;

It's weird to see idx value not advancing 'entries' occasionally.

Regards,
William




[Index of Archives]     [Linux Networking Development]     [Fedora Linux Users]     [Linux SCTP]     [DCCP]     [Gimp]     [Yosemite Campsites]

  Powered by Linux