search for: vhost_hlen

Displaying 20 results from an estimated 246 matches for "vhost_hlen".

2010 Apr 26
1
[PATCH v6] Add mergeable rx buffer support to vhost_net
...ers/vhost/net.c --- net-next-v0/drivers/vhost/net.c 2010-04-24 21:36:54.000000000 -0700 +++ net-next-v6/drivers/vhost/net.c 2010-04-26 01:13:04.000000000 -0700 @@ -109,7 +109,7 @@ static void handle_tx(struct vhost_net * }; size_t len, total_len = 0; int err, wmem; - size_t hdr_size; + size_t vhost_hlen; struct socket *sock = rcu_dereference(vq->private_data); if (!sock) return; @@ -128,13 +128,13 @@ static void handle_tx(struct vhost_net * if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) {...
2010 Apr 26
1
[PATCH v6] Add mergeable rx buffer support to vhost_net
...ers/vhost/net.c --- net-next-v0/drivers/vhost/net.c 2010-04-24 21:36:54.000000000 -0700 +++ net-next-v6/drivers/vhost/net.c 2010-04-26 01:13:04.000000000 -0700 @@ -109,7 +109,7 @@ static void handle_tx(struct vhost_net * }; size_t len, total_len = 0; int err, wmem; - size_t hdr_size; + size_t vhost_hlen; struct socket *sock = rcu_dereference(vq->private_data); if (!sock) return; @@ -128,13 +128,13 @@ static void handle_tx(struct vhost_net * if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) {...
2010 Apr 28
6
[PATCHv7] add mergeable buffers support to vhost_net
...size; + len -= size; + ++from; + ++to; + ++seg; + } + return seg; +} /* Caller must have TX VQ lock */ static void tx_poll_stop(struct vhost_net *net) @@ -109,7 +126,7 @@ static void handle_tx(struct vhost_net * }; size_t len, total_len = 0; int err, wmem; - size_t hdr_size; + size_t vhost_hlen; struct socket *sock = rcu_dereference(vq->private_data); if (!sock) return; @@ -128,13 +145,13 @@ static void handle_tx(struct vhost_net * if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) {...
2010 Apr 28
6
[PATCHv7] add mergeable buffers support to vhost_net
...size; + len -= size; + ++from; + ++to; + ++seg; + } + return seg; +} /* Caller must have TX VQ lock */ static void tx_poll_stop(struct vhost_net *net) @@ -109,7 +126,7 @@ static void handle_tx(struct vhost_net * }; size_t len, total_len = 0; int err, wmem; - size_t hdr_size; + size_t vhost_hlen; struct socket *sock = rcu_dereference(vq->private_data); if (!sock) return; @@ -128,13 +145,13 @@ static void handle_tx(struct vhost_net * if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) {...
2010 Apr 19
2
[PATCH v4] Add mergeable RX bufs support to vhost
...ers/vhost/net.c --- net-next-p0/drivers/vhost/net.c 2010-03-22 12:04:38.000000000 -0700 +++ net-next-v4/drivers/vhost/net.c 2010-04-19 14:23:38.000000000 -0700 @@ -108,7 +108,7 @@ static void handle_tx(struct vhost_net * }; size_t len, total_len = 0; int err, wmem; - size_t hdr_size; + size_t vhost_hlen; struct socket *sock = rcu_dereference(vq->private_data); if (!sock) return; @@ -127,13 +127,13 @@ static void handle_tx(struct vhost_net * if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) {...
2010 Apr 19
2
[PATCH v4] Add mergeable RX bufs support to vhost
...ers/vhost/net.c --- net-next-p0/drivers/vhost/net.c 2010-03-22 12:04:38.000000000 -0700 +++ net-next-v4/drivers/vhost/net.c 2010-04-19 14:23:38.000000000 -0700 @@ -108,7 +108,7 @@ static void handle_tx(struct vhost_net * }; size_t len, total_len = 0; int err, wmem; - size_t hdr_size; + size_t vhost_hlen; struct socket *sock = rcu_dereference(vq->private_data); if (!sock) return; @@ -127,13 +127,13 @@ static void handle_tx(struct vhost_net * if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) {...
2010 Apr 23
1
[PATCHv5] add mergeable receiver buffers support to vhost
...ers/vhost/net.c --- net-next-v0/drivers/vhost/net.c 2010-04-22 11:31:57.000000000 -0700 +++ net-next-v5/drivers/vhost/net.c 2010-04-22 12:41:17.000000000 -0700 @@ -109,7 +109,7 @@ static void handle_tx(struct vhost_net * }; size_t len, total_len = 0; int err, wmem; - size_t hdr_size; + size_t vhost_hlen; struct socket *sock = rcu_dereference(vq->private_data); if (!sock) return; @@ -128,13 +128,13 @@ static void handle_tx(struct vhost_net * if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) {...
2010 Apr 23
1
[PATCHv5] add mergeable receiver buffers support to vhost
...ers/vhost/net.c --- net-next-v0/drivers/vhost/net.c 2010-04-22 11:31:57.000000000 -0700 +++ net-next-v5/drivers/vhost/net.c 2010-04-22 12:41:17.000000000 -0700 @@ -109,7 +109,7 @@ static void handle_tx(struct vhost_net * }; size_t len, total_len = 0; int err, wmem; - size_t hdr_size; + size_t vhost_hlen; struct socket *sock = rcu_dereference(vq->private_data); if (!sock) return; @@ -128,13 +128,13 @@ static void handle_tx(struct vhost_net * if (wmem < sock->sk->sk_sndbuf / 2) tx_poll_stop(net); - hdr_size = vq->hdr_size; + vhost_hlen = vq->vhost_hlen; for (;;) {...
2015 Feb 04
2
[PATCH v3 17/18] vhost: don't bother copying iovecs in handle_rx(), kill memcpy_toiovecend()
...{ struct vhost_net_virtqueue { struct vhost_virtqueue vq; - /* hdr is used to store the virtio header. - * Since each iovec has >= 1 byte length, we never need more than - * header length entries to store the header. */ - struct iovec hdr[sizeof(struct virtio_net_hdr_mrg_rxbuf)]; size_t vhost_hlen; size_t sock_hlen; /* vhost zerocopy support fields below: */ @@ -235,44 +231,6 @@ static bool vhost_sock_zcopy(struct socket *sock) sock_flag(sock->sk, SOCK_ZEROCOPY); } -/* Pop first len bytes from iovec. Return number of segments used. */ -static int move_iovec_hdr(struct iovec *fro...
2015 Feb 04
2
[PATCH v3 17/18] vhost: don't bother copying iovecs in handle_rx(), kill memcpy_toiovecend()
...{ struct vhost_net_virtqueue { struct vhost_virtqueue vq; - /* hdr is used to store the virtio header. - * Since each iovec has >= 1 byte length, we never need more than - * header length entries to store the header. */ - struct iovec hdr[sizeof(struct virtio_net_hdr_mrg_rxbuf)]; size_t vhost_hlen; size_t sock_hlen; /* vhost zerocopy support fields below: */ @@ -235,44 +231,6 @@ static bool vhost_sock_zcopy(struct socket *sock) sock_flag(sock->sk, SOCK_ZEROCOPY); } -/* Pop first len bytes from iovec. Return number of segments used. */ -static int move_iovec_hdr(struct iovec *fro...
2018 Jun 08
3
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...static int vhost_net_set_features(struct vhost_net *n, u64 features) (1ULL << VIRTIO_F_VERSION_1))) ? sizeof(struct virtio_net_hdr_mrg_rxbuf) : sizeof(struct virtio_net_hdr); - if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { - /* vhost provides vnet_hdr */ - vhost_hlen = hdr_len; - sock_hlen = 0; - } else { - /* socket provides vnet_hdr */ - vhost_hlen = 0; - sock_hlen = hdr_len; - } + + /* socket provides vnet_hdr */ + vhost_hlen = 0; + sock_hlen = hdr_len; + mutex_lock(&n->dev.mutex); if ((features & (1 << VHOST_F_LOG_ALL)) &...
2018 Jun 08
3
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...static int vhost_net_set_features(struct vhost_net *n, u64 features) (1ULL << VIRTIO_F_VERSION_1))) ? sizeof(struct virtio_net_hdr_mrg_rxbuf) : sizeof(struct virtio_net_hdr); - if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { - /* vhost provides vnet_hdr */ - vhost_hlen = hdr_len; - sock_hlen = 0; - } else { - /* socket provides vnet_hdr */ - vhost_hlen = 0; - sock_hlen = hdr_len; - } + + /* socket provides vnet_hdr */ + vhost_hlen = 0; + sock_hlen = hdr_len; + mutex_lock(&n->dev.mutex); if ((features & (1 << VHOST_F_LOG_ALL)) &...
2018 Jun 08
2
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...4 features) >> (1ULL << VIRTIO_F_VERSION_1))) ? >> sizeof(struct virtio_net_hdr_mrg_rxbuf) : >> sizeof(struct virtio_net_hdr); >> - if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { >> - /* vhost provides vnet_hdr */ >> - vhost_hlen = hdr_len; >> - sock_hlen = 0; >> - } else { >> - /* socket provides vnet_hdr */ >> - vhost_hlen = 0; >> - sock_hlen = hdr_len; >> - } >> + >> + /* socket provides vnet_hdr */ >> + vhost_hlen = 0; >> + sock_hlen = hdr_len; >&...
2018 Jun 08
2
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...4 features) >> (1ULL << VIRTIO_F_VERSION_1))) ? >> sizeof(struct virtio_net_hdr_mrg_rxbuf) : >> sizeof(struct virtio_net_hdr); >> - if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { >> - /* vhost provides vnet_hdr */ >> - vhost_hlen = hdr_len; >> - sock_hlen = 0; >> - } else { >> - /* socket provides vnet_hdr */ >> - vhost_hlen = 0; >> - sock_hlen = hdr_len; >> - } >> + >> + /* socket provides vnet_hdr */ >> + vhost_hlen = 0; >> + sock_hlen = hdr_len; >&...
2018 Jun 11
1
[PATCH net] vhost_net: remove VHOST_NET_F_VIRTIO_NET_HDR support
...;< VIRTIO_F_VERSION_1))) ? >>>> sizeof(struct virtio_net_hdr_mrg_rxbuf) : >>>> sizeof(struct virtio_net_hdr); >>>> - if (features & (1 << VHOST_NET_F_VIRTIO_NET_HDR)) { >>>> - /* vhost provides vnet_hdr */ >>>> - vhost_hlen = hdr_len; >>>> - sock_hlen = 0; >>>> - } else { >>>> - /* socket provides vnet_hdr */ >>>> - vhost_hlen = 0; >>>> - sock_hlen = hdr_len; >>>> - } >>>> + >>>> + /* socket provides vnet_hdr */...
2015 May 26
1
[RFC V7 PATCH 7/7] vhost_net: add interrupt coalescing support
...++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c > index 7d137a4..5ee28b7 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -320,6 +320,9 @@ static void handle_tx(struct vhost_net *net) > hdr_size = nvq->vhost_hlen; > zcopy = nvq->ubufs; > > + /* Finish pending interrupts first */ > + vhost_check_coalesce_and_signal(vq->dev, vq, false); > + > for (;;) { > /* Release DMAs done buffers first */ > if (zcopy) > @@ -415,6 +418,7 @@ static void handle_tx(struct vhost_net...
2015 May 26
1
[RFC V7 PATCH 7/7] vhost_net: add interrupt coalescing support
...++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c > index 7d137a4..5ee28b7 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -320,6 +320,9 @@ static void handle_tx(struct vhost_net *net) > hdr_size = nvq->vhost_hlen; > zcopy = nvq->ubufs; > > + /* Finish pending interrupts first */ > + vhost_check_coalesce_and_signal(vq->dev, vq, false); > + > for (;;) { > /* Release DMAs done buffers first */ > if (zcopy) > @@ -415,6 +418,7 @@ static void handle_tx(struct vhost_net...
2018 Jul 04
1
[PATCH net-next 1/8] vhost: move get_rx_bufs to vhost.c
...d014adf David Stevens 2010-07-27 706 }; 8dd014adf David Stevens 2010-07-27 707 size_t total_len = 0; 910a578f7 Michael S. Tsirkin 2012-10-24 708 int err, mergeable; f5a4941aa Jason Wang 2018-05-29 709 s16 headcount; 8dd014adf David Stevens 2010-07-27 710 size_t vhost_hlen, sock_hlen; 8dd014adf David Stevens 2010-07-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; db6...
2016 May 30
4
[PATCH V2 0/2] vhost_net polling optimization
Hi: This series tries to optimize vhost_net polling at two points: - Stop rx polling for reduicng the unnecessary wakeups during handle_rx(). - Conditonally enable tx polling for reducing the unnecessary traversing and spinlock touching. Test shows about 17% improvement on rx pps. Please review Changes from V1: - use vhost_net_disable_vq()/vhost_net_enable_vq() instead of open coding. -
2016 May 30
4
[PATCH V2 0/2] vhost_net polling optimization
Hi: This series tries to optimize vhost_net polling at two points: - Stop rx polling for reduicng the unnecessary wakeups during handle_rx(). - Conditonally enable tx polling for reducing the unnecessary traversing and spinlock touching. Test shows about 17% improvement on rx pps. Please review Changes from V1: - use vhost_net_disable_vq()/vhost_net_enable_vq() instead of open coding. -