mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
xsk: do not enable/disable irq when grabbing/releasing xsk_tx_list_lock
The commitac98d8aab6("xsk: wire upp Tx zero-copy functions") originally introducing this lock put the deletion process in the sk_destruct which can run in irq context obviously, so the xxx_irqsave()/xxx_irqrestore() pair was used. But later another commit541d7fdd76("xsk: proper AF_XDP socket teardown ordering") moved the deletion into xsk_release() that only happens in process context. It means that since this commit, it doesn't necessarily need that pair. Now, there are two places that use this xsk_tx_list_lock and only run in the process context. So avoid manipulating the irq then. Signed-off-by: Jason Xing <kernelxing@tencent.com> Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com> Link: https://patch.msgid.link/20251030000646.18859-2-kerneljasonxing@gmail.com Signed-off-by: Paolo Abeni <pabeni@redhat.com>
This commit is contained in:
@@ -12,26 +12,22 @@
|
||||
|
||||
void xp_add_xsk(struct xsk_buff_pool *pool, struct xdp_sock *xs)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
if (!xs->tx)
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&pool->xsk_tx_list_lock, flags);
|
||||
spin_lock(&pool->xsk_tx_list_lock);
|
||||
list_add_rcu(&xs->tx_list, &pool->xsk_tx_list);
|
||||
spin_unlock_irqrestore(&pool->xsk_tx_list_lock, flags);
|
||||
spin_unlock(&pool->xsk_tx_list_lock);
|
||||
}
|
||||
|
||||
void xp_del_xsk(struct xsk_buff_pool *pool, struct xdp_sock *xs)
|
||||
{
|
||||
unsigned long flags;
|
||||
|
||||
if (!xs->tx)
|
||||
return;
|
||||
|
||||
spin_lock_irqsave(&pool->xsk_tx_list_lock, flags);
|
||||
spin_lock(&pool->xsk_tx_list_lock);
|
||||
list_del_rcu(&xs->tx_list);
|
||||
spin_unlock_irqrestore(&pool->xsk_tx_list_lock, flags);
|
||||
spin_unlock(&pool->xsk_tx_list_lock);
|
||||
}
|
||||
|
||||
void xp_destroy(struct xsk_buff_pool *pool)
|
||||
|
||||
Reference in New Issue
Block a user