search for: recv_pkt

Displaying 20 results from an estimated 49 matches for "recv_pkt".

Did you mean: recv_pkts
2019 Apr 25
2
[PATCH net] vhost_net: fix possible infinite loop
...d = vhost_exceeds_weight(++sent_pkts, total_len))); + + if (next_round) + vhost_poll_queue(&vq->poll); } /* Expects to be always run from workqueue - which acts as @@ -1134,6 +1134,7 @@ static void handle_rx(struct vhost_net *net) struct iov_iter fixup; __virtio16 num_buffers; int recv_pkts = 0; + bool next_round = false; mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); sock = vq->private_data; @@ -1153,8 +1154,11 @@ static void handle_rx(struct vhost_net *net) vq->log : NULL; mergeable = vhost_has_feature(vq, VIRTIO_NET_F_MRG_RXBUF); - while ((sock_len = vho...
2019 Apr 25
2
[PATCH net] vhost_net: fix possible infinite loop
...d = vhost_exceeds_weight(++sent_pkts, total_len))); + + if (next_round) + vhost_poll_queue(&vq->poll); } /* Expects to be always run from workqueue - which acts as @@ -1134,6 +1134,7 @@ static void handle_rx(struct vhost_net *net) struct iov_iter fixup; __virtio16 num_buffers; int recv_pkts = 0; + bool next_round = false; mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); sock = vq->private_data; @@ -1153,8 +1154,11 @@ static void handle_rx(struct vhost_net *net) vq->log : NULL; mergeable = vhost_has_feature(vq, VIRTIO_NET_F_MRG_RXBUF); - while ((sock_len = vho...
2018 May 21
1
[RFC PATCH net-next 02/12] vhost_net: introduce vhost_exceeds_weight()
...poll); > break; > } > @@ -887,8 +891,7 @@ static void handle_rx(struct vhost_net *net) > if (unlikely(vq_log)) > vhost_log_write(vq, vq_log, log, vhost_len); > total_len += vhost_len; > - if (unlikely(total_len >= VHOST_NET_WEIGHT) || > - unlikely(++recv_pkts >= VHOST_NET_PKT_WEIGHT)) { > + if (unlikely(vhost_exceeds_weight(++recv_pkts, total_len))) { > vhost_poll_queue(&vq->poll); > goto out; > }
2019 Apr 26
2
[PATCH net] vhost_net: fix possible infinite loop
...t; + vhost_poll_queue(&vq->poll); >> } >> >> /* Expects to be always run from workqueue - which acts as >> @@ -1134,6 +1134,7 @@ static void handle_rx(struct vhost_net *net) >> struct iov_iter fixup; >> __virtio16 num_buffers; >> int recv_pkts = 0; >> + bool next_round = false; >> >> mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); >> sock = vq->private_data; >> @@ -1153,8 +1154,11 @@ static void handle_rx(struct vhost_net *net) >> vq->log : NULL; >> mergeable = vhost...
2019 Apr 26
2
[PATCH net] vhost_net: fix possible infinite loop
...t; + vhost_poll_queue(&vq->poll); >> } >> >> /* Expects to be always run from workqueue - which acts as >> @@ -1134,6 +1134,7 @@ static void handle_rx(struct vhost_net *net) >> struct iov_iter fixup; >> __virtio16 num_buffers; >> int recv_pkts = 0; >> + bool next_round = false; >> >> mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); >> sock = vq->private_data; >> @@ -1153,8 +1154,11 @@ static void handle_rx(struct vhost_net *net) >> vq->log : NULL; >> mergeable = vhost...
2019 May 12
2
[PATCH net] vhost_net: fix possible infinite loop
...> > > > ? ? /* Expects to be always run from workqueue - which acts as > > > > @@ -1134,6 +1134,7 @@ static void handle_rx(struct vhost_net *net) > > > > ????? struct iov_iter fixup; > > > > ????? __virtio16 num_buffers; > > > > ????? int recv_pkts = 0; > > > > +??? bool next_round = false; > > > > ? ????? mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); > > > > ????? sock = vq->private_data; > > > > @@ -1153,8 +1154,11 @@ static void handle_rx(struct vhost_net *net) > > > &gt...
2019 May 12
2
[PATCH net] vhost_net: fix possible infinite loop
...> > > > ? ? /* Expects to be always run from workqueue - which acts as > > > > @@ -1134,6 +1134,7 @@ static void handle_rx(struct vhost_net *net) > > > > ????? struct iov_iter fixup; > > > > ????? __virtio16 num_buffers; > > > > ????? int recv_pkts = 0; > > > > +??? bool next_round = false; > > > > ? ????? mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); > > > > ????? sock = vq->private_data; > > > > @@ -1153,8 +1154,11 @@ static void handle_rx(struct vhost_net *net) > > > &gt...
2018 Apr 24
2
[PATCH] vhost_net: use packet weight for rx handler, too
...pkts >= VHOST_NET_PKT_WEIGHT(vq))) { + unlikely(++sent_pkts >= VHOST_NET_PKT_WEIGHT)) { vhost_poll_queue(&vq->poll); break; } @@ -769,6 +771,7 @@ static void handle_rx(struct vhost_net *net) struct socket *sock; struct iov_iter fixup; __virtio16 num_buffers; + int recv_pkts = 0; mutex_lock_nested(&vq->mutex, 0); sock = vq->private_data; @@ -872,7 +875,8 @@ static void handle_rx(struct vhost_net *net) if (unlikely(vq_log)) vhost_log_write(vq, vq_log, log, vhost_len); total_len += vhost_len; - if (unlikely(total_len >= VHOST_NET_WEIGHT)) {...
2019 Apr 25
0
[PATCH net] vhost_net: fix possible infinite loop
...; > + > + if (next_round) > + vhost_poll_queue(&vq->poll); > } > > /* Expects to be always run from workqueue - which acts as > @@ -1134,6 +1134,7 @@ static void handle_rx(struct vhost_net *net) > struct iov_iter fixup; > __virtio16 num_buffers; > int recv_pkts = 0; > + bool next_round = false; > > mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); > sock = vq->private_data; > @@ -1153,8 +1154,11 @@ static void handle_rx(struct vhost_net *net) > vq->log : NULL; > mergeable = vhost_has_feature(vq, VIRTIO_NET_F_MRG...
2019 May 05
0
[PATCH net] vhost_net: fix possible infinite loop
...&vq->poll); >>> ? } >>> ? ? /* Expects to be always run from workqueue - which acts as >>> @@ -1134,6 +1134,7 @@ static void handle_rx(struct vhost_net *net) >>> ????? struct iov_iter fixup; >>> ????? __virtio16 num_buffers; >>> ????? int recv_pkts = 0; >>> +??? bool next_round = false; >>> ? ????? mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); >>> ????? sock = vq->private_data; >>> @@ -1153,8 +1154,11 @@ static void handle_rx(struct vhost_net *net) >>> ????????? vq->log : NULL; >...
2019 May 13
0
[PATCH net] vhost_net: fix possible infinite loop
...>>> ? ? /* Expects to be always run from workqueue - which acts as >>>>> @@ -1134,6 +1134,7 @@ static void handle_rx(struct vhost_net *net) >>>>> ????? struct iov_iter fixup; >>>>> ????? __virtio16 num_buffers; >>>>> ????? int recv_pkts = 0; >>>>> +??? bool next_round = false; >>>>> ? ????? mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); >>>>> ????? sock = vq->private_data; >>>>> @@ -1153,8 +1154,11 @@ static void handle_rx(struct vhost_net *net) >>>...
2018 May 21
0
[RFC PATCH net-next 02/12] vhost_net: introduce vhost_exceeds_weight()
...n))) { vhost_poll_queue(&vq->poll); break; } @@ -887,8 +891,7 @@ static void handle_rx(struct vhost_net *net) if (unlikely(vq_log)) vhost_log_write(vq, vq_log, log, vhost_len); total_len += vhost_len; - if (unlikely(total_len >= VHOST_NET_WEIGHT) || - unlikely(++recv_pkts >= VHOST_NET_PKT_WEIGHT)) { + if (unlikely(vhost_exceeds_weight(++recv_pkts, total_len))) { vhost_poll_queue(&vq->poll); goto out; } -- 2.7.4
2019 May 14
1
[PATCH net] vhost_net: fix possible infinite loop
...lways run from workqueue - which acts as > > > > > > @@ -1134,6 +1134,7 @@ static void handle_rx(struct vhost_net *net) > > > > > > ????? struct iov_iter fixup; > > > > > > ????? __virtio16 num_buffers; > > > > > > ????? int recv_pkts = 0; > > > > > > +??? bool next_round = false; > > > > > > ? ????? mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); > > > > > > ????? sock = vq->private_data; > > > > > > @@ -1153,8 +1154,11 @@ static void handle_rx...
2019 May 16
6
[PATCH net 0/4] Prevent vhost kthread from hogging CPU
Hi: This series try to prvernt a guest triggerable CPU hogging through vhost kthread. This is done by introducing and checking the weight after each requrest. The patch has been tested with reproducer of vsock and virtio-net. Only compile test is done for vhost-scsi. Please review. This addresses CVE-2019-3900. Jason Wang (4): vhost: introduce vhost_exceeds_weight() vhost_net: fix possible
2019 May 17
0
[PATCH V2 1/4] vhost: introduce vhost_exceeds_weight()
...(unlikely(vhost_exceeds_weight(vq, ++sent_pkts, + total_len))) break; - } } } @@ -1239,10 +1230,8 @@ static void handle_rx(struct vhost_net *net) vhost_log_write(vq, vq_log, log, vhost_len, vq->iov, in); total_len += vhost_len; - if (unlikely(vhost_exceeds_weight(++recv_pkts, total_len))) { - vhost_poll_queue(&vq->poll); + if (unlikely(vhost_exceeds_weight(vq, ++recv_pkts, total_len))) goto out; - } } if (unlikely(busyloop_intr)) vhost_poll_queue(&vq->poll); @@ -1338,7 +1327,8 @@ static int vhost_net_open(struct inode *inode, struct file *...
2019 May 17
9
[PATCH V2 0/4] Prevent vhost kthread from hogging CPU
Hi: This series try to prevent a guest triggerable CPU hogging through vhost kthread. This is done by introducing and checking the weight after each requrest. The patch has been tested with reproducer of vsock and virtio-net. Only compile test is done for vhost-scsi. Please review. This addresses CVE-2019-3900. Changs from V1: - fix user-ater-free in vosck patch Jason Wang (4): vhost:
2019 May 17
9
[PATCH V2 0/4] Prevent vhost kthread from hogging CPU
Hi: This series try to prevent a guest triggerable CPU hogging through vhost kthread. This is done by introducing and checking the weight after each requrest. The patch has been tested with reproducer of vsock and virtio-net. Only compile test is done for vhost-scsi. Please review. This addresses CVE-2019-3900. Changs from V1: - fix user-ater-free in vosck patch Jason Wang (4): vhost:
2018 Jun 30
0
[PATCH net-next v3 2/4] net: vhost: replace magic number of lock annotation
...rx socket were polled here */ - mutex_lock_nested(&vq->mutex, 1); + mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_TX); vhost_disable_notify(&net->dev, vq); preempt_disable(); @@ -789,7 +789,7 @@ static void handle_rx(struct vhost_net *net) __virtio16 num_buffers; int recv_pkts = 0; - mutex_lock_nested(&vq->mutex, 0); + mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); sock = vq->private_data; if (!sock) goto out; -- 1.8.3.1
2018 Jul 04
1
[PATCH net-next 1/8] vhost: move get_rx_bufs to vhost.c
...7-27 711 size_t vhost_len, sock_len; 2e26af79b Asias He 2013-05-07 712 struct socket *sock; ba7438aed Al Viro 2014-12-10 713 struct iov_iter fixup; 0960b6417 Jason Wang 2015-02-15 714 __virtio16 num_buffers; db688c24e Paolo Abeni 2018-04-24 715 int recv_pkts = 0; 8dd014adf David Stevens 2010-07-27 716 aaa3149bb Jason Wang 2018-03-26 717 mutex_lock_nested(&vq->mutex, 0); 2e26af79b Asias He 2013-05-07 718 sock = vq->private_data; 2e26af79b Asias He 2013-05-07 719 if (!sock) 2e26af79b Asias He...
2018 Dec 12
2
[PATCH net V2 4/4] vhost: log dirty page correctly
...> VHOST_NET_BATCH) > vhost_net_signal_used(nvq); > if (unlikely(vq_log)) > - vhost_log_write(vq, vq_log, log, vhost_len); > + vhost_log_write(vq, vq_log, log, vhost_len, > + vq->iov, in); > total_len += vhost_len; > if (unlikely(vhost_exceeds_weight(++recv_pkts, total_len))) { > vhost_poll_queue(&vq->poll); > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 55e5aa662ad5..3660310604fd 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -1733,11 +1733,67 @@ static int log_write(void __user...