diff options
author | Jason Wang <jasowang@redhat.com> | 2018-09-12 11:17:01 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-09-13 09:25:40 -0700 |
commit | 291aeb2b1dba0d0296673d994200824a7185585e (patch) | |
tree | d67feeed920ea6e5f50603faf54a206179bc5abf /drivers/net/tun.c | |
parent | 4f23aff8713c1f98735f7290a2cde63845b7ec88 (diff) | |
download | linux-291aeb2b1dba0d0296673d994200824a7185585e.tar.gz linux-291aeb2b1dba0d0296673d994200824a7185585e.tar.bz2 linux-291aeb2b1dba0d0296673d994200824a7185585e.zip |
tuntap: enable bh early during processing XDP
This patch move the bh enabling a little bit earlier, this will be
used for factoring out the core XDP logic of tuntap.
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r-- | drivers/net/tun.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index d3677a544b56..372caf7d67d9 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -1726,22 +1726,18 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, goto err_xdp; } } + rcu_read_unlock(); + local_bh_enable(); skb = build_skb(buf, buflen); - if (!skb) { - rcu_read_unlock(); - local_bh_enable(); + if (!skb) return ERR_PTR(-ENOMEM); - } skb_reserve(skb, pad - delta); skb_put(skb, len); get_page(alloc_frag->page); alloc_frag->offset += buflen; - rcu_read_unlock(); - local_bh_enable(); - return skb; err_redirect: |