netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael S. Tsirkin" <mst@redhat.com>
To: ggarcia@abra.uab.cat
Cc: netdev@vger.kernel.org, stefanha@redhat.com
Subject: Re: [PATCH v2 1/1] VSOCK: remove more space available check filling TX vq
Date: Mon, 15 Aug 2016 02:16:51 +0300	[thread overview]
Message-ID: <20160815021607-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20160810152434.14346-1-ggarcia@deic.uab.cat>

On Wed, Aug 10, 2016 at 05:24:34PM +0200, ggarcia@abra.uab.cat wrote:
> From: Gerard Garcia <ggarcia@deic.uab.cat>
> 
> Remove unnecessary use of enable/disable callback notifications
> and the incorrect more space available check.
> 
> The virtio_transport_tx_work handles when the TX virtqueue
> has more buffers available.
> 
> Signed-off-by: Gerard Garcia <ggarcia@deic.uab.cat>
> Acked-by: Stefan Hajnoczi <stefanha@redhat.com>

Generally enable/disable is a worthwhile optimization,
but if Stefan wants to keep code simple for now,
I don't have a problem with that.

> ---
> 
> v2:
>  * Comment style.
> 
>  net/vmw_vsock/virtio_transport.c | 10 +++-------
>  1 file changed, 3 insertions(+), 7 deletions(-)
> 
> diff --git a/net/vmw_vsock/virtio_transport.c b/net/vmw_vsock/virtio_transport.c
> index 699dfab..936d7ee 100644
> --- a/net/vmw_vsock/virtio_transport.c
> +++ b/net/vmw_vsock/virtio_transport.c
> @@ -87,9 +87,6 @@ virtio_transport_send_pkt_work(struct work_struct *work)
>  
>  	vq = vsock->vqs[VSOCK_VQ_TX];
>  
> -	/* Avoid unnecessary interrupts while we're processing the ring */
> -	virtqueue_disable_cb(vq);
> -
>  	for (;;) {
>  		struct virtio_vsock_pkt *pkt;
>  		struct scatterlist hdr, buf, *sgs[2];
> @@ -99,7 +96,6 @@ virtio_transport_send_pkt_work(struct work_struct *work)
>  		spin_lock_bh(&vsock->send_pkt_list_lock);
>  		if (list_empty(&vsock->send_pkt_list)) {
>  			spin_unlock_bh(&vsock->send_pkt_list_lock);
> -			virtqueue_enable_cb(vq);
>  			break;
>  		}
>  
> @@ -118,13 +114,13 @@ virtio_transport_send_pkt_work(struct work_struct *work)
>  		}
>  
>  		ret = virtqueue_add_sgs(vq, sgs, out_sg, in_sg, pkt, GFP_KERNEL);
> +		/* Usually this means that there is no more space available in
> +		 * the vq
> +		 */
>  		if (ret < 0) {
>  			spin_lock_bh(&vsock->send_pkt_list_lock);
>  			list_add(&pkt->list, &vsock->send_pkt_list);
>  			spin_unlock_bh(&vsock->send_pkt_list_lock);
> -
> -			if (!virtqueue_enable_cb(vq) && ret == -ENOSPC)
> -				continue; /* retry now that we have more space */
>  			break;
>  		}
>  
> -- 
> 2.9.1

  parent reply	other threads:[~2016-08-14 23:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-10 15:24 [PATCH v2 1/1] VSOCK: remove more space available check filling TX vq ggarcia
2016-08-13  0:31 ` David Miller
2016-08-13  9:55   ` [PATCH v2 1/1] VSOCK: remove more space available check filling TXvq Gerard Garcia
2016-08-14 23:16 ` Michael S. Tsirkin [this message]
2016-08-15 14:29   ` [PATCH v2 1/1] VSOCK: remove more space available check filling TX vq Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160815021607-mutt-send-email-mst@kernel.org \
    --to=mst@redhat.com \
    --cc=ggarcia@abra.uab.cat \
    --cc=netdev@vger.kernel.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).