Re: AF_XDP integration with FDio VPP? (Was: Questions about XDP)

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

 



On Wed, Sep 18, 2019 at 8:14 PM Július Milan <Julius.Milan@xxxxxxxxxxxxx> wrote:
>
> Hi
>
> > On Fri, Aug 30, 2019 at 9:37 AM Július Milan <Julius.Milan@xxxxxxxxxxxxx> wrote:
> >>
> >> Hi all
> >>
> >> Regarding 4K frame size constraint of AF_XDP, what does AF_XDP when receives frame bigger than 4K? Drops it or cut it or split it between more frames?
> >> Thinking about what to do with them on TX side.
> >>
> >> If you are interested in mentioned AF_XDP driver for vpp, here you can
> >> find it: https://gerrit.fd.io/r/c/vpp/+/21606
> >
> > Hi Július,
> >
> > I took a look at the patch, I can passed compile but I haven't run it.
> > In the src/plugins/af_xdp/device.c and src/plugins/af_xdp/xsk_defs.h, since you already link libbpf, you can remove a lot of existing code by using AF_XDP APIs in libbpf (see xsk_ring_*, xsk_umem_*)
> >
> > If you want to load your custom XDP program, you can enable XSK_LIBBPF_FLAGS__INHIBIT_PROG_LOAD and load XDP program
>
> Thank you William, I updated it, but its still work in progress, I inspired by OVS implementation as well.
>
> >
> > Regards,
> > William
>
> I have next 2 questions:
>
> 1] When I use xsk_ring_prod__reserve and successive xsk_ring_prod__submit. Is it correct to submit also less than I reserved?
>     In some cases I can't exactly determine how much to reserve in advance, since vpp buffers have different size than xdp frames.

Let me see so I understand this correctly. Ponder you reserve 10 slots
and later submit 4. This means you have reserved 6 more than you need.
Do you want to "unreserve" these and give them back to the ring? This
is not supported by the interface today. Another way of solving this
(if this is your problem and I am understanding it correctly, that is)
is that you in the next iteration only reserve 10 - 6 = 4 slots
because you already have 6 slots available from the last iteration.
You could still submit 10 after this. But adding something like an
unreserve option would be easy as long as we made sure it only
affected local ring state. The global state seen in the shared
variables between user space and kernel would not be touched, as this
would affect performance negatively. Please let me know what you
think.

> 2] Can I use hugepage backed memory for umem? If not, is it planned for future?
>     Yet it does copy pakets from rx rings to vpp buffers, but speculating about straight zerocopy way.

Yes you can use huge pages today, but the internal AF_XDP code has not
been optimized to use huge pages, so you will not get the full benefit
from them today. Kevin Laatz, added to this mail, is working on
optimizing the AF_XDP code for huge pages. If you want to know more or
have some requirements, do not hesitate to contact him.

/Magnus

> Many thanks
> Július




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

  Powered by Linux