Skip to content

Commit 3fe260e

Browse files
jibidavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e6aaeaf commit 3fe260e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/net/tun.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,7 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile,
18881888

18891889
skb_reset_network_header(skb);
18901890
skb_probe_transport_header(skb);
1891+
skb_record_rx_queue(skb, tfile->queue_index);
18911892

18921893
if (skb_xdp) {
18931894
struct bpf_prog *xdp_prog;
@@ -2459,6 +2460,7 @@ static int tun_xdp_one(struct tun_struct *tun,
24592460
skb->protocol = eth_type_trans(skb, tun->dev);
24602461
skb_reset_network_header(skb);
24612462
skb_probe_transport_header(skb);
2463+
skb_record_rx_queue(skb, tfile->queue_index);
24622464

24632465
if (skb_xdp) {
24642466
err = do_xdp_generic(xdp_prog, skb);
@@ -2470,7 +2472,6 @@ static int tun_xdp_one(struct tun_struct *tun,
24702472
!tfile->detached)
24712473
rxhash = __skb_get_hash_symmetric(skb);
24722474

2473-
skb_record_rx_queue(skb, tfile->queue_index);
24742475
netif_receive_skb(skb);
24752476

24762477
/* No need for get_cpu_ptr() here since this function is

0 commit comments

Comments
 (0)