xdp-newbies.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Magnus Karlsson <magnus.karlsson@gmail.com>
To: Eelco Chaudron <echaudro@redhat.com>
Cc: "William Tu" <u9012063@gmail.com>,
	Xdp <xdp-newbies@vger.kernel.org>,
	"Karlsson, Magnus" <magnus.karlsson@intel.com>,
	"Björn Töpel" <bjorn.topel@intel.com>
Subject: Re: xdpsock poll syscall CPU 100%
Date: Fri, 21 Feb 2020 09:33:45 +0100	[thread overview]
Message-ID: <CAJ8uoz3t6mKVr+aHx_WDkPg66_wTSsMNySzWny9JhCR1VG7mBA@mail.gmail.com> (raw)
In-Reply-To: <28C7C59E-0ED6-4331-8547-952419F20D1F@redhat.com>

On Fri, Feb 21, 2020 at 9:30 AM Eelco Chaudron <echaudro@redhat.com> wrote:
>
>
>
> On 20 Feb 2020, at 23:49, William Tu wrote:
>
> > Hi,
> >
> > I'm trying to save some CPU cycles when there is no packet arrives.
> > I enable the poll syscall option of xdpsock, by doing
> >
> > $ ./xdpsock -r -p -S -i ens16
> >  sock0@ens160:0 rxdrop xdp-skb poll()
> >                 pps         pkts        1.00
> > rx              0           0
> > tx              0           0
> >
> > Since there is no packet coming, I though by calling poll()
> > system call, the xdpsock process will be blocked and CPU utilization
> > should be way under 100%. However, I'm still seeing 100%
> > CPU utilization. Am I understanding this correctly?
>
> Hi William, I can remember I saw this in the past two with this code. It
> had something to do with the way xdpsock waits for the buffers to be
> free’ ed by the kernel. What I can remember it had something to do
> with the veth interfaces also.
>
> I do remember that I fixed it in the tutorial for AF_XDP:
> https://github.com/xdp-project/xdp-tutorial/blob/master/advanced03-AF_XDP/af_xdp_user.c

Eelco,

Do you remember exactly what you had to fix in the xdpsock sample?
Your tutorial is quite a rewrite so it is hard for me to tell exactly
which of all the changes that fix this problem. The reason I ask is
that it would be nice to fix this in the sample too.

Thanks: Magnus

> Maybe you can see if you have the same problem with this example.
>
> //Eelco
>
>
> > Thanks,
> > William
>

  reply	other threads:[~2020-02-21  8:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-20 22:49 xdpsock poll syscall CPU 100% William Tu
2020-02-21  8:11 ` Magnus Karlsson
2020-02-21  8:28 ` Eelco Chaudron
2020-02-21  8:33   ` Magnus Karlsson [this message]
2020-02-21  8:40     ` Eelco Chaudron
2020-02-21  8:46       ` Magnus Karlsson
2020-02-21  9:23         ` Eelco Chaudron
2020-02-21 18:40         ` William Tu

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=CAJ8uoz3t6mKVr+aHx_WDkPg66_wTSsMNySzWny9JhCR1VG7mBA@mail.gmail.com \
    --to=magnus.karlsson@gmail.com \
    --cc=bjorn.topel@intel.com \
    --cc=echaudro@redhat.com \
    --cc=magnus.karlsson@intel.com \
    --cc=u9012063@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 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).