search for: done_idx

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

2020 Jun 03
1
[PATCH RFC 08/13] vhost/net: convert to new API: heads->bufs
...+112,12 @@ struct vhost_net_virtqueue { > /* last used idx for outstanding DMA zerocopy buffers */ > int upend_idx; > /* For TX, first used idx for DMA done zerocopy buffers > - * For RX, number of batched heads > + * For RX, number of batched bufs > */ > int done_idx; > + /* Outstanding user bufs. UIO_MAXIOV in length. */ > + /* TODO: we can make this smaller for sure. */ > + struct vhost_buf *bufs; > /* Number of XDP frames batched */ > int batched_xdp; > /* an array of userspace buffers info */ > @@ -271,6 +274,8 @@ static void v...
2020 Jun 02
0
[PATCH RFC 08/13] vhost/net: convert to new API: heads->bufs
...orce u32)VHOST_DMA_DONE_LEN) @@ -112,9 +112,12 @@ struct vhost_net_virtqueue { /* last used idx for outstanding DMA zerocopy buffers */ int upend_idx; /* For TX, first used idx for DMA done zerocopy buffers - * For RX, number of batched heads + * For RX, number of batched bufs */ int done_idx; + /* Outstanding user bufs. UIO_MAXIOV in length. */ + /* TODO: we can make this smaller for sure. */ + struct vhost_buf *bufs; /* Number of XDP frames batched */ int batched_xdp; /* an array of userspace buffers info */ @@ -271,6 +274,8 @@ static void vhost_net_clear_ubuf_info(struct vhost_...
2013 Aug 23
3
[PATCH 6/6] vhost_net: remove the max pending check
...h tun/macvtap to do the same work >>> >> - This max pending check were almost useless since it was one done when there's >>> >> no new buffers coming from guest. Guest can easily exceeds the limitation. >>> >> - We've already check upend_idx != done_idx and switch to non zerocopy then. So >>> >> even if all vq->heads were used, we can still does the packet transmission. >> > We can but performance will suffer. > The check were in fact only done when no new buffers submitted from > guest. So if guest keep sending,...
2013 Aug 23
3
[PATCH 6/6] vhost_net: remove the max pending check
...h tun/macvtap to do the same work >>> >> - This max pending check were almost useless since it was one done when there's >>> >> no new buffers coming from guest. Guest can easily exceeds the limitation. >>> >> - We've already check upend_idx != done_idx and switch to non zerocopy then. So >>> >> even if all vq->heads were used, we can still does the packet transmission. >> > We can but performance will suffer. > The check were in fact only done when no new buffers submitted from > guest. So if guest keep sending,...
2013 Sep 23
2
[PATCH V3 4/6] vhost_net: determine whether or not to use zerocopy at one time
...Thu, Sep 05, 2013 at 10:54:44AM +0800, Jason Wang wrote: > On 09/04/2013 07:59 PM, Michael S. Tsirkin wrote: > > On Mon, Sep 02, 2013 at 04:40:59PM +0800, Jason Wang wrote: > >> Currently, even if the packet length is smaller than VHOST_GOODCOPY_LEN, if > >> upend_idx != done_idx we still set zcopy_used to true and rollback this choice > >> later. This could be avoided by determining zerocopy once by checking all > >> conditions at one time before. > >> > >> Signed-off-by: Jason Wang <jasowang at redhat.com> > >> --- > &...
2013 Sep 23
2
[PATCH V3 4/6] vhost_net: determine whether or not to use zerocopy at one time
...Thu, Sep 05, 2013 at 10:54:44AM +0800, Jason Wang wrote: > On 09/04/2013 07:59 PM, Michael S. Tsirkin wrote: > > On Mon, Sep 02, 2013 at 04:40:59PM +0800, Jason Wang wrote: > >> Currently, even if the packet length is smaller than VHOST_GOODCOPY_LEN, if > >> upend_idx != done_idx we still set zcopy_used to true and rollback this choice > >> later. This could be avoided by determining zerocopy once by checking all > >> conditions at one time before. > >> > >> Signed-off-by: Jason Wang <jasowang at redhat.com> > >> --- > &...
2013 Aug 16
10
[PATCH 0/6] vhost code cleanup and minor enhancement
Hi all: This series tries to unify and simplify vhost codes especially for zerocopy. Plase review. Thanks Jason Wang (6): vhost_net: make vhost_zerocopy_signal_used() returns void vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used() vhost: switch to use vhost_add_used_n() vhost_net: determine whether or not to use zerocopy at one time vhost_net: poll vhost
2013 Aug 16
10
[PATCH 0/6] vhost code cleanup and minor enhancement
Hi all: This series tries to unify and simplify vhost codes especially for zerocopy. Plase review. Thanks Jason Wang (6): vhost_net: make vhost_zerocopy_signal_used() returns void vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used() vhost: switch to use vhost_add_used_n() vhost_net: determine whether or not to use zerocopy at one time vhost_net: poll vhost
2013 Aug 30
12
[PATCH V2 0/6] vhost code cleanup and minor enhancement
Hi all: This series tries to unify and simplify vhost codes especially for zerocopy. With this series, 5% - 10% improvement for per cpu throughput were seen during netperf guest sending test. Plase review. Changes from V1: - Fix the zerocopy enabling check by changing the check of upend_idx != done_idx to (upend_idx + 1) % UIO_MAXIOV == done_idx. - Switch to use put_user() in __vhost_add_used_n() if there's only one used - Keep the max pending check based on Michael's suggestion. Jason Wang (6): vhost_net: make vhost_zerocopy_signal_used() returns void vhost_net: use vhost_add_used...
2013 Aug 30
12
[PATCH V2 0/6] vhost code cleanup and minor enhancement
Hi all: This series tries to unify and simplify vhost codes especially for zerocopy. With this series, 5% - 10% improvement for per cpu throughput were seen during netperf guest sending test. Plase review. Changes from V1: - Fix the zerocopy enabling check by changing the check of upend_idx != done_idx to (upend_idx + 1) % UIO_MAXIOV == done_idx. - Switch to use put_user() in __vhost_add_used_n() if there's only one used - Keep the max pending check based on Michael's suggestion. Jason Wang (6): vhost_net: make vhost_zerocopy_signal_used() returns void vhost_net: use vhost_add_used...
2013 Sep 04
2
[PATCH V3 4/6] vhost_net: determine whether or not to use zerocopy at one time
On Mon, Sep 02, 2013 at 04:40:59PM +0800, Jason Wang wrote: > Currently, even if the packet length is smaller than VHOST_GOODCOPY_LEN, if > upend_idx != done_idx we still set zcopy_used to true and rollback this choice > later. This could be avoided by determining zerocopy once by checking all > conditions at one time before. > > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/vhost/net.c | 47 +++++++++++++++++...
2013 Sep 04
2
[PATCH V3 4/6] vhost_net: determine whether or not to use zerocopy at one time
On Mon, Sep 02, 2013 at 04:40:59PM +0800, Jason Wang wrote: > Currently, even if the packet length is smaller than VHOST_GOODCOPY_LEN, if > upend_idx != done_idx we still set zcopy_used to true and rollback this choice > later. This could be avoided by determining zerocopy once by checking all > conditions at one time before. > > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/vhost/net.c | 47 +++++++++++++++++...
2018 May 29
2
[PATCH net] vhost_net: flush batched heads before trying to busy polling
...st_net_virtqueue { /* vhost zerocopy support fields below: */ /* last used idx for outstanding DMA zerocopy buffers */ int upend_idx; - /* first used idx for DMA done zerocopy buffers */ + /* For TX, first used idx for DMA done zerocopy buffers + * For RX, number of batched heads + */ int done_idx; /* an array of userspace buffers info */ struct ubuf_info *ubuf_info; @@ -626,6 +628,18 @@ static int sk_has_rx_data(struct sock *sk) return skb_queue_empty(&sk->sk_receive_queue); } +static void vhost_rx_signal_used(struct vhost_net_virtqueue *nvq) +{ + struct vhost_virtqueue *vq...
2013 Aug 16
2
[PATCH 6/6] vhost_net: remove the max pending check
...> > - We have the sk_wmem_alloc check in both tun/macvtap to do the same work > - This max pending check were almost useless since it was one done when there's > no new buffers coming from guest. Guest can easily exceeds the limitation. > - We've already check upend_idx != done_idx and switch to non zerocopy then. So > even if all vq->heads were used, we can still does the packet transmission. We can but performance will suffer. > > So remove this check completely. > > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/vhos...
2013 Aug 16
2
[PATCH 6/6] vhost_net: remove the max pending check
...> > - We have the sk_wmem_alloc check in both tun/macvtap to do the same work > - This max pending check were almost useless since it was one done when there's > no new buffers coming from guest. Guest can easily exceeds the limitation. > - We've already check upend_idx != done_idx and switch to non zerocopy then. So > even if all vq->heads were used, we can still does the packet transmission. We can but performance will suffer. > > So remove this check completely. > > Signed-off-by: Jason Wang <jasowang at redhat.com> > --- > drivers/vhos...
2013 Sep 02
8
[PATCH V3 0/6] vhost code cleanup and minor enhancement
...t were seen during netperf guest sending test. Plase review. Changes from V2: - Typo fixes and code style fix - Add performance gain in the commit log of patch 2/6 - Retest the update the result in patch 6/6 Changes from V1: - Fix the zerocopy enabling check by changing the check of upend_idx != done_idx to (upend_idx + 1) % UIO_MAXIOV == done_idx. - Switch to use put_user() in __vhost_add_used_n() if there's only one used - Keep the max pending check based on Michael's suggestion. Jason Wang (6): vhost_net: make vhost_zerocopy_signal_used() return void vhost_net: use vhost_add_used_...
2013 Sep 02
8
[PATCH V3 0/6] vhost code cleanup and minor enhancement
...t were seen during netperf guest sending test. Plase review. Changes from V2: - Typo fixes and code style fix - Add performance gain in the commit log of patch 2/6 - Retest the update the result in patch 6/6 Changes from V1: - Fix the zerocopy enabling check by changing the check of upend_idx != done_idx to (upend_idx + 1) % UIO_MAXIOV == done_idx. - Switch to use put_user() in __vhost_add_used_n() if there's only one used - Keep the max pending check based on Michael's suggestion. Jason Wang (6): vhost_net: make vhost_zerocopy_signal_used() return void vhost_net: use vhost_add_used_...
2013 Aug 16
2
[PATCH 2/6] vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used()
On Fri, Aug 16, 2013 at 01:16:26PM +0800, Jason Wang wrote: > Switch to use vhost_add_used_and_signal_n() to avoid multiple calls to > vhost_add_used_and_signal(). With the patch we will call at most 2 times > (consider done_idx warp around) compared to N times w/o this patch. > > Signed-off-by: Jason Wang <jasowang at redhat.com> So? Does this help performance then? > --- > drivers/vhost/net.c | 13 ++++++++----- > 1 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/...
2013 Aug 16
2
[PATCH 2/6] vhost_net: use vhost_add_used_and_signal_n() in vhost_zerocopy_signal_used()
On Fri, Aug 16, 2013 at 01:16:26PM +0800, Jason Wang wrote: > Switch to use vhost_add_used_and_signal_n() to avoid multiple calls to > vhost_add_used_and_signal(). With the patch we will call at most 2 times > (consider done_idx warp around) compared to N times w/o this patch. > > Signed-off-by: Jason Wang <jasowang at redhat.com> So? Does this help performance then? > --- > drivers/vhost/net.c | 13 ++++++++----- > 1 files changed, 8 insertions(+), 5 deletions(-) > > diff --git a/drivers/...
2018 Sep 06
2
[PATCH net-next 11/11] vhost_net: batch submitting XDP buffers to underlayer sockets
...tions(-) > > diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c > index fb01ce6d981c..1dd4239cbff8 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -116,6 +116,7 @@ struct vhost_net_virtqueue { > * For RX, number of batched heads > */ > int done_idx; > + int batched_xdp; Pls add a comment documenting what does this new field do. > /* an array of userspace buffers info */ > struct ubuf_info *ubuf_info; > /* Reference counting for outstanding ubufs. > @@ -123,6 +124,7 @@ struct vhost_net_virtqueue { > struct vhost_net...