From: Rusty Russell <rusty@rustcorp.com.au>
To: Mark McLoughlin <markmc@redhat.com>
Cc: netdev <netdev@vger.kernel.org>, kvm <kvm@vger.kernel.org>
Subject: Re: [PATCH] virtio_net: add link status handling
Date: Wed, 10 Dec 2008 10:26:36 +1030 [thread overview]
Message-ID: <200812101026.36538.rusty@rustcorp.com.au> (raw)
In-Reply-To: <1228817973.26198.1.camel@blaa>
On Tuesday 09 December 2008 20:49:33 Mark McLoughlin wrote:
> Allow the host to inform us that the link is down by adding
> a VIRTIO_NET_F_STATUS which indicates that device status is
> available in virtio_net config.
This has been a TODO for a while, thanks!
> + if (vi->status == v)
> + return;
> +
> + vi->status = v;
> +
> + if (vi->status & VIRTIO_NET_S_LINK_UP) {
> + netif_carrier_on(vi->dev);
> + netif_wake_queue(vi->dev);
> + } else {
> + netif_carrier_off(vi->dev);
> + netif_stop_queue(vi->dev);
> + }
New status bits will screw this logic unless we count
on the host not to set them. I suggest:
/* Ignore unknown (future) status bits */
v &= VIRTIO_NET_S_LINK_UP;
Cheers,
Rusty.
prev parent reply other threads:[~2008-12-09 23:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-09 10:19 [PATCH] virtio_net: add link status handling Mark McLoughlin
2008-12-09 21:32 ` Anthony Liguori
2008-12-09 23:53 ` Rusty Russell
2008-12-10 3:11 ` Anthony Liguori
2008-12-10 18:34 ` Mark McLoughlin
2008-12-12 8:04 ` Rusty Russell
2009-01-07 18:18 ` Mark McLoughlin
2009-01-09 11:51 ` Mark McLoughlin
2008-12-09 23:56 ` Rusty Russell [this message]
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=200812101026.36538.rusty@rustcorp.com.au \
--to=rusty@rustcorp.com.au \
--cc=kvm@vger.kernel.org \
--cc=markmc@redhat.com \
--cc=netdev@vger.kernel.org \
/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).