All of lore.kernel.org
 help / color / mirror / Atom feed
* Debugging cpumap_kthread drops
@ 2018-12-19 16:51 Pavel Popa
  2018-12-20 12:44 ` Jesper Dangaard Brouer
  0 siblings, 1 reply; 2+ messages in thread
From: Pavel Popa @ 2018-12-19 16:51 UTC (permalink / raw)
  To: xdp-newbies

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"?

Thank you

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Debugging cpumap_kthread drops
  2018-12-19 16:51 Debugging cpumap_kthread drops Pavel Popa
@ 2018-12-20 12:44 ` Jesper Dangaard Brouer
  0 siblings, 0 replies; 2+ messages in thread
From: Jesper Dangaard Brouer @ 2018-12-20 12:44 UTC (permalink / raw)
  To: Pavel Popa; +Cc: xdp-newbies, brouer

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-12-20 12:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-12-19 16:51 Debugging cpumap_kthread drops Pavel Popa
2018-12-20 12:44 ` Jesper Dangaard Brouer

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.