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]
Date:   Mon, 7 Jan 2019 12:45:06 +0200
From:   Ilias Apalodimas <ilias.apalodimas@...aro.org>
To:     Ioana Ciocoi Radulescu <ruxandra.radulescu@....com>
Cc:     Jesper Dangaard Brouer <brouer@...hat.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        Ioana Ciornei <ioana.ciornei@....com>,
        "dsahern@...il.com" <dsahern@...il.com>,
        Camelia Alexandra Groza <camelia.groza@....com>
Subject: Re: Explaining the XDP page-requirement (Was: [PATCH v2 net-next
 0/8] dpaa2-eth: Introduce XDP support)

Hi Ioana,
> > > Thanks a lot for the info, will look into this. Do you have any
> > > pointers as to why the full page restriction exists in the first
> > > place? Sorry if it's a dumb question, but I haven't found details on
> > > this and I'd really like to understand it.
> > 
> > Hi Ioana,
> > 
> > I promised (offlist) that I would get back to you explaining the XDP
> > page-requirement...
> > 
> > There are several reasons for XDP to require frames are backed by a
> > page.  It started out with a focus on gaining speed via simplicity.
> > 
> > The overall requirement is: XDP frame in physical contigious memory
> >  - which is a requirement from BPF Direct-Access, for validating correcness.
> >  - Implying you cannot split packet data over several pages.
> > 
> > An important part of the page-requirement is to allow creating SKB's
> > outside the driver code.  This happen today in both cpumap and veth
> > (when doing XDP_REDIRECT).  And we need to control and limit the
> > variations, to avoid having to handle all kind of SKB schemes.
> > Specifically we need enough tailroom for the skb-shared-info.
> > 
> > In the beginning we had the requirement of: 1-page per XDP frame.
> >  - Gave us a simplified memory model
> >  - Allow us to not touch atomic refcnt on page (always 1)
> >  - Fixed 256 bytes headroom
> >  - This gave us a lot of tailroom, expanding tail was trivial.
> > 
> > Eventually ixgbe+i40e force us to use a split-page model, allowing two
> > frames per page.
> >  - This started to complicate memory model
> >  - This unfortunately gave issue of unknown tailroom, which killed the
> >    tailroom expand option.
> >  - Changes XDP headroom to be variable (192 or 256 bytes)
> > 
> > E.g. I really want to allow bpf_xdp_adjust_tail() to *expand* the
> > frame size, but after allowing the split-page model, we couldn't allow
> > this easily.  And SKB alloc in cpumap/veth was also complicated by not
> > knowing (implicit) xdp_frame "hard-end".  (We might have to extend
> > xdp_buff with "data_hard_end").
> > 
> 
> Thanks a lot, that's great info, especially for someone who hasn't followed
> so closely xdp development from its beginning.
> 
> I'll look into updating the dpaa2-eth driver to use one page per frame and
> see how that goes.

If you have time, we can discuss merging whatever hardware features are not
supported in the page_pool API and use that to allocate pages?

Regards
/Ilias

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ