From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilias Apalodimas Subject: Re: Explaining the XDP page-requirement (Was: [PATCH v2 net-next 0/8] dpaa2-eth: Introduce XDP support) Date: Wed, 9 Jan 2019 16:25:11 +0200 Message-ID: <20190109142511.GA26002@apalos> References: <1543249591-14563-1-git-send-email-ruxandra.radulescu@nxp.com> <20181205164502.5b11ff7e@redhat.com> <20181207172016.GA21965@apalos> <20181207175135.GA22649@apalos> <20181221163119.3fbef5dc@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Jesper Dangaard Brouer , Ioana Ciocoi Radulescu , "netdev@vger.kernel.org" , "davem@davemloft.net" , Ioana Ciornei , "dsahern@gmail.com" , Camelia Alexandra Groza To: Madalin-cristian Bucur Return-path: Received: from mail-wm1-f68.google.com ([209.85.128.68]:33639 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730163AbfAIOZR (ORCPT ); Wed, 9 Jan 2019 09:25:17 -0500 Received: by mail-wm1-f68.google.com with SMTP id r24so11040616wmh.0 for ; Wed, 09 Jan 2019 06:25:16 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: Hi Madalin, > > > 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) > > Hi Jesper, > > is the split page memory model supported now (with two frames per page)? Yes, both Intel on their ixgbe and i40e driver and mellanox on mlx5 support this. Cheers /Ilias