|
@@ -199,8 +199,11 @@ static void xsk_destruct_skb(struct sk_buff *skb)
|
|
|
{
|
|
|
u64 addr = (u64)(long)skb_shinfo(skb)->destructor_arg;
|
|
|
struct xdp_sock *xs = xdp_sk(skb->sk);
|
|
|
+ unsigned long flags;
|
|
|
|
|
|
+ spin_lock_irqsave(&xs->tx_completion_lock, flags);
|
|
|
WARN_ON_ONCE(xskq_produce_addr(xs->umem->cq, addr));
|
|
|
+ spin_unlock_irqrestore(&xs->tx_completion_lock, flags);
|
|
|
|
|
|
sock_wfree(skb);
|
|
|
}
|
|
@@ -755,6 +758,7 @@ static int xsk_create(struct net *net, struct socket *sock, int protocol,
|
|
|
|
|
|
xs = xdp_sk(sk);
|
|
|
mutex_init(&xs->mutex);
|
|
|
+ spin_lock_init(&xs->tx_completion_lock);
|
|
|
|
|
|
local_bh_disable();
|
|
|
sock_prot_inuse_add(net, &xsk_proto, 1);
|