Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: tun: record RX queue in skb before do_xdp_generic()

This allows netif_receive_generic_xdp() to correctly determine the RX
queue from which the skb is coming, so that the context passed to the
XDP program will contain the correct RX queue index.

Signed-off-by: Gilberto Bertin <me@jibi.io>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Gilberto Bertin and committed by
David S. Miller
3fe260e0 e6aaeafd

+2 -1
+2 -1
drivers/net/tun.c
··· 1888 1888 1889 1889 skb_reset_network_header(skb); 1890 1890 skb_probe_transport_header(skb); 1891 + skb_record_rx_queue(skb, tfile->queue_index); 1891 1892 1892 1893 if (skb_xdp) { 1893 1894 struct bpf_prog *xdp_prog; ··· 2460 2459 skb->protocol = eth_type_trans(skb, tun->dev); 2461 2460 skb_reset_network_header(skb); 2462 2461 skb_probe_transport_header(skb); 2462 + skb_record_rx_queue(skb, tfile->queue_index); 2463 2463 2464 2464 if (skb_xdp) { 2465 2465 err = do_xdp_generic(xdp_prog, skb); ··· 2472 2470 !tfile->detached) 2473 2471 rxhash = __skb_get_hash_symmetric(skb); 2474 2472 2475 - skb_record_rx_queue(skb, tfile->queue_index); 2476 2473 netif_receive_skb(skb); 2477 2474 2478 2475 /* No need for get_cpu_ptr() here since this function is