Commit 291aeb2b authored by Jason Wang's avatar Jason Wang Committed by David S. Miller

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: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4f23aff8
...@@ -1726,22 +1726,18 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun, ...@@ -1726,22 +1726,18 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,
goto err_xdp; goto err_xdp;
} }
} }
rcu_read_unlock();
local_bh_enable();
skb = build_skb(buf, buflen); skb = build_skb(buf, buflen);
if (!skb) { if (!skb)
rcu_read_unlock();
local_bh_enable();
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
}
skb_reserve(skb, pad - delta); skb_reserve(skb, pad - delta);
skb_put(skb, len); skb_put(skb, len);
get_page(alloc_frag->page); get_page(alloc_frag->page);
alloc_frag->offset += buflen; alloc_frag->offset += buflen;
rcu_read_unlock();
local_bh_enable();
return skb; return skb;
err_redirect: err_redirect:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment