From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Pavel Popa <pashinho1990@gmail.com>
Cc: xdp-newbies@vger.kernel.org, brouer@redhat.com
Subject: Re: Debugging cpumap_kthread drops
Date: Thu, 20 Dec 2018 13:44:39 +0100 [thread overview]
Message-ID: <20181220134439.23c45643@redhat.com> (raw)
In-Reply-To: <CAHOxX0w+K0u2vQbrAJ0kHG+XQjAqCSZY6SRTZCwWVXyzWQ_D0A@mail.gmail.com>
On Wed, 19 Dec 2018 17:51:21 +0100
Pavel Popa <pashinho1990@gmail.com> wrote:
> Hi all,
>
> I'm encountering the following log line "xdp_cpumap_kthread: kthread
> cpu=0 map_id=155 action=REDIRECT processed=1 drops=1 sched=1", and as
> you can see the "drops" counter is =1, thus not good. Is there any way
> to know the reason of such error? This is triggered when the IP dst
> address of a to be forwarded packet doesn't have a corresponding ARP
> entry, so what the XDP program does is basically redirecting the
> packet to a different CPU core for the net stack processing which will
> perform ARP, at least that's the intent. I should say that it
> perfectly worked some days ago, but now I'm encountering this. So, is
> there any possible way to debug deeper in a "xdp_cpumap_kthread
> drops"?
This trace point is located in function cpu_map_kthread_run() in file
kernel/bpf/cpumap.c.
The relevant code section:
/* Inject into network stack */
ret = netif_receive_skb_core(skb);
if (ret == NET_RX_DROP)
drops++;
The "drops" count is incremented when we inject the packet into the
network stack and it returns NET_RX_DROP. Thus, it is the network
stack that choose to drop your packet. As such it is likely a netstack
issue, not an XDP issue.
To debug this further you can use other netstack tracepoint to debug
this further. It might even be possible to tcpdump the packet before
it gets dropped by netstack.
It can be hard to follow the code path of the kernel, to figure out
exactly what code path is dropping the packet. But given you seem to
know howto use tracepoints, there is a shortcut to this information by
using the tracepoint "skb:kfree_skb" and look at the function
call-graph (we have "skb:consume_skb" for normal free path).
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
prev parent reply other threads:[~2018-12-20 12:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-19 16:51 Debugging cpumap_kthread drops Pavel Popa
2018-12-20 12:44 ` Jesper Dangaard Brouer [this message]
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=20181220134439.23c45643@redhat.com \
--to=brouer@redhat.com \
--cc=pashinho1990@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.