Tracing with eBPF tracepoint "netif_receive_skb" for multiple NICs #232
-
I am trying to capture incoming packets with tracepoint events in the net category. As per this blog, netif_receive_skb seems to be a suitable tracepoint (one of the earliest points in the networking stack, L4 agnostic as well). Things work as expected with VMs having 1 NIC. However, when there are 2 NICs some packets are not captured meaning that the tracepoint is not triggered. Verifying with tcpdump for the secondary interface, I do see that the packets which are received by the secondary interface are not captured by the tracepoint netif_receive_skb. My understanding was that the tracepoint was independent of the network interface which is another reason for choosing netif_receive_skb over xdp (additionally, when loading the eBPF program with this tracepoint, network interfaces are not mentioned anyway). Again referring to the blog, I noticed that "netif_receive_skb operates in the context of a the softirq processing loop" which is in turn dependent on the interrupt raised by the network interface on receiving a packet. Code snippet for the tracepoint:
So the questions are, does each network interface have their individual |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
One tracepoint is shared across all interfaces. But seems this tracepoint has device name as one of the arguments. Grep for "net_dev_template" in Linux sources. |
Beta Was this translation helpful? Give feedback.
One tracepoint is shared across all interfaces. But seems this tracepoint has device name as one of the arguments. Grep for "net_dev_template" in Linux sources.