From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: aliguori@us.ibm.com, kvm@vger.kernel.org, quintela@redhat.com,
jan.kiszka@siemens.com, Rusty Russell <rusty@rustcorp.com.au>,
qemu-devel@nongnu.org, blauwirbel@gmail.com,
netdev@vger.kernel.org, pbonzini@redhat.com
Subject: Re: [RFC v2 PATCH 5/4 PATCH] virtio-net: send gratuitous packet when needed
Date: Tue, 25 Oct 2011 17:41:06 +0200 [thread overview]
Message-ID: <20111025154106.GA22553@redhat.com> (raw)
In-Reply-To: <4EA62401.5000602@redhat.com>
On Tue, Oct 25, 2011 at 10:50:41AM +0800, Jason Wang wrote:
> On 10/24/2011 01:25 PM, Michael S. Tsirkin wrote:
> > On Mon, Oct 24, 2011 at 02:54:59PM +1030, Rusty Russell wrote:
> >> On Sat, 22 Oct 2011 13:43:11 +0800, Jason Wang <jasowang@redhat.com> wrote:
> >>> This make let virtio-net driver can send gratituous packet by a new
> >>> config bit - VIRTIO_NET_S_ANNOUNCE in each config update
> >>> interrupt. When this bit is set by backend, the driver would schedule
> >>> a workqueue to send gratituous packet through NETDEV_NOTIFY_PEERS.
> >>>
> >>> This feature is negotiated through bit VIRTIO_NET_F_GUEST_ANNOUNCE.
> >>>
> >>> Signed-off-by: Jason Wang <jasowang@redhat.com>
> >>
> >> This seems like a huge layering violation. Imagine this in real
> >> hardware, for example.
> >
> > commits 06c4648d46d1b757d6b9591a86810be79818b60c
> > and 99606477a5888b0ead0284fecb13417b1da8e3af
> > document the need for this:
> >
> > NETDEV_NOTIFY_PEERS notifier indicates that a device moved to a
> > different physical link.
> > and
> > In real hardware such notifications are only
> > generated when the device comes up or the address changes.
> >
> > So hypervisor could get the same behaviour by sending link up/down
> > events, this is just an optimization so guest won't do
> > unecessary stuff like try to reconfigure an IP address.
> >
> >
> > Maybe LOCATION_CHANGE would be a better name?
> >
>
> ANNOUNCE_SELF?
It would be nice to formulate what kind of event
are we notifying the guest about.
The announce part of it is really up to the guest, isn't it?
> >
> >> There may be a good reason why virtual devices might want this kind of
> >> reconfiguration cheat, which is unnecessary for normal machines,
> >
> > I think yes, the difference with real hardware is guest can change
> > location without link getting dropped.
> > FWIW, Xen seems to use this capability too.
>
> So does ms netvsc.
>
> >
> >> but
> >> it'd have to be spelled out clearly in the spec to justify it...
> >>
> >> Cheers,
> >> Rusty.
> >
> > Agree, and I'd like to see the spec too. The interface seems
> > to involve the guest clearing the status bit when it detects
> > an event?
>
> I would describe this in spec. The interface need guest to clear the
> status bit, this would let the back-end know it has finished the work as
> we may need to send the gratuitous packets many times.
>
> >
> > Also - how does it interact with the link up event?
> > We probably don't want to schedule this when we detect
> > a link status change or during initialization, as
> > this patch seems to do? What if link goes down
> > while the work is running? Is that OK?
> >
>
> Looks like there's are duplications if guest enable arp_notify vm is
> started,
How hard would it be to avoid these duplicates?
> but we need to handle the situation that resuming a stopped
> virtual machine.
>
> For the link down race, I don't see any real issue, either dropping or
> queued.
For example, you do
unregister_netdev(vi->dev);
cancel_work_sync(&vi->announce);
which looks scary as announce seems to use the netdev.
--
MST
WARNING: multiple messages have this Message-ID (diff)
From: "Michael S. Tsirkin" <mst@redhat.com>
To: Jason Wang <jasowang@redhat.com>
Cc: aliguori@us.ibm.com, kvm@vger.kernel.org, quintela@redhat.com,
jan.kiszka@siemens.com, Rusty Russell <rusty@rustcorp.com.au>,
qemu-devel@nongnu.org, blauwirbel@gmail.com,
netdev@vger.kernel.org, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [RFC v2 PATCH 5/4 PATCH] virtio-net: send gratuitous packet when needed
Date: Tue, 25 Oct 2011 17:41:06 +0200 [thread overview]
Message-ID: <20111025154106.GA22553@redhat.com> (raw)
In-Reply-To: <4EA62401.5000602@redhat.com>
On Tue, Oct 25, 2011 at 10:50:41AM +0800, Jason Wang wrote:
> On 10/24/2011 01:25 PM, Michael S. Tsirkin wrote:
> > On Mon, Oct 24, 2011 at 02:54:59PM +1030, Rusty Russell wrote:
> >> On Sat, 22 Oct 2011 13:43:11 +0800, Jason Wang <jasowang@redhat.com> wrote:
> >>> This make let virtio-net driver can send gratituous packet by a new
> >>> config bit - VIRTIO_NET_S_ANNOUNCE in each config update
> >>> interrupt. When this bit is set by backend, the driver would schedule
> >>> a workqueue to send gratituous packet through NETDEV_NOTIFY_PEERS.
> >>>
> >>> This feature is negotiated through bit VIRTIO_NET_F_GUEST_ANNOUNCE.
> >>>
> >>> Signed-off-by: Jason Wang <jasowang@redhat.com>
> >>
> >> This seems like a huge layering violation. Imagine this in real
> >> hardware, for example.
> >
> > commits 06c4648d46d1b757d6b9591a86810be79818b60c
> > and 99606477a5888b0ead0284fecb13417b1da8e3af
> > document the need for this:
> >
> > NETDEV_NOTIFY_PEERS notifier indicates that a device moved to a
> > different physical link.
> > and
> > In real hardware such notifications are only
> > generated when the device comes up or the address changes.
> >
> > So hypervisor could get the same behaviour by sending link up/down
> > events, this is just an optimization so guest won't do
> > unecessary stuff like try to reconfigure an IP address.
> >
> >
> > Maybe LOCATION_CHANGE would be a better name?
> >
>
> ANNOUNCE_SELF?
It would be nice to formulate what kind of event
are we notifying the guest about.
The announce part of it is really up to the guest, isn't it?
> >
> >> There may be a good reason why virtual devices might want this kind of
> >> reconfiguration cheat, which is unnecessary for normal machines,
> >
> > I think yes, the difference with real hardware is guest can change
> > location without link getting dropped.
> > FWIW, Xen seems to use this capability too.
>
> So does ms netvsc.
>
> >
> >> but
> >> it'd have to be spelled out clearly in the spec to justify it...
> >>
> >> Cheers,
> >> Rusty.
> >
> > Agree, and I'd like to see the spec too. The interface seems
> > to involve the guest clearing the status bit when it detects
> > an event?
>
> I would describe this in spec. The interface need guest to clear the
> status bit, this would let the back-end know it has finished the work as
> we may need to send the gratuitous packets many times.
>
> >
> > Also - how does it interact with the link up event?
> > We probably don't want to schedule this when we detect
> > a link status change or during initialization, as
> > this patch seems to do? What if link goes down
> > while the work is running? Is that OK?
> >
>
> Looks like there's are duplications if guest enable arp_notify vm is
> started,
How hard would it be to avoid these duplicates?
> but we need to handle the situation that resuming a stopped
> virtual machine.
>
> For the link down race, I don't see any real issue, either dropping or
> queued.
For example, you do
unregister_netdev(vi->dev);
cancel_work_sync(&vi->announce);
which looks scary as announce seems to use the netdev.
--
MST
next prev parent reply other threads:[~2011-10-25 15:41 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-22 5:43 [RFC v2 PATCH 5/4 PATCH] virtio-net: send gratuitous packet when needed Jason Wang
2011-10-22 5:43 ` [Qemu-devel] " Jason Wang
2011-10-24 4:24 ` Rusty Russell
2011-10-24 4:24 ` [Qemu-devel] " Rusty Russell
2011-10-24 5:25 ` Michael S. Tsirkin
2011-10-24 5:25 ` [Qemu-devel] " Michael S. Tsirkin
2011-10-24 9:11 ` Ben Hutchings
2011-10-24 9:11 ` Ben Hutchings
2011-10-25 2:50 ` Jason Wang
2011-10-25 2:50 ` [Qemu-devel] " Jason Wang
2011-10-25 15:41 ` Michael S. Tsirkin [this message]
2011-10-25 15:41 ` Michael S. Tsirkin
2011-10-26 4:49 ` Jason Wang
2011-10-26 4:49 ` [Qemu-devel] " 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=20111025154106.GA22553@redhat.com \
--to=mst@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=blauwirbel@gmail.com \
--cc=jan.kiszka@siemens.com \
--cc=jasowang@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=quintela@redhat.com \
--cc=rusty@rustcorp.com.au \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.