mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Yunjian Wang <wangyunjian@huawei.com>,
	mst@redhat.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: caihe@huawei.com
Subject: Re: [PATCH net] vhost_net: don't continue to call the recvmsg when meet errors
Date: Wed, 30 Nov 2016 21:07:16 +0800	[thread overview]
Message-ID: <e4ac063d-db9f-ec93-30cd-163375ececfc@redhat.com> (raw)
In-Reply-To: <1480507857-22976-1-git-send-email-wangyunjian@huawei.com>



On 2016年11月30日 20:10, Yunjian Wang wrote:
> When we meet an error(err=-EBADFD) recvmsg, the error handling in vhost
> handle_rx() will continue. This will cause a soft CPU lockup in vhost thread.
>
> Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
> ---
>   drivers/vhost/net.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
> index 5dc128a..edc470b 100644
> --- a/drivers/vhost/net.c
> +++ b/drivers/vhost/net.c
> @@ -717,6 +717,9 @@ static void handle_rx(struct vhost_net *net)
>   			pr_debug("Discarded rx packet: "
>   				 " len %d, expected %zd\n", err, sock_len);
>   			vhost_discard_vq_desc(vq, headcount);
> +			/* Don't continue to do, when meet errors. */
> +			if (err < 0)
> +				goto out;
>   			continue;
>   		}
>   		/* Supply virtio_net_hdr if VHOST_NET_F_VIRTIO_NET_HDR */

Acked-by: Jason Wang <jasowang@redhat.com>

We may want to rename vhost_discard_vq_desc() in the future, since it 
does not discard the desc in fact.

  reply	other threads:[~2016-11-30 13:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-30 12:10 Yunjian Wang
2016-11-30 13:07 ` Jason Wang [this message]
2016-11-30 13:43   ` Michael S. Tsirkin
2016-11-30 13:40 ` Michael S. Tsirkin
2016-12-01  2:48   ` wangyunjian
2016-12-01  3:13     ` Jason Wang
2016-12-01  3:21     ` Michael S. Tsirkin
2016-12-01  3:26       ` Jason Wang
2016-12-01  3:27         ` Michael S. Tsirkin
2016-12-01  3:37           ` Jason Wang
2016-12-01  4:41             ` wangyunjian
2016-12-01  4:56               ` Michael S. Tsirkin
2016-12-01  3:15   ` Jason Wang

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=e4ac063d-db9f-ec93-30cd-163375ececfc@redhat.com \
    --to=jasowang@redhat.com \
    --cc=caihe@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=netdev@vger.kernel.org \
    --cc=wangyunjian@huawei.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

Powered by JetHome