search for: sent_pkt

Displaying 20 results from an estimated 66 matches for "sent_pkt".

Did you mean: send_pkt
2019 Apr 25
2
[PATCH net] vhost_net: fix possible infinite loop
...-- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index df51a35..fb46e6b 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -778,8 +778,9 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) int err; int sent_pkts = 0; bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); + bool next_round = false; - for (;;) { + do { bool busyloop_intr = false; if (nvq->done_idx == VHOST_NET_BATCH) @@ -845,11 +846,10 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) vq->...
2019 Apr 25
2
[PATCH net] vhost_net: fix possible infinite loop
...-- 1 file changed, 21 insertions(+), 20 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index df51a35..fb46e6b 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -778,8 +778,9 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) int err; int sent_pkts = 0; bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); + bool next_round = false; - for (;;) { + do { bool busyloop_intr = false; if (nvq->done_idx == VHOST_NET_BATCH) @@ -845,11 +846,10 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) vq->...
2019 Apr 26
2
[PATCH net] vhost_net: fix possible infinite loop
...iff --git a/drivers/vhost/net.c b/drivers/vhost/net.c >> index df51a35..fb46e6b 100644 >> --- a/drivers/vhost/net.c >> +++ b/drivers/vhost/net.c >> @@ -778,8 +778,9 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) >> int err; >> int sent_pkts = 0; >> bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); >> + bool next_round = false; >> >> - for (;;) { >> + do { >> bool busyloop_intr = false; >> >> if (nvq->done_idx == VHOST_NET_BATCH) >> @@ -845,11 +846,1...
2019 Apr 26
2
[PATCH net] vhost_net: fix possible infinite loop
...iff --git a/drivers/vhost/net.c b/drivers/vhost/net.c >> index df51a35..fb46e6b 100644 >> --- a/drivers/vhost/net.c >> +++ b/drivers/vhost/net.c >> @@ -778,8 +778,9 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) >> int err; >> int sent_pkts = 0; >> bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); >> + bool next_round = false; >> >> - for (;;) { >> + do { >> bool busyloop_intr = false; >> >> if (nvq->done_idx == VHOST_NET_BATCH) >> @@ -845,11 +846,1...
2019 May 12
2
[PATCH net] vhost_net: fix possible infinite loop
...6e6b 100644 > > > > --- a/drivers/vhost/net.c > > > > +++ b/drivers/vhost/net.c > > > > @@ -778,8 +778,9 @@ static void handle_tx_copy(struct vhost_net > > > > *net, struct socket *sock) > > > > ????? int err; > > > > ????? int sent_pkts = 0; > > > > ????? bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); > > > > +??? bool next_round = false; > > > > ? -??? for (;;) { > > > > +??? do { > > > > ????????? bool busyloop_intr = false; > > > > ? ???????...
2019 May 12
2
[PATCH net] vhost_net: fix possible infinite loop
...6e6b 100644 > > > > --- a/drivers/vhost/net.c > > > > +++ b/drivers/vhost/net.c > > > > @@ -778,8 +778,9 @@ static void handle_tx_copy(struct vhost_net > > > > *net, struct socket *sock) > > > > ????? int err; > > > > ????? int sent_pkts = 0; > > > > ????? bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); > > > > +??? bool next_round = false; > > > > ? -??? for (;;) { > > > > +??? do { > > > > ????????? bool busyloop_intr = false; > > > > ? ???????...
2019 Apr 25
0
[PATCH net] vhost_net: fix possible infinite loop
...deletions(-) > > diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c > index df51a35..fb46e6b 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -778,8 +778,9 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) > int err; > int sent_pkts = 0; > bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); > + bool next_round = false; > > - for (;;) { > + do { > bool busyloop_intr = false; > > if (nvq->done_idx == VHOST_NET_BATCH) > @@ -845,11 +846,10 @@ static void handle_tx_copy(struct vh...
2019 May 05
0
[PATCH net] vhost_net: fix possible infinite loop
...ost/net.c >>> index df51a35..fb46e6b 100644 >>> --- a/drivers/vhost/net.c >>> +++ b/drivers/vhost/net.c >>> @@ -778,8 +778,9 @@ static void handle_tx_copy(struct vhost_net >>> *net, struct socket *sock) >>> ????? int err; >>> ????? int sent_pkts = 0; >>> ????? bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); >>> +??? bool next_round = false; >>> ? -??? for (;;) { >>> +??? do { >>> ????????? bool busyloop_intr = false; >>> ? ????????? if (nvq->done_idx == VHOST_NET_BATCH...
2019 May 13
0
[PATCH net] vhost_net: fix possible infinite loop
...644 >>>>> --- a/drivers/vhost/net.c >>>>> +++ b/drivers/vhost/net.c >>>>> @@ -778,8 +778,9 @@ static void handle_tx_copy(struct vhost_net >>>>> *net, struct socket *sock) >>>>> ????? int err; >>>>> ????? int sent_pkts = 0; >>>>> ????? bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); >>>>> +??? bool next_round = false; >>>>> ? -??? for (;;) { >>>>> +??? do { >>>>> ????????? bool busyloop_intr = false; >>>>>...
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 14
1
[PATCH net] vhost_net: fix possible infinite loop
...net.c > > > > > > +++ b/drivers/vhost/net.c > > > > > > @@ -778,8 +778,9 @@ static void handle_tx_copy(struct vhost_net > > > > > > *net, struct socket *sock) > > > > > > ????? int err; > > > > > > ????? int sent_pkts = 0; > > > > > > ????? bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); > > > > > > +??? bool next_round = false; > > > > > > ? -??? for (;;) { > > > > > > +??? do { > > > > > > ????????? bool...
2018 May 21
1
[RFC PATCH net-next 02/12] vhost_net: introduce vhost_exceeds_weight()
...!vhost_vq_avail_empty(&net->dev, vq) && > @@ -600,8 +605,7 @@ static void handle_tx(struct vhost_net *net) > else > vhost_zerocopy_signal_used(net, vq); > vhost_net_tx_packet(net); > - if (unlikely(total_len >= VHOST_NET_WEIGHT) || > - unlikely(++sent_pkts >= VHOST_NET_PKT_WEIGHT)) { > + if (unlikely(vhost_exceeds_weight(++sent_pkts, total_len))) { > 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(v...
2018 May 21
1
[RFC PATCH net-next 03/12] vhost_net: introduce vhost_has_more_pkts()
...gt; msg.msg_flags |= MSG_MORE; > } else { > msg.msg_flags &= ~MSG_MORE; > @@ -605,7 +611,7 @@ static void handle_tx(struct vhost_net *net) > else > vhost_zerocopy_signal_used(net, vq); > vhost_net_tx_packet(net); > - if (unlikely(vhost_exceeds_weight(++sent_pkts, total_len))) { > + if (vhost_exceeds_weight(++sent_pkts, total_len)) { You should have kept the unlikely here, and not had it inside the helper (as per the previous patch. Also, why wasn't this change part of the previous patch? > vhost_poll_queue(&vq->poll); > bre...
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:
2019 May 17
0
[PATCH V2 1/4] vhost: introduce vhost_exceeds_weight()
..._virtqueue *nvq, struct msghdr *msg, @@ -845,10 +839,8 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) vq->heads[nvq->done_idx].id = cpu_to_vhost32(vq, head); vq->heads[nvq->done_idx].len = 0; ++nvq->done_idx; - if (vhost_exceeds_weight(++sent_pkts, total_len)) { - vhost_poll_queue(&vq->poll); + if (vhost_exceeds_weight(vq, ++sent_pkts, total_len)) break; - } } vhost_tx_batch(net, nvq, sock, &msg); @@ -951,10 +943,9 @@ static void handle_tx_zerocopy(struct vhost_net *net, struct socket *sock) else vhost_zeroco...
2018 May 21
20
[RFC PATCH net-next 00/12] XDP batching for TUN/vhost_net
Hi all: We do not support XDP batching for TUN since it can only receive one packet a time from vhost_net. This series tries to remove this limitation by: - introduce a TUN specific msg_control that can hold a pointer to an array of XDP buffs - try copy and build XDP buff in vhost_net - store XDP buffs in an array and submit them once for every N packets from vhost_net - since TUN can only
2018 Apr 24
2
[PATCH] vhost_net: use packet weight for rx handler, too
...6 /* MAX number of TX used buffers for outstanding zerocopy */ #define VHOST_MAX_PEND 128 @@ -587,7 +589,7 @@ static void handle_tx(struct vhost_net *net) vhost_zerocopy_signal_used(net, vq); vhost_net_tx_packet(net); if (unlikely(total_len >= VHOST_NET_WEIGHT) || - unlikely(++sent_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 rec...
2018 May 21
0
[RFC PATCH net-next 04/12] vhost_net: split out datacopy logic
...t head; + struct msghdr msg = { + .msg_name = NULL, + .msg_namelen = 0, + .msg_control = NULL, + .msg_controllen = 0, + .msg_flags = MSG_DONTWAIT, + }; + size_t len, total_len = 0; + int err; + size_t hdr_size; + struct socket *sock; + struct vhost_net_ubuf_ref *uninitialized_var(ubufs); + int sent_pkts = 0; + + mutex_lock(&vq->mutex); + sock = vq->private_data; + if (!sock) + goto out; + + if (!vq_iotlb_prefetch(vq)) + goto out; + + vhost_disable_notify(&net->dev, vq); + vhost_net_disable_vq(net, vq); + + hdr_size = nvq->vhost_hlen; + + for (;;) { + head = vhost_net_tx_get...
2020 Jun 03
1
[PATCH RFC 08/13] vhost/net: convert to new API: heads->bufs
...irtqueue *vq = &nvq->vq; > unsigned out, in; > - int head; > + int ret; > struct msghdr msg = { > .msg_name = NULL, > .msg_namelen = 0, > @@ -773,6 +787,7 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) > int err; > int sent_pkts = 0; > bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); > + struct vhost_buf buf; > > do { > bool busyloop_intr = false; > @@ -780,13 +795,13 @@ static void handle_tx_copy(struct vhost_net *net, struct socket *sock) > if (nvq->done_idx == VHOST...