linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yu-han Lin <guesslin@glasnostic.com>
To: linux-kernel@vger.kernel.org
Cc: Yu-han Lin <guesslin@glasnostic.com>,
	Marcus Schiesser <marcus@glasnostic.com>,
	"Shimansky, Gregory" <gregory.shimansky@intel.com>,
	"Melik-Adamyan, Areg" <areg.melik-adamyan@intel.com>
Subject: Running AF_XDP inside Docker using veth driver
Date: Wed, 18 Sep 2019 15:44:20 +0800	[thread overview]
Message-ID: <CAAQmspMAvcs01Twa2yDyRkq4TuTOMeFFoJvQGu5F_z3zeM26mg@mail.gmail.com> (raw)

Hello,

I wrote a test case handling network traffic in user-space inside a
Docker network
by using an XDP socket with libbpf. You can find the code in

https://github.com/glasnostic/af_xdp_test

My kernel version is 5.1 with XDP_SOCK enabled.

In this example, I have an unstable result while getting packets from
the XDP socket.
We can see a significant delay (~10s) until the packets are received
by the process.
It seems that XDP processes packets in batches and only when enough
packets exist,
all of the packets are sent to the userspace process.

This is a problem for traffic consisting of one packet (e.g. ARP, PING).

What is the correct way to deal with this problem?
E.g. can we force XDP to flush packets?

Thanks for the help.
- Yu-Han

                 reply	other threads:[~2019-09-18  7:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=CAAQmspMAvcs01Twa2yDyRkq4TuTOMeFFoJvQGu5F_z3zeM26mg@mail.gmail.com \
    --to=guesslin@glasnostic.com \
    --cc=areg.melik-adamyan@intel.com \
    --cc=gregory.shimansky@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcus@glasnostic.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).