Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1533299

Re: [PATCH net] vhost_net: don't continue to call the recvmsg when meet errors

From "Michael S. Tsirkin" <mst@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH net] vhost_net: don't continue to call the recvmsg when meet errors
Date 2016-11-30 14:50 +0100
Message-ID <sJdqO-6Jj-3@gated-at.bofh.it> (permalink)
References <sJc1H-61D-15@gated-at.bofh.it> <sJcO5-6wi-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Nov 30, 2016 at 09:07:16PM +0800, Jason Wang wrote:
> 
> 
> 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.

To me this looks a bit too aggressive. I would also like commit log
to explain better what is going on, to make sure we are
not just treating the symptoms.
-- 
MST

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net] vhost_net: don't continue to call the recvmsg when meet errors Yunjian Wang <wangyunjian@huawei.com> - 2016-11-30 13:20 +0100
  Re: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors Jason Wang <jasowang@redhat.com> - 2016-11-30 14:10 +0100
    Re: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors "Michael S. Tsirkin" <mst@redhat.com> - 2016-11-30 14:50 +0100
  Re: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors "Michael S. Tsirkin" <mst@redhat.com> - 2016-11-30 14:50 +0100
    RE: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors wangyunjian <wangyunjian@huawei.com> - 2016-12-01 03:50 +0100
      Re: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors Jason Wang <jasowang@redhat.com> - 2016-12-01 04:20 +0100
      Re: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors "Michael S. Tsirkin" <mst@redhat.com> - 2016-12-01 04:30 +0100
        Re: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors Jason Wang <jasowang@redhat.com> - 2016-12-01 04:30 +0100
          Re: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors Jason Wang <jasowang@redhat.com> - 2016-12-01 04:40 +0100
            RE: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors wangyunjian <wangyunjian@huawei.com> - 2016-12-01 05:50 +0100
              Re: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors "Michael S. Tsirkin" <mst@redhat.com> - 2016-12-01 06:00 +0100
          Re: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors "Michael S. Tsirkin" <mst@redhat.com> - 2016-12-01 04:40 +0100
    Re: [PATCH net] vhost_net: don't continue to call the recvmsg when  meet errors Jason Wang <jasowang@redhat.com> - 2016-12-01 04:20 +0100

csiph-web