search for: vhost_net_weight

Displaying 20 results from an estimated 117 matches for "vhost_net_weight".

2018 May 21
1
[RFC PATCH net-next 02/12] vhost_net: introduce vhost_exceeds_weight()
...rivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -479,6 +479,12 @@ static size_t init_iov_iter(struct vhost_virtqueue *vq, struct iov_iter *iter, > return len; > } > > +static bool vhost_exceeds_weight(int pkts, int total_len) > +{ > + return unlikely(total_len >= VHOST_NET_WEIGHT) || > + unlikely(pkts >= VHOST_NET_PKT_WEIGHT); I was going to say just one unlikely, but then the caller of this function also says unlikely(vhost_exceeds...), so I think you should just drop the unlikely statements here (both of them) > +} > + > /* Expects to be always ru...
2018 Apr 03
0
[PATCH] vhost-net: add limitation of sent packets for tx polling
...Tue, Apr 03, 2018 at 12:29:47PM +0000, haibinzhang(???) wrote: > > >On Tue, Apr 03, 2018 at 08:08:26AM +0000, haibinzhang wrote: > >> handle_tx will delay rx for a long time when tx busy polling udp packets > >> with small length(e.g. 1byte udp payload), because setting VHOST_NET_WEIGHT > >> takes into account only sent-bytes but no single packet length. > >> > >> Tests were done between two Virtual Machines using netperf(UDP_STREAM, len=1), > >> then another machine pinged the client. Result shows as follow: > >> > >> Packet...
2018 Mar 28
2
[PATCH] vhost-net: add time limitation for tx polling(Internet mail)
On 2018?03?28? 12:01, haibinzhang(???) wrote: > On 2018?03?27? 19:26, Jason wrote > On 2018?03?27? 17:12, haibinzhang wrote: >>> handle_tx() will delay rx for a long time when busy tx polling udp packets >>> with short length(ie: 1byte udp payload), because setting VHOST_NET_WEIGHT >>> takes into account only sent-bytes but no time. >> Interesting. >> >> Looking at vhost_can_busy_poll() it tries to poke pending vhost work and >> exit the busy loop if it found one. So I believe something block the >> work queuing. E.g did reverting 8241a1...
2018 Mar 28
2
[PATCH] vhost-net: add time limitation for tx polling(Internet mail)
On 2018?03?28? 12:01, haibinzhang(???) wrote: > On 2018?03?27? 19:26, Jason wrote > On 2018?03?27? 17:12, haibinzhang wrote: >>> handle_tx() will delay rx for a long time when busy tx polling udp packets >>> with short length(ie: 1byte udp payload), because setting VHOST_NET_WEIGHT >>> takes into account only sent-bytes but no time. >> Interesting. >> >> Looking at vhost_can_busy_poll() it tries to poke pending vhost work and >> exit the busy loop if it found one. So I believe something block the >> work queuing. E.g did reverting 8241a1...
2018 Apr 24
2
[PATCH] vhost_net: use packet weight for rx handler, too
...-- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index bbf38befefb2..c4b49fca4871 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -46,8 +46,10 @@ MODULE_PARM_DESC(experimental_zcopytx, "Enable Zero Copy TX;" #define VHOST_NET_WEIGHT 0x80000 /* Max number of packets transferred before requeueing the job. - * Using this limit prevents one virtqueue from starving rx. */ -#define VHOST_NET_PKT_WEIGHT(vq) ((vq)->num * 2) + * Using this limit prevents one virtqueue from starving others with small + * pkts. + */ +#define VHOST_...
2018 Apr 03
0
[PATCH] vhost-net: add limitation of sent packets for tx polling
On Tue, Apr 03, 2018 at 08:08:26AM +0000, haibinzhang(???) wrote: > handle_tx will delay rx for a long time when tx busy polling udp packets > with small length(e.g. 1byte udp payload), because setting VHOST_NET_WEIGHT > takes into account only sent-bytes but no single packet length. > > Tests were done between two Virtual Machines using netperf(UDP_STREAM, len=1), > then another machine pinged the client. Result shows as follow: > > Packet# Ping-Latency(ms) > min av...
2018 May 21
0
[RFC PATCH net-next 02/12] vhost_net: introduce vhost_exceeds_weight()
....c index 15d191a..de544ee 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -479,6 +479,12 @@ static size_t init_iov_iter(struct vhost_virtqueue *vq, struct iov_iter *iter, return len; } +static bool vhost_exceeds_weight(int pkts, int total_len) +{ + return unlikely(total_len >= VHOST_NET_WEIGHT) || + unlikely(pkts >= VHOST_NET_PKT_WEIGHT); +} + /* Expects to be always run from workqueue - which acts as * read-size critical section for our kind of RCU. */ static void handle_tx(struct vhost_net *net) @@ -570,7 +576,6 @@ static void handle_tx(struct vhost_net *net) msg.msg_...
2018 Apr 09
0
[PATCH] vhost-net: set packet weight of tx polling to 2 * vq size
On Fri, Apr 06, 2018 at 08:22:37AM +0000, haibinzhang(???) wrote: > handle_tx will delay rx for tens or even hundreds of milliseconds when tx busy > polling udp packets with small length(e.g. 1byte udp payload), because setting > VHOST_NET_WEIGHT takes into account only sent-bytes but no single packet length. > > Ping-Latencies shown below were tested between two Virtual Machines using > netperf (UDP_STREAM, len=1), and then another machine pinged the client: > > Packet-Weight Ping-Latencies(millisecond) >...
2018 Apr 09
0
[PATCH] vhost-net: set packet weight of tx polling to 2 * vq size
...ng(???) wrote: > > > On Fri, Apr 06, 2018 at 08:22:37AM +0000, haibinzhang(???) wrote: > > > handle_tx will delay rx for tens or even hundreds of milliseconds when tx busy > > > polling udp packets with small length(e.g. 1byte udp payload), because setting > > > VHOST_NET_WEIGHT takes into account only sent-bytes but no single packet length. > > > > > > Ping-Latencies shown below were tested between two Virtual Machines using > > > netperf (UDP_STREAM, len=1), and then another machine pinged the client: > > > > > > Packet-Weig...
2017 Sep 28
1
[PATCH net-next RFC 5/5] vhost_net: basic tx virtqueue batched processing
...roducer index update out of the loop and using vhost_add_used_and_signal_n. > + } else > + vhost_zerocopy_signal_used(net, vq); > + vhost_net_tx_packet(net); > + if (unlikely(total_len >= VHOST_NET_WEIGHT)) { > + vhost_poll_queue(&vq->poll); > + goto out; > } > - vhost_discard_vq_desc(vq, 1); > - break; > - } > - if (e...
2017 Sep 28
1
[PATCH net-next RFC 5/5] vhost_net: basic tx virtqueue batched processing
...roducer index update out of the loop and using vhost_add_used_and_signal_n. > + } else > + vhost_zerocopy_signal_used(net, vq); > + vhost_net_tx_packet(net); > + if (unlikely(total_len >= VHOST_NET_WEIGHT)) { > + vhost_poll_queue(&vq->poll); > + goto out; > } > - vhost_discard_vq_desc(vq, 1); > - break; > - } > - if (e...
2018 Mar 27
0
[PATCH] vhost-net: add time limitation for tx polling
On 2018?03?27? 17:12, haibinzhang(???) wrote: > handle_tx() will delay rx for a long time when busy tx polling udp packets > with short length(ie: 1byte udp payload), because setting VHOST_NET_WEIGHT > takes into account only sent-bytes but no time. Interesting. Looking at vhost_can_busy_poll() it tries to poke pending vhost work and exit the busy loop if it found one. So I believe something block the work queuing. E.g did reverting 8241a1e466cd56e6c10472cac9c1ad4e54bc65db fix the issue...
2018 Mar 28
0
[PATCH] vhost-net: add time limitation for tx polling(Internet mail)
...12:01, haibinzhang(???) wrote: > > On 2018?03?27? 19:26, Jason wrote > > On 2018?03?27? 17:12, haibinzhang wrote: > > > > handle_tx() will delay rx for a long time when busy tx polling udp packets > > > > with short length(ie: 1byte udp payload), because setting VHOST_NET_WEIGHT > > > > takes into account only sent-bytes but no time. > > > Interesting. > > > > > > Looking at vhost_can_busy_poll() it tries to poke pending vhost work and > > > exit the busy loop if it found one. So I believe something block the > > >...
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
2017 Sep 22
0
[PATCH net-next RFC 5/5] vhost_net: basic tx virtqueue batched processing
...IZE(vq->iov), + &out, &in, NULL, NULL, + vhost16_to_cpu(vq, heads[i].id)); + if (in) { + vq_err(vq, "Unexpected descriptor format for " + "TX: out %d, int %d\n", out, in); + goto out; + } - total_len += len; - if (total_len < VHOST_NET_WEIGHT && - !vhost_vq_avail_empty(&net->dev, vq) && - likely(!vhost_exceeds_maxpend(net))) { - msg.msg_flags |= MSG_MORE; - } else { - msg.msg_flags &= ~MSG_MORE; - } + /* Skip header. TODO: support TSO. */ + len = iov_length(vq->iov, out); + iov_iter_in...
2014 Aug 15
2
[PATCH net-next] vhost_net: stop rx net polling when possible
...private_data; if (!sock) goto out; + vhost_poll_stop(rx_poll); vhost_disable_notify(&net->dev, vq); hdr_size = nvq->vhost_hlen; @@ -451,11 +456,17 @@ static void handle_tx(struct vhost_net *net) total_len += len; vhost_net_tx_packet(net); if (unlikely(total_len >= VHOST_NET_WEIGHT)) { - vhost_poll_queue(&vq->poll); + poll = true; break; } } + + if (rxsock) + vhost_poll_start(rx_poll, rxsock->file); + if (poll) + vhost_poll_queue(&vq->poll); out: + mutex_unlock(&rx_vq->mutex); mutex_unlock(&vq->mutex); } @@ -554,6 +565,7 @@...
2014 Aug 15
2
[PATCH net-next] vhost_net: stop rx net polling when possible
...private_data; if (!sock) goto out; + vhost_poll_stop(rx_poll); vhost_disable_notify(&net->dev, vq); hdr_size = nvq->vhost_hlen; @@ -451,11 +456,17 @@ static void handle_tx(struct vhost_net *net) total_len += len; vhost_net_tx_packet(net); if (unlikely(total_len >= VHOST_NET_WEIGHT)) { - vhost_poll_queue(&vq->poll); + poll = true; break; } } + + if (rxsock) + vhost_poll_start(rx_poll, rxsock->file); + if (poll) + vhost_poll_queue(&vq->poll); out: + mutex_unlock(&rx_vq->mutex); mutex_unlock(&vq->mutex); } @@ -554,6 +565,7 @@...
2016 Dec 28
0
[PATCH net-next V2 2/3] vhost_net: tx batching
...V == nvq->done_idx)) + if (unlikely(vhost_exceeds_maxpend(net))) break; head = vhost_net_tx_get_vq_desc(net, vq, vq->iov, @@ -454,6 +462,16 @@ static void handle_tx(struct vhost_net *net) msg.msg_control = NULL; ubufs = NULL; } + + total_len += len; + if (total_len < VHOST_NET_WEIGHT && + !vhost_vq_avail_empty(&net->dev, vq) && + likely(!vhost_exceeds_maxpend(net))) { + msg.msg_flags |= MSG_MORE; + } else { + msg.msg_flags &= ~MSG_MORE; + } + /* TODO: Check specific error and bomb out unless ENOBUFS? */ err = sock->ops->sen...
2017 Jan 18
0
[PATCH net-next V5 2/3] vhost_net: tx batching
...V == nvq->done_idx)) + if (unlikely(vhost_exceeds_maxpend(net))) break; head = vhost_net_tx_get_vq_desc(net, vq, vq->iov, @@ -454,6 +462,16 @@ static void handle_tx(struct vhost_net *net) msg.msg_control = NULL; ubufs = NULL; } + + total_len += len; + if (total_len < VHOST_NET_WEIGHT && + !vhost_vq_avail_empty(&net->dev, vq) && + likely(!vhost_exceeds_maxpend(net))) { + msg.msg_flags |= MSG_MORE; + } else { + msg.msg_flags &= ~MSG_MORE; + } + /* TODO: Check specific error and bomb out unless ENOBUFS? */ err = sock->ops->sen...
2018 Jul 20
12
[PATCH net-next 0/9] TX used ring batched updating for vhost
Hi: This series implement batch updating of used ring for TX. This help to reduce the cache contention on used ring. The idea is first split datacopy path from zerocopy, and do only batching for datacopy. This is because zercopy had already supported its own batching. TX PPS was increased 25.8% and Netperf TCP does not show obvious differences. The split of datapath will also be helpful for