lkml.org 
[lkml]   [2020]   [Apr]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 5.4 10/60] net: tun: record RX queue in skb before do_xdp_generic()
Date
From: Gilberto Bertin <me@jibi.io>

[ Upstream commit 3fe260e00cd0bf0be853c48fcc1e19853df615bb ]

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/net/tun.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1925,6 +1925,7 @@ drop:

skb_reset_network_header(skb);
skb_probe_transport_header(skb);
+ skb_record_rx_queue(skb, tfile->queue_index);

if (skb_xdp) {
struct bpf_prog *xdp_prog;
@@ -2492,6 +2493,7 @@ build:
skb->protocol = eth_type_trans(skb, tun->dev);
skb_reset_network_header(skb);
skb_probe_transport_header(skb);
+ skb_record_rx_queue(skb, tfile->queue_index);

if (skb_xdp) {
err = do_xdp_generic(xdp_prog, skb);
@@ -2503,7 +2505,6 @@ build:
!tfile->detached)
rxhash = __skb_get_hash_symmetric(skb);

- skb_record_rx_queue(skb, tfile->queue_index);
netif_receive_skb(skb);

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

\
 
 \ /
  Last update: 2020-04-20 14:53    [W:1.464 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site