mirror of
https://github.com/torvalds/linux.git
synced 2026-09-22 04:34:03 +02:00
Revert "vhost-net: wake queue of tun/tap after ptr_ring consume"
This reverts commitbaf808fe4f. There is no netdev queue left to wake after reverting commit1d6e569b7d("tun/tap & vhost-net: avoid ptr_ring tail-drop when a qdisc is present"). Signed-off-by: Simon Schippers <simon.schippers@tu-dortmund.de> Acked-by: Michael S. Tsirkin <mst@redhat.com> Link: https://patch.msgid.link/20260728092240.250257-4-simon.schippers@tu-dortmund.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6bc85579c3
commit
8f83be72d9
|
|
@ -3787,29 +3787,6 @@ struct ptr_ring *tun_get_tx_ring(struct file *file)
|
|||
}
|
||||
EXPORT_SYMBOL_GPL(tun_get_tx_ring);
|
||||
|
||||
/* Callers must hold ring.consumer_lock */
|
||||
void tun_wake_queue(struct file *file, int consumed)
|
||||
{
|
||||
struct tun_file *tfile;
|
||||
struct tun_struct *tun;
|
||||
|
||||
if (file->f_op != &tun_fops)
|
||||
return;
|
||||
|
||||
tfile = file->private_data;
|
||||
if (!tfile)
|
||||
return;
|
||||
|
||||
rcu_read_lock();
|
||||
|
||||
tun = rcu_dereference(tfile->tun);
|
||||
if (tun)
|
||||
__tun_wake_queue(tun, tfile, consumed);
|
||||
|
||||
rcu_read_unlock();
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(tun_wake_queue);
|
||||
|
||||
module_init(tun_init);
|
||||
module_exit(tun_cleanup);
|
||||
MODULE_DESCRIPTION(DRV_DESCRIPTION);
|
||||
|
|
|
|||
|
|
@ -176,21 +176,13 @@ static void *vhost_net_buf_consume(struct vhost_net_buf *rxq)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static int vhost_net_buf_produce(struct sock *sk,
|
||||
struct vhost_net_virtqueue *nvq)
|
||||
static int vhost_net_buf_produce(struct vhost_net_virtqueue *nvq)
|
||||
{
|
||||
struct file *file = sk->sk_socket->file;
|
||||
struct vhost_net_buf *rxq = &nvq->rxq;
|
||||
|
||||
rxq->head = 0;
|
||||
spin_lock(&nvq->rx_ring->consumer_lock);
|
||||
rxq->tail = __ptr_ring_consume_batched(nvq->rx_ring, rxq->queue,
|
||||
VHOST_NET_BATCH);
|
||||
|
||||
if (rxq->tail)
|
||||
tun_wake_queue(file, rxq->tail);
|
||||
|
||||
spin_unlock(&nvq->rx_ring->consumer_lock);
|
||||
rxq->tail = ptr_ring_consume_batched(nvq->rx_ring, rxq->queue,
|
||||
VHOST_NET_BATCH);
|
||||
return rxq->tail;
|
||||
}
|
||||
|
||||
|
|
@ -217,15 +209,14 @@ static int vhost_net_buf_peek_len(void *ptr)
|
|||
return __skb_array_len_with_tag(ptr);
|
||||
}
|
||||
|
||||
static int vhost_net_buf_peek(struct sock *sk,
|
||||
struct vhost_net_virtqueue *nvq)
|
||||
static int vhost_net_buf_peek(struct vhost_net_virtqueue *nvq)
|
||||
{
|
||||
struct vhost_net_buf *rxq = &nvq->rxq;
|
||||
|
||||
if (!vhost_net_buf_is_empty(rxq))
|
||||
goto out;
|
||||
|
||||
if (!vhost_net_buf_produce(sk, nvq))
|
||||
if (!vhost_net_buf_produce(nvq))
|
||||
return 0;
|
||||
|
||||
out:
|
||||
|
|
@ -1013,7 +1004,7 @@ static int peek_head_len(struct vhost_net_virtqueue *rvq, struct sock *sk)
|
|||
unsigned long flags;
|
||||
|
||||
if (rvq->rx_ring)
|
||||
return vhost_net_buf_peek(sk, rvq);
|
||||
return vhost_net_buf_peek(rvq);
|
||||
|
||||
spin_lock_irqsave(&sk->sk_receive_queue.lock, flags);
|
||||
head = skb_peek(&sk->sk_receive_queue);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ struct tun_msg_ctl {
|
|||
#if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE)
|
||||
struct socket *tun_get_socket(struct file *);
|
||||
struct ptr_ring *tun_get_tx_ring(struct file *file);
|
||||
void tun_wake_queue(struct file *file, int consumed);
|
||||
|
||||
static inline bool tun_is_xdp_frame(void *ptr)
|
||||
{
|
||||
|
|
@ -56,8 +55,6 @@ static inline struct ptr_ring *tun_get_tx_ring(struct file *f)
|
|||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
static inline void tun_wake_queue(struct file *f, int consumed) {}
|
||||
|
||||
static inline bool tun_is_xdp_frame(void *ptr)
|
||||
{
|
||||
return false;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user