All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Jesper Dangaard Brouer <brouer@redhat.com>,
	Justin Azoff <justin.azoff@gmail.com>
Cc: rob.sherwood@gmail.com, bjorn.topel@gmail.com,
	aforster@cloudflare.com, xdp-newbies@vger.kernel.org,
	magnus.karlsson@intel.com
Subject: Re: AF_XDP umem and jumbo frames?
Date: Sun, 07 Oct 2018 21:34:53 +0200	[thread overview]
Message-ID: <1538940893.2928.3.camel@sipsolutions.net> (raw)
In-Reply-To: <20181007181339.2d94c762@redhat.com> (sfid-20181007_181349_090534_10CC0B8A)

On Sun, 2018-10-07 at 18:13 +0200, Jesper Dangaard Brouer wrote:

> One thing I realize is that people on this list, are perhaps not
> familiar how NIC RX (via DMA) works.  On RX, we cannot know the RX
> packet size up-front.  Thus, when filling the NIC RX-ring memory slots,
> then we have to allocated room for the "worse-case", e.g. 9000Bytes is
> minimum 3x4K=12K, and due to page-alloc limits min 4x4K=16K.  Thus,
> regardless of packet length the alloc size is the same.  (I will not go
> into detail on how different drivers tries to reduce this mem-overhead,
> but only say that those tricks costs CPU cycles).

Isn't all that generally only true if the NIC has no capability for
split packets? Some (wireless) NICs will - afaict - simply split the
larger packets into multiple single DMA descriptors (pages).

Obviously then that isn't contiguous memory, but it seems that part
could be solved by "mumble mumble something like rewriting eBPF accesses
at skb->data+4k to virtual memory" - which yes, would be *tremendously*
expensive once your program actually does that, but shouldn't actually
cause the general case to be worse off?

(Yes, I also realize that there's a question of being able to prove that
the access is >=4k, but in general I'd assume you can prove that it's
significantly less than 4k and thus not punt to such a slow-path)

johannes

  parent reply	other threads:[~2018-10-08  2:43 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-24 21:52 AF_XDP umem and jumbo frames? Alex Forster
2018-09-24 23:15 ` Justin Azoff
2018-09-25 16:43   ` Alex Forster
2018-09-27  0:55     ` Rob Sherwood
2018-10-04  6:44       ` Björn Töpel
2018-10-04  7:52         ` Jesper Dangaard Brouer
2018-10-04 14:48           ` Justin Azoff
2018-10-04 15:39           ` Alex Forster
2018-10-04 15:47           ` Rob Sherwood
2018-10-04 19:44             ` Jesper Dangaard Brouer
2018-10-05 18:47               ` Zvi Effron
2018-10-07 15:14                 ` Jesper Dangaard Brouer
2018-10-05 19:56               ` Justin Azoff
2018-10-07 16:13                 ` Jesper Dangaard Brouer
2018-10-07 17:48                   ` Eric Leblond
2018-10-07 19:34                   ` Johannes Berg [this message]
2018-10-06 20:02               ` Rob Sherwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1538940893.2928.3.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=aforster@cloudflare.com \
    --cc=bjorn.topel@gmail.com \
    --cc=brouer@redhat.com \
    --cc=justin.azoff@gmail.com \
    --cc=magnus.karlsson@intel.com \
    --cc=rob.sherwood@gmail.com \
    --cc=xdp-newbies@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.