* Re: [PATCH RFC V5 2/6] kvm hypervisor : Add a hypercall to KVM hypervisor to support pv-ticketlocks
From: Raghavendra K T @ 2012-04-17 3:49 UTC (permalink / raw)
To: Marcelo Tosatti
Cc: Jeremy Fitzhardinge, Greg Kroah-Hartman, KVM,
Konrad Rzeszutek Wilk, X86, linux-doc, LKML, Ingo Molnar,
Srivatsa Vaddagiri, Avi Kivity, H. Peter Anvin, Virtualization,
Xen, Stefano Stabellini, Sasha Levin
In-Reply-To: <20120412000629.GA32051@amt.cnet>
Sorry for late reply,
was on vacation for a week (without IMAP access :( )
On 04/12/2012 05:36 AM, Marcelo Tosatti wrote:
> On Fri, Mar 23, 2012 at 01:37:04PM +0530, Raghavendra K T wrote:
>> From: Srivatsa Vaddagiri<vatsa@linux.vnet.ibm.com>
[snip]
>> @@ -1567,6 +1568,9 @@ void kvm_vcpu_block(struct kvm_vcpu *vcpu)
>> prepare_to_wait(&vcpu->wq,&wait, TASK_INTERRUPTIBLE);
>>
>> if (kvm_arch_vcpu_runnable(vcpu)) {
>> + vcpu->pv_unhalted = 0;
>> + /* preventing reordering should be enough here */
>> + barrier();
>
> Is it always OK to erase the notification, even in case an unrelated
> event such as interrupt was the source of wakeup?
Erasing notification is not good, But I think in this case,
kvm_make_request(KVM_REQ_UNHALT, vcpu);
below this would take care of the rest.
>
> It would be easier to verify that notifications are not lost with atomic
>
> test_and_clear(pv_unhalted).
true, I 'll verify that (with pv_unhalt as atomic variable). my heart
says current code is just fine, since we are about to unblock.
>
> Also x86 specific code should remain in arch/x86/kvm/
>
I agree. 'll have clear function in arch/x86/kvm and add stub to rest
of the archs
>
^ permalink raw reply
* Re: [Xen-devel] [PATCH RFC V6 0/11] Paravirtualized ticketlocks
From: Srivatsa Vaddagiri @ 2012-04-17 2:54 UTC (permalink / raw)
To: Ian Campbell
Cc: Jeremy Fitzhardinge, Xen Devel, KVM, Stefano Stabellini,
Peter Zijlstra, the arch/x86 maintainers, LKML,
Konrad Rzeszutek Wilk, Andi Kleen, Raghavendra K T,
Jeremy Fitzhardinge, H. Peter Anvin, Attilio Rao, Thomas Gleixner,
Virtualization, Linus Torvalds, Ingo Molnar, Stephan Diestelhorst,
Avi Kivity
In-Reply-To: <1334594195.14560.236.camel@zakaz.uk.xensource.com>
* Ian Campbell <Ian.Campbell@citrix.com> [2012-04-16 17:36:35]:
> > > The current pv-spinlock patches however does not track which vcpu is
> > > spinning at what head of the ticketlock. I suppose we can consider
> > > that optimization in future and see how much benefit it provides (over
> > > plain yield/sleep the way its done now).
> >
> > Right. I think Jeremy played around with this some time?
>
> 5/11 "xen/pvticketlock: Xen implementation for PV ticket locks" tracks
> which vcpus are waiting for a lock in "cpumask_t waiting_cpus" and
> tracks which lock each is waiting for in per-cpu "lock_waiting". This is
> used in xen_unlock_kick to kick the right CPU. There's a loop over only
> the waiting cpus to figure out who to kick.
Yes sorry that's right. We do track who is waiting on what lock at what
position. This can be used to pass directed yield hints to host
scheduler (in a future optimization patch). What we don't track is the
vcpu owning a lock, which would have allowed other spinning vcpus to do
a directed yield to vcpu preempted holding a lock. OTOH that may be
unnecessary if we put in support for deferring preemption of vcpu that
are holding locks.
- vatsa
^ permalink raw reply
* Re: [Xen-devel] [PATCH RFC V6 0/11] Paravirtualized ticketlocks
From: Jeremy Fitzhardinge @ 2012-04-16 16:42 UTC (permalink / raw)
To: Ian Campbell
Cc: Xen Devel, KVM, Stefano Stabellini, Peter Zijlstra, LKML,
the arch/x86 maintainers, Srivatsa Vaddagiri,
Konrad Rzeszutek Wilk, Andi Kleen, Raghavendra K T,
Jeremy Fitzhardinge, H. Peter Anvin, Attilio Rao, Thomas Gleixner,
Virtualization, Linus Torvalds, Ingo Molnar, Stephan Diestelhorst,
Avi Kivity
In-Reply-To: <1334594195.14560.236.camel@zakaz.uk.xensource.com>
On 04/16/2012 09:36 AM, Ian Campbell wrote:
> On Mon, 2012-04-16 at 16:44 +0100, Konrad Rzeszutek Wilk wrote:
>> On Sat, Mar 31, 2012 at 09:37:45AM +0530, Srivatsa Vaddagiri wrote:
>>> * Thomas Gleixner <tglx@linutronix.de> [2012-03-31 00:07:58]:
>>>
>>>> I know that Peter is going to go berserk on me, but if we are running
>>>> a paravirt guest then it's simple to provide a mechanism which allows
>>>> the host (aka hypervisor) to check that in the guest just by looking
>>>> at some global state.
>>>>
>>>> So if a guest exits due to an external event it's easy to inspect the
>>>> state of that guest and avoid to schedule away when it was interrupted
>>>> in a spinlock held section. That guest/host shared state needs to be
>>>> modified to indicate the guest to invoke an exit when the last nested
>>>> lock has been released.
>>> I had attempted something like that long back:
>>>
>>> http://lkml.org/lkml/2010/6/3/4
>>>
>>> The issue is with ticketlocks though. VCPUs could go into a spin w/o
>>> a lock being held by anybody. Say VCPUs 1-99 try to grab a lock in
>>> that order (on a host with one cpu). VCPU1 wins (after VCPU0 releases it)
>>> and releases the lock. VCPU1 is next eligible to take the lock. If
>>> that is not scheduled early enough by host, then remaining vcpus would keep
>>> spinning (even though lock is technically not held by anybody) w/o making
>>> forward progress.
>>>
>>> In that situation, what we really need is for the guest to hint to host
>>> scheduler to schedule VCPU1 early (via yield_to or something similar).
>>>
>>> The current pv-spinlock patches however does not track which vcpu is
>>> spinning at what head of the ticketlock. I suppose we can consider
>>> that optimization in future and see how much benefit it provides (over
>>> plain yield/sleep the way its done now).
>> Right. I think Jeremy played around with this some time?
> 5/11 "xen/pvticketlock: Xen implementation for PV ticket locks" tracks
> which vcpus are waiting for a lock in "cpumask_t waiting_cpus" and
> tracks which lock each is waiting for in per-cpu "lock_waiting". This is
> used in xen_unlock_kick to kick the right CPU. There's a loop over only
> the waiting cpus to figure out who to kick.
Yes, and AFAIK the KVM pv-ticketlock patches do the same thing. If a
(V)CPU is asleep, then sending it a kick is pretty much equivalent to a
yield to (not precisely, but it should get scheduled soon enough, and it
won't be competing with a pile of VCPUs with no useful work to do).
J
^ permalink raw reply
* Re: [Xen-devel] [PATCH RFC V6 0/11] Paravirtualized ticketlocks
From: Ian Campbell @ 2012-04-16 16:36 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Jeremy Fitzhardinge, Xen Devel, KVM, Stefano Stabellini,
Peter Zijlstra, the arch/x86 maintainers, Srivatsa Vaddagiri,
LKML, Andi Kleen, Raghavendra K T, Jeremy Fitzhardinge,
H. Peter Anvin, Attilio Rao, Thomas Gleixner, Virtualization,
Linus Torvalds, Ingo Molnar, Stephan Diestelhorst, Avi Kivity
In-Reply-To: <20120416154429.GB4654@phenom.dumpdata.com>
On Mon, 2012-04-16 at 16:44 +0100, Konrad Rzeszutek Wilk wrote:
> On Sat, Mar 31, 2012 at 09:37:45AM +0530, Srivatsa Vaddagiri wrote:
> > * Thomas Gleixner <tglx@linutronix.de> [2012-03-31 00:07:58]:
> >
> > > I know that Peter is going to go berserk on me, but if we are running
> > > a paravirt guest then it's simple to provide a mechanism which allows
> > > the host (aka hypervisor) to check that in the guest just by looking
> > > at some global state.
> > >
> > > So if a guest exits due to an external event it's easy to inspect the
> > > state of that guest and avoid to schedule away when it was interrupted
> > > in a spinlock held section. That guest/host shared state needs to be
> > > modified to indicate the guest to invoke an exit when the last nested
> > > lock has been released.
> >
> > I had attempted something like that long back:
> >
> > http://lkml.org/lkml/2010/6/3/4
> >
> > The issue is with ticketlocks though. VCPUs could go into a spin w/o
> > a lock being held by anybody. Say VCPUs 1-99 try to grab a lock in
> > that order (on a host with one cpu). VCPU1 wins (after VCPU0 releases it)
> > and releases the lock. VCPU1 is next eligible to take the lock. If
> > that is not scheduled early enough by host, then remaining vcpus would keep
> > spinning (even though lock is technically not held by anybody) w/o making
> > forward progress.
> >
> > In that situation, what we really need is for the guest to hint to host
> > scheduler to schedule VCPU1 early (via yield_to or something similar).
> >
> > The current pv-spinlock patches however does not track which vcpu is
> > spinning at what head of the ticketlock. I suppose we can consider
> > that optimization in future and see how much benefit it provides (over
> > plain yield/sleep the way its done now).
>
> Right. I think Jeremy played around with this some time?
5/11 "xen/pvticketlock: Xen implementation for PV ticket locks" tracks
which vcpus are waiting for a lock in "cpumask_t waiting_cpus" and
tracks which lock each is waiting for in per-cpu "lock_waiting". This is
used in xen_unlock_kick to kick the right CPU. There's a loop over only
the waiting cpus to figure out who to kick.
> >
> > Do you see any issues if we take in what we have today and address the
> > finer-grained optimization as next step?
>
> I think that is the proper course - these patches show
> that on baremetal we don't incur performance regressions and in
> virtualization case we benefit greatly. Since these are the basic
> building blocks of a kernel - taking it slow and just adding
> this set of patches for v3.5 is a good idea - and then building on top
> of that for further refinement.
>
> >
> > - vatsa
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel
^ permalink raw reply
* Re: [PATCH RFC V6 0/11] Paravirtualized ticketlocks
From: Konrad Rzeszutek Wilk @ 2012-04-16 15:44 UTC (permalink / raw)
To: Srivatsa Vaddagiri, Jeremy Fitzhardinge
Cc: Xen Devel, the arch/x86 maintainers, KVM, Stefano Stabellini,
Peter Zijlstra, Raghavendra K T, LKML, Andi Kleen, Avi Kivity,
Jeremy Fitzhardinge, H. Peter Anvin, Attilio Rao, Thomas Gleixner,
Virtualization, Linus Torvalds, Ingo Molnar, Stephan Diestelhorst
In-Reply-To: <20120331040745.GC14030@linux.vnet.ibm.com>
On Sat, Mar 31, 2012 at 09:37:45AM +0530, Srivatsa Vaddagiri wrote:
> * Thomas Gleixner <tglx@linutronix.de> [2012-03-31 00:07:58]:
>
> > I know that Peter is going to go berserk on me, but if we are running
> > a paravirt guest then it's simple to provide a mechanism which allows
> > the host (aka hypervisor) to check that in the guest just by looking
> > at some global state.
> >
> > So if a guest exits due to an external event it's easy to inspect the
> > state of that guest and avoid to schedule away when it was interrupted
> > in a spinlock held section. That guest/host shared state needs to be
> > modified to indicate the guest to invoke an exit when the last nested
> > lock has been released.
>
> I had attempted something like that long back:
>
> http://lkml.org/lkml/2010/6/3/4
>
> The issue is with ticketlocks though. VCPUs could go into a spin w/o
> a lock being held by anybody. Say VCPUs 1-99 try to grab a lock in
> that order (on a host with one cpu). VCPU1 wins (after VCPU0 releases it)
> and releases the lock. VCPU1 is next eligible to take the lock. If
> that is not scheduled early enough by host, then remaining vcpus would keep
> spinning (even though lock is technically not held by anybody) w/o making
> forward progress.
>
> In that situation, what we really need is for the guest to hint to host
> scheduler to schedule VCPU1 early (via yield_to or something similar).
>
> The current pv-spinlock patches however does not track which vcpu is
> spinning at what head of the ticketlock. I suppose we can consider
> that optimization in future and see how much benefit it provides (over
> plain yield/sleep the way its done now).
Right. I think Jeremy played around with this some time?
>
> Do you see any issues if we take in what we have today and address the
> finer-grained optimization as next step?
I think that is the proper course - these patches show
that on baremetal we don't incur performance regressions and in
virtualization case we benefit greatly. Since these are the basic
building blocks of a kernel - taking it slow and just adding
this set of patches for v3.5 is a good idea - and then building on top
of that for further refinement.
>
> - vatsa
^ permalink raw reply
* [PULL] virtio: fixes for 3.4
From: Michael S. Tsirkin @ 2012-04-16 13:49 UTC (permalink / raw)
To: Linus Torvalds
Cc: kvm, virtualization, linux-kernel, asias, david, mst, renmx,
wuzhy
I know that -rc3 went out meanwhile but git handles that fine.
Please pull for 3.4, thanks!
The following changes since commit 0034102808e0dbbf3a2394b82b1bb40b5778de9e:
Linux 3.4-rc2 (2012-04-07 18:30:41 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git for_linus
for you to fetch changes up to 3ccc9372ed0fab33d20f10be3c1efd5776ff5913:
virtio_balloon: fix handling of PAGE_SIZE != 4k (2012-04-15 11:51:06 +0300)
----------------------------------------------------------------
virtio: fixes on top of 3.4-rc2
Here are some virtio fixes for 3.4:
a test build fix, a patch by Ren fixing naming for systems with a massive
number of virtio blk devices, and balloon fixes for powerpc
by David Gibson.
There was some discussion about Ren's patch for virtio disc naming: some people
wanted to move the legacy name mangling function to the block core. But
there's no concensus on that yet, and we can always deduplicate later.
Added comments in the hope that this will stop people from
copying this legacy naming scheme into future drivers.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
----------------------------------------------------------------
David Gibson (1):
virtio_balloon: Fix endian bug
Michael S. Tsirkin (1):
virtio_balloon: fix handling of PAGE_SIZE != 4k
Ren Mingxin (1):
virtio_blk: helper function to format disk names
Zhi Yong Wu (1):
tools/virtio: fix up vhost/test module build
drivers/block/virtio_blk.c | 41 +++++++++++++++++++--------
drivers/vhost/test.c | 2 +-
drivers/virtio/virtio_balloon.c | 58 +++++++++++++++++++++++++++++++--------
3 files changed, 76 insertions(+), 25 deletions(-)
^ permalink raw reply
* [PATCH] drivers/xen/grant-table.c: add error-handling code on failure of gnttab_resume
From: Julia Lawall @ 2012-04-15 9:27 UTC (permalink / raw)
To: Konrad Rzeszutek Wilk
Cc: Jeremy Fitzhardinge, xen-devel, kernel-janitors, linux-kernel,
virtualization
From: Julia Lawall <Julia.Lawall@lip6.fr>
Jump to the label ini_nomem as done on the failure of the page allocations
above.
The code at ini_nomem is modified to accommodate different return values.
Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
---
drivers/xen/grant-table.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/xen/grant-table.c b/drivers/xen/grant-table.c
index b4d4eac..f100ce2 100644
--- a/drivers/xen/grant-table.c
+++ b/drivers/xen/grant-table.c
@@ -1029,6 +1029,7 @@ int gnttab_init(void)
int i;
unsigned int max_nr_glist_frames, nr_glist_frames;
unsigned int nr_init_grefs;
+ int ret;
nr_grant_frames = 1;
boot_max_nr_grant_frames = __max_nr_grant_frames();
@@ -1047,12 +1048,16 @@ int gnttab_init(void)
nr_glist_frames = (nr_grant_frames * GREFS_PER_GRANT_FRAME + RPP - 1) / RPP;
for (i = 0; i < nr_glist_frames; i++) {
gnttab_list[i] = (grant_ref_t *)__get_free_page(GFP_KERNEL);
- if (gnttab_list[i] == NULL)
+ if (gnttab_list[i] == NULL) {
+ ret = -ENOMEM;
goto ini_nomem;
+ }
}
- if (gnttab_resume() < 0)
- return -ENODEV;
+ if (gnttab_resume() < 0) {
+ ret = -ENODEV;
+ goto ini_nomem;
+ }
nr_init_grefs = nr_grant_frames * GREFS_PER_GRANT_FRAME;
@@ -1070,7 +1075,7 @@ int gnttab_init(void)
for (i--; i >= 0; i--)
free_page((unsigned long)gnttab_list[i]);
kfree(gnttab_list);
- return -ENOMEM;
+ return ret;
}
EXPORT_SYMBOL_GPL(gnttab_init);
^ permalink raw reply related
* Re: [PATCH 3/3] virtio_balloon: Bugfixes for PAGE_SIZE != 4k
From: Michael S. Tsirkin @ 2012-04-15 8:52 UTC (permalink / raw)
To: rusty, virtualization, linux-kernel, paulus, qemu-devel
In-Reply-To: <20120413031211.GG5829@truffala.fritz.box>
On Fri, Apr 13, 2012 at 01:12:11PM +1000, David Gibson wrote:
> On Thu, Apr 12, 2012 at 01:14:06PM +0300, Michael S. Tsirkin wrote:
> > On Thu, Apr 12, 2012 at 03:36:35PM +1000, David Gibson wrote:
> [snip]
> > Good catch!
> >
> > Unfortunately I find the approach a bit convoluted.
> > It also looks like when host asks for 5 balloon pages
> > you interpret this as 0 where 16 is probably saner
> > on a 64K system.
>
> Hm, true. Although qemu at least actuall operates in units of
> megabytes on the balloon, so I doubt it matters much in practice.
>
> > I think it's easier if we just keep doing math in
> > balloon pages. I also get confused by shift operations,
> > IMO / and * are clearer where they are applicable.
> > Something like the below would make more sense I think.
>
> Sure. I thught working in local pages was clearer, but I don't really
> care.
>
>
> > I also wrote up a detailed commit log, so we have
> > the bugs and the expected consequences listed explicitly.
> >
> > I'm out of time for this week - so completely untested, sorry.
> > Maybe you could try this out? That would be great.
> > Thanks!
>
> Your patch has numerous syntax errors, but once those are fixed seems
> to work fine with a 64k ppc64 kernel. Fixed version below. I did add
> one comment, to note that with this change the num_pages field in the
> vb is no longer the same as the number of elements in the pages list.
> Nothing in the code relies on that, but it would probably be the first
> assumption of someone looking at the structure definition.
Good point. Although this really applies to all other
memory counters as well, so I put this at top of the file.
> Please apply.
Patch applied, thanks very much for the testing!
^ permalink raw reply
* Re: [net-next V7 PATCH] virtio-net: send gratuitous packets when needed
From: David Miller @ 2012-04-15 7:20 UTC (permalink / raw)
To: mst; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <20120415071223.GC3070@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Sun, 15 Apr 2012 10:12:23 +0300
> On Thu, Apr 12, 2012 at 02:43:52PM +0800, Jason Wang wrote:
>> As hypervior does not have the knowledge of guest network configuration, it's
>> better to ask guest to send gratuitous packets when needed.
>>
>> This patch implements VIRTIO_NET_F_GUEST_ANNOUNCE feature: hypervisor would
>> notice the guest when it thinks it's time for guest to announce the link
>> presnece. Guest tests VIRTIO_NET_S_ANNOUNCE bit during config change interrupt
>> and woule send gratuitous packets through netif_notify_peers() and ack the
>> notification through ctrl vq.
>>
>> We need to make sure the atomicy of read and ack in guest otherwise we may ack
>> more times than being notified. This is done through handling the whole config
>> change interrupt in an non-reentrant workqueue.
>>
>> Signed-off-by: Jason Wang <jasowang@redhat.com>
>
> Acked-by: Michael S. Tsirkin <mst@redhat.com>
Applied, thanks everyone.
^ permalink raw reply
* Re: [net-next V7 PATCH] virtio-net: send gratuitous packets when needed
From: Michael S. Tsirkin @ 2012-04-15 7:12 UTC (permalink / raw)
To: Jason Wang; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <20120412064351.23243.84912.stgit@amd-6168-8-1.englab.nay.redhat.com>
On Thu, Apr 12, 2012 at 02:43:52PM +0800, Jason Wang wrote:
> As hypervior does not have the knowledge of guest network configuration, it's
> better to ask guest to send gratuitous packets when needed.
>
> This patch implements VIRTIO_NET_F_GUEST_ANNOUNCE feature: hypervisor would
> notice the guest when it thinks it's time for guest to announce the link
> presnece. Guest tests VIRTIO_NET_S_ANNOUNCE bit during config change interrupt
> and woule send gratuitous packets through netif_notify_peers() and ack the
> notification through ctrl vq.
>
> We need to make sure the atomicy of read and ack in guest otherwise we may ack
> more times than being notified. This is done through handling the whole config
> change interrupt in an non-reentrant workqueue.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
>
> ---
>
> Changes from v6:
> - move the whole event processing to system_nrt_wq
> - introduce the config_enable and config_lock to synchronize with dev removing
> and pm
> - protect the ack with rtnl_lock
>
> Changes from v5:
> - notify the chain before acking the link annoucement
> - ack the link announcement notification through control vq
>
> Changes from v4:
> - typos
> - handle workqueue unconditionally
> - move VIRTIO_NET_S_ANNOUNCE to bit 8 to separate rw bits from ro bits
>
> Changes from v3:
> - cancel the workqueue during freeze
>
> Changes from v2:
> - fix the race between unregister_dev() and workqueue
> ---
> drivers/net/virtio_net.c | 64 +++++++++++++++++++++++++++++++++++++++++---
> include/linux/virtio_net.h | 14 ++++++++++
> 2 files changed, 73 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 4de2760..23403b6 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -66,12 +66,21 @@ struct virtnet_info {
> /* Host will merge rx buffers for big packets (shake it! shake it!) */
> bool mergeable_rx_bufs;
>
> + /* enable config space updates */
> + bool config_enable;
> +
> /* Active statistics */
> struct virtnet_stats __percpu *stats;
>
> /* Work struct for refilling if we run low on memory. */
> struct delayed_work refill;
>
> + /* Work struct for config space updates */
> + struct work_struct config_work;
> +
> + /* Lock for config space updates */
> + struct mutex config_lock;
> +
> /* Chain pages by the private ptr. */
> struct page *pages;
>
> @@ -781,6 +790,16 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
> return status == VIRTIO_NET_OK;
> }
>
> +static void virtnet_ack_link_announce(struct virtnet_info *vi)
> +{
> + rtnl_lock();
> + if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_ANNOUNCE,
> + VIRTIO_NET_CTRL_ANNOUNCE_ACK, NULL,
> + 0, 0))
> + dev_warn(&vi->dev->dev, "Failed to ack link announce.\n");
> + rtnl_unlock();
> +}
> +
> static int virtnet_close(struct net_device *dev)
> {
> struct virtnet_info *vi = netdev_priv(dev);
> @@ -952,20 +971,31 @@ static const struct net_device_ops virtnet_netdev = {
> #endif
> };
>
> -static void virtnet_update_status(struct virtnet_info *vi)
> +static void virtnet_config_changed_work(struct work_struct *work)
> {
> + struct virtnet_info *vi =
> + container_of(work, struct virtnet_info, config_work);
> u16 v;
>
> + mutex_lock(&vi->config_lock);
> + if (!vi->config_enable)
> + goto done;
> +
> if (virtio_config_val(vi->vdev, VIRTIO_NET_F_STATUS,
> offsetof(struct virtio_net_config, status),
> &v) < 0)
> - return;
> + goto done;
> +
> + if (v & VIRTIO_NET_S_ANNOUNCE) {
> + netif_notify_peers(vi->dev);
> + virtnet_ack_link_announce(vi);
> + }
>
> /* Ignore unknown (future) status bits */
> v &= VIRTIO_NET_S_LINK_UP;
>
> if (vi->status == v)
> - return;
> + goto done;
>
> vi->status = v;
>
> @@ -976,13 +1006,15 @@ static void virtnet_update_status(struct virtnet_info *vi)
> netif_carrier_off(vi->dev);
> netif_stop_queue(vi->dev);
> }
> +done:
> + mutex_unlock(&vi->config_lock);
> }
>
> static void virtnet_config_changed(struct virtio_device *vdev)
> {
> struct virtnet_info *vi = vdev->priv;
>
> - virtnet_update_status(vi);
> + queue_work(system_nrt_wq, &vi->config_work);
> }
>
> static int init_vqs(struct virtnet_info *vi)
> @@ -1076,6 +1108,9 @@ static int virtnet_probe(struct virtio_device *vdev)
> goto free;
>
> INIT_DELAYED_WORK(&vi->refill, refill_work);
> + mutex_init(&vi->config_lock);
> + vi->config_enable = true;
> + INIT_WORK(&vi->config_work, virtnet_config_changed_work);
> sg_init_table(vi->rx_sg, ARRAY_SIZE(vi->rx_sg));
> sg_init_table(vi->tx_sg, ARRAY_SIZE(vi->tx_sg));
>
> @@ -1111,7 +1146,7 @@ static int virtnet_probe(struct virtio_device *vdev)
> otherwise get link status from config. */
> if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
> netif_carrier_off(dev);
> - virtnet_update_status(vi);
> + queue_work(system_nrt_wq, &vi->config_work);
> } else {
> vi->status = VIRTIO_NET_S_LINK_UP;
> netif_carrier_on(dev);
> @@ -1170,10 +1205,17 @@ static void __devexit virtnet_remove(struct virtio_device *vdev)
> {
> struct virtnet_info *vi = vdev->priv;
>
> + /* Prevent config work handler from accessing the device. */
> + mutex_lock(&vi->config_lock);
> + vi->config_enable = false;
> + mutex_unlock(&vi->config_lock);
> +
> unregister_netdev(vi->dev);
>
> remove_vq_common(vi);
>
> + flush_work(&vi->config_work);
> +
> free_percpu(vi->stats);
> free_netdev(vi->dev);
> }
> @@ -1183,6 +1225,11 @@ static int virtnet_freeze(struct virtio_device *vdev)
> {
> struct virtnet_info *vi = vdev->priv;
>
> + /* Prevent config work handler from accessing the device */
> + mutex_lock(&vi->config_lock);
> + vi->config_enable = false;
> + mutex_unlock(&vi->config_lock);
> +
> virtqueue_disable_cb(vi->rvq);
> virtqueue_disable_cb(vi->svq);
> if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ))
> @@ -1196,6 +1243,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
>
> remove_vq_common(vi);
>
> + flush_work(&vi->config_work);
> +
> return 0;
> }
>
> @@ -1216,6 +1265,10 @@ static int virtnet_restore(struct virtio_device *vdev)
> if (!try_fill_recv(vi, GFP_KERNEL))
> queue_delayed_work(system_nrt_wq, &vi->refill, 0);
>
> + mutex_lock(&vi->config_lock);
> + vi->config_enable = true;
> + mutex_unlock(&vi->config_lock);
> +
> return 0;
> }
> #endif
> @@ -1233,6 +1286,7 @@ static unsigned int features[] = {
> VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO,
> VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ,
> VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN,
> + VIRTIO_NET_F_GUEST_ANNOUNCE,
> };
>
> static struct virtio_driver virtio_net_driver = {
> diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
> index 970d5a2..2470f54 100644
> --- a/include/linux/virtio_net.h
> +++ b/include/linux/virtio_net.h
> @@ -49,8 +49,11 @@
> #define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
> #define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
> #define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
> +#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce device on the
> + * network */
>
> #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
> +#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
>
> struct virtio_net_config {
> /* The config defining mac address (if VIRTIO_NET_F_MAC) */
> @@ -152,4 +155,15 @@ struct virtio_net_ctrl_mac {
> #define VIRTIO_NET_CTRL_VLAN_ADD 0
> #define VIRTIO_NET_CTRL_VLAN_DEL 1
>
> +/*
> + * Control link announce acknowledgement
> + *
> + * The command VIRTIO_NET_CTRL_ANNOUNCE_ACK is used to indicate that
> + * driver has recevied
received :)
> the notification; device would clear the
> + * VIRTIO_NET_S_ANNOUNCE bit in the status field after it receives
> + * this command.
> + */
> +#define VIRTIO_NET_CTRL_ANNOUNCE 3
> + #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0
> +
> #endif /* _LINUX_VIRTIO_NET_H */
^ permalink raw reply
* CFP: 13th IEEE/ACM Int. Conf. on Grid Computing (GRID) 2012
From: Ioan Raicu @ 2012-04-14 12:56 UTC (permalink / raw)
To: virtualization
[-- Attachment #1.1: Type: text/plain, Size: 7852 bytes --]
Call for papers
*Grid 2012: 13th IEEE/ACM International Conference on Grid Computing*
Beijing, China
September 20-23, 2012
http://grid2012.meepo.org
Co-located with ChinaGrid'12
Grid computing enables the sharing of distributed computing and data
resources such as processing, network bandwidth and storage capacity to
create a cohesive resource environment for executing distributed
applications. The Grid conference series is an annual international
meeting that brings together a community of researchers, developers,
practitioners, and users involved with Grid technology. The objective of
the meeting is to serve as both the premier venue for presenting
foremost research results in the area and as a forum for introducing and
exploring new concepts.
In 2012, the Grid conference will come to China for the first time and
will be held in Beijing, co-located with ChinaGrid'12. Grid 2012 will
have a focus on important and immediate issues that are significantly
influencing grid computing.
Scope
Grid 2012 topics of interest include, but are not limited to:
* Architecture
* Middleware and toolkits
* Resource management, scheduling, and runtime environments
* Performance modeling and evaluation
* Programming models, tools and environments
* Metadata, ontologies, and provenance
* Cloud computing
* Virtualization and grid computing
* Scientific workflow
* Storage systems and data management
* Data-intensive computing and processing
* QoS and SLA Negotiation
* Applications and experiences in science, engineering, business and
society
Paper Submission
Authors are invited to submit original papers (not published or
currently under review for any other conference or journal). Submitted
manuscripts should not exceed 8 letter size (8.5 x 11) pages including
figures, tables and references using the IEEE format for conference
proceedings. Authors should submit the manuscript in PDF format via
https://www.easychair.org/conferences/?conf=grid12
All submitted papers will be reviewed by program committee members and
selected based on their originality, correctness, technical strength,
significance, quality of presentation, and interest and relevance to the
conference attendees. Accepted papers will be published in the IEEE
categorized conference proceedings and will be made available online
through the IEEE Xplore and the CS Digital Library.
Go to paper submission page... <http://grid2012.meepo.org/submissions.htm>
Important Dates
Papers Submission Due: 15 March 2012 Extended to 15 April 2012.
Notification of Acceptance: 15 May 2012
Camera Ready Papers Due: 15 June 2012
Committees
Organising Committee
* *General Co-Chairs:*
o Dieter Kranzlmueller, Ludwig-Maximilians-Universität, Germany
o Weimin Zheng, Tsinghua University, China
* *Programme Co-Chairs:*
o Rajkumar Buyya, University of Melbourne, Australia
o Hai Jin, Huazhong University of Science and Technology, China
* *Local Organization Chair:* Yongwei Wu, Tsinghua University, China
* *Finance Chair:* Kang Chen, Tsinghua University, China
Programme Committee (To be comfirmed)
* *Programme Co-Chairs:*
o Rajkumar Buyya, University of Melbourne, Australia
o Hai Jin, Huazhong University of Science and Technology, China
* *Workshop & Poster Chair:* Jinlei Jiang, Tsinghua University, China
* *Vice Chair -- Clouds and Virtualisation: * Roger Barga, Microsoft
Research
* *Vice Chair -- Distributed Production Cyberinfrastructure and
Middleware:* Andrew Grimshaw, Univ. of Virginia, US
* *Vice Chair -- e-Research and Applications:* Daniel S. Katz, Univ.
of Chicago & Argonne National Laboratory, US
* *Vice Chair -- Tools & Services, Resource Management & Runtime
Environments:* Ramin Yahyapour, Dortmund
* *Vice Chair -- Distributed Data-Intensive Science and Systems:*
Erwin Laure, KTH, Sweeden
* *Publishing Chair: *Ran Zheng, Huazhong University of Science and
Technology, China
* *Publicity Chairs:*
o Gilles Fedak, INRIA/LIP, France
o Ioan Raicu, Illinois Institute of Technology and Argonne
National Laboratory, USA
o Xuanhua Shi, Huazhong University of Science and Technology, China
* *Program Committe:*
o David Abramson, Monash University, Australia
o Gabrielle Allen, Louisiana State University, USA
o Andreas Aschenbrenner, Austrian Academy of Sciences
o David Bader, Georgia Institute of Technology, USA
o Rosa Badia, UPC, Spain
o Henri Bal, Vrije Universiteit, Netherlands
o Chaitanya Baru, San Diego Supercomputer Center, US
o Eloisa Bentivegna, Max Planck Institute for Gravitational
Physics, Germany
o Ignacio Blanquer, Universidad Politécnica de Valencia, Spain
o Jinlei Jiang, Tsinghua University, China
o Neil Chue Hong, EPCC, UK
o Marco Danelutto, Università di Pisa, Italy
o Eva Deelman, ISI, USC , US
o Frederic Desprez, INRIA-LIP, France
o Jim Dowling, SICS, Sweden
o Jaliya Ekanayake, Microsoft Research, US
o Erik Elmroth, Umeå University, Sweden
o Vangelis Floros, GRNET, Greece
o Ian Foster, Univ. of Chicago, US
o Patrick Fuhrmann, DESY, DE
o Kang Chen, Tsinghua University, China
o Rob Gillen, Oak Ridge National Laboratory , US
o Marty Humphrey, University of Virginia, US
o Jens Jensen, STFC, UK
o Kate Keahey, Argonne National Laboratory, US
o Thilo Kielmann, Vrije Universiteit, The Netherlands
o Bastian Koller, HLRS, Germany
o Tevfik Kosar, University at Buffalo, US
o Nicolas Kourtellis, University of South Florida, USA
o Patricia Kovatch, University of Tennessee, USA
o Dieter Kranzlmüller, Ludwig-Maximilians-Universität München, Germany
o Peter Kunszt, SystemsX, Switzerland
o Miron Livny, Univ. of Wisconsin, US
o Hideo Matsuda, University of Osaka, Japan
o Satoshi Matsuoka, Tokyo Institute of Technology, Japan
o Jim Myers, Rensselaer Polytechnic Institute, US
o Steven Newhouse, EGI, NL
o Manish Parashar, Rutgers, USA
o Judy Qiu, Indiana University, US
o Ioan Raicu, Illinois Institute of Technology and Argonne
National Laboratory, USA
o Alistair Rendell, Australian National University, Australia
o Karolina Sarnowska-Upton, Univ. of Virginia, US
o Heiko Schuldt, Basel University, Switzerland
o Richard Sinnott, University of Melbourne, Australia
o Alan Sill, Texas-Tech, US
o Alex Sim, LBL, US
o Mark Stillwell, INRIA-Université de Lyon-LIP, France
o Alan Sussman, University of Maryland, USA
o Osamu Tatebe, Tsukuba University, Japan
o Domenico Talia, Università della Calabria, Italiy
o Douglas Thain, University of Notre Dame, US
o David Wallom, Oxford University, UK
--
=================================================================
Ioan Raicu, Ph.D.
Assistant Professor, Illinois Institute of Technology (IIT)
Guest Research Faculty, Argonne National Laboratory (ANL)
=================================================================
Data-Intensive Distributed Systems Laboratory, CS/IIT
Distributed Systems Laboratory, MCS/ANL
=================================================================
Cel: 1-847-722-0876
Office: 1-312-567-5704
Email: iraicu@cs.iit.edu
Web: http://www.cs.iit.edu/~iraicu/
Web: http://datasys.cs.iit.edu/
=================================================================
=================================================================
[-- Attachment #1.2: Type: text/html, Size: 11975 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* Call for Participation: Cloud Futures 2012, Berkeley, CA (May 7-8)
From: Ioan Raicu @ 2012-04-14 12:42 UTC (permalink / raw)
To: virtualization
In-Reply-To: <BCEC1DFDD823594BBCECE11F20CD142A03F940@TK5EX14MBXC129.redmond.corp.microsoft.com>
[-- Attachment #1.1: Type: text/plain, Size: 6874 bytes --]
*//*
*//*
*/Cloud Futures: Hot Topics in Research and Education/*
Berkeley, CA | May 7-8, 2012
http://research.microsoft.com/cloudfutures2012/
The Cloud Futures Workshop series brings together thought leaders from
academia, industry, and government to discuss the role of cloud
computing across a variety of research and educational areas---including
computer science, engineering, Earth sciences, healthcare, humanities,
interactive games, life sciences, and social sciences.Presentations,
posters and discussions will highlight how new techniques, software
platforms, and methods of research and teaching in the cloud may solve
distinct challenges arising in those diverse areas.
This year's Workshop is being hosted in conjunction with UC Berkeley.
Conference Co-Chairs: Michael Franklin, UC Berkeley and Tony Hey,
Microsoft Research
*Register today!
<https://www.ustechsregister.com/cloudfutures/default.aspx?pageid=3232>*
Program:
Day 1 Monday 05/07/2012
09:00 - 10:00 Keynote. Science In the Cloud, Joseph Hellerstein,
Manager Big Science, Google_
10:00 - 10:30 Break
10:30 - 12:00 plenary session
·10:30 -- 11:00 Advancing Declarative Query for Data-Intensive Science
in the Cloud, Bill Howe, University of Washington
·11:00 -- 11:30 Programming Paradigms for Technical Computing on Clouds
and Supercomputers, Geoffrey Fox, Indiana University, Dennis Gannon,
Microsoft
·11:30 -- 12:00 Cloud Computing for Fundamental Spatial Operations on
Polygonal GIS Data, Sushil Prasad, Dinesh Agarwal, Satish Puri, Xi He,
Georgia State University
12:00 - 02:00 Lunch Posters
02:00 - 3:30 Session 1a Education
·02:00 -- 2:30 InstantLab 2.0 - A Platform for Operating System
Experiments on Public Cloud Infrastructure, Andreas Polze, Christian
Neuhaus, Rehab Alnemr, Lysann Kessler and Frank Schlegel, University of
Potsdam
·02:30 -- 3:00 Case Study on Cloud Computing Infusion at a Leading
Tertiary Institution in Singapore, Choong Wu Gary Lim, Nanyang Polytechnic
·03:00 -- 3:30 Teaching Web-scale Data Management using Microsoft Azure:
POSTECH Experiences, Seung-won Hwang, POSTECH
02:00 -- 3:30 Session 1b Life Sciences
·02:00 -- 2:30 A-Brain: Using the Cloud to Understand the Impact of
Genetic Variability on the Brain, Alexandru Costan, Radu Tudoran,
Benoit Da Mota, Gabriel Antoniu and Bertrand Thirion, INRIA Rennes and
Saclay
·02:30 -- 3:00 Very Large Scale Operon Predictions via Comparative
Genomics, Ehsan Tabari, ZhengChang Su, UNC Charlotte
·03:00 -- 3:30 Fast Exploration of the QSAR Model Space with e-Science
Central and Windows Azure, Jacek Cala, Hugo Hiden, Simon Woodman, Paul
Watson, Newcastle University
03:30 - 04:00 Break
04:00 - 05:30 Session 1c Interactive Services
·04:00 -- 4:30 3D Remote Collaboration Framework for Virtual Cultural
Heritage, Yasuhide Okamoto, Gregorij Kurillo, Ruzena Bajcsy University
of California, Berkeley, Takeshi Oishi, Katsushi Ikeuchi , University
of Tokyo
·04:30 -- 5:00 Interactive 3D Services over Windows Azure, Lukas Kencl,
Jiri Danihelka , Czech Technical University , Prague
·05:00 -- 5:30 Microsoft Azure and the Kinect Join the World of
Telemedicine to Save Lives, Janet Bailey, Aaron Rothberg, University of
Arkansas, Bradley Jensen, Microsoft
04:00 -- 05:30 Session 1d Environmental Applications
·04:00 -- 4:30 Cloud-based Exploration of Complex Ecosystems for
Science, Education and Entertainment, Ilmi Yoon, Sangyuk Yoon, Gary Ng,
Hunvil Rodrigues, Sonal Mahajan, San Francisco State University, Neo
Martinez, Pacific Ecoinformatics Lab
·04:30 -- 5:00 Cloud Computing as a Cyber-Infrastructure for Mass
Customization and Collaboration, Kwa-Sur Tam, Virginia Tech
·05:00 -- 5:30 Green Prefab: Civil Engineering Hub In Ms Windows Azure,
Furio Barzon, Collaboratorio, Italy
06:00-09:00 Dinner
Day 2 Tuesday 05/08/2012
09:00 - 10:00 Keynote, Yousef Khalidi, Distinguished Engineer, Microsoft
Corporation, Large Scale Cloud Computing: Opportunities and Challenges
10:00 - 10:30 Break
10:30 - 12:00 Plenary Session
·10:30 -- 11:00 Vision Paper: Towards an Understanding of the Limits of
Map-Reduce Computation, Anish Das Sarma, Google Research, Semih
Salihogluz, Jeffrey D. Ullman, Stanford University, Foto Afrati,
National Technical University Athens
·11:00 -- 11:30 Twister4Azure: Parallel Data Analytics on Azure, Judy
Qiu, Thilina Gunarathne, Indiana University
·11:30 -- 12:00 CumuloNimbo: Parallel-Distributed Transactional
Processing, Ricardo Jimenez-Peris, Marta Patiño-Martínez, Iván
Brondino, Universidad Politecnica de Madrid, José Pereira, Rui
Oliveira, Ricardo Vilaça, University Minho, Bettina Kemme, Yousuf Ahmad,
McGill Univ.
12:00 - 02:00 Lunch Posters
02:00 - 3:30 Session 2a Social and Mobile Services
·02:00 -- 2:30 An Efficient Meet-Up Mechanism by Mashing-up Social and
Mobile Clouds, Li-Chun Wang, Chia-Yu Lin, Yu-Jia Chen, Yu-Chee Tseng,
National Chiao Tung University
·02:30 -- 3:00 Scalable, Secure Analysis of Social Sciences Data on the
Azure Platform, Yogesh Simmhan, Litao Den, Alok Kumbhare, Mark Redekopp
and Viktor Prasanna, University of Southern California
·03:00 -- 3:30 Remote Software Service for Mobile Clients leveraging
Cloud Computing, Chunming Hu, Beihang University
02:00 -- 3:30 Session 2b Computational Models and applications
·02:00 -- 2:30 Enabling cloud interoperability with COMPSs, Daniele
Lezzi, Fabrizio Marozzo, Francesc Lordan, Roger Rafanell, Rosa Badia,
Barcelona Supercomputer Center, Domenico Talia, University of Calabria
·02:30 -- 3:00 McCloud: Monte Carlo Service in Windows Azure, Rafael
Nasser, Karin Breitman, Rubens Sampaio, Americo Cunha, Helio Vieira,
PUC-Rio
·03:00 -- 3:30 Experiences using Windows Azure to Calibrate Watershed
Models, Marty Humphrey, Norm Beekwilder, University of Virginia, Jon
Goodall, Mehmet Ercan, University of South Carolina
03:30 - 04:00 Break
04:00 - 05:30 Panel TBD
05:30 - Close
--
=================================================================
Ioan Raicu, Ph.D.
Assistant Professor, Illinois Institute of Technology (IIT)
Guest Research Faculty, Argonne National Laboratory (ANL)
=================================================================
Data-Intensive Distributed Systems Laboratory, CS/IIT
Distributed Systems Laboratory, MCS/ANL
=================================================================
Cel: 1-847-722-0876
Office: 1-312-567-5704
Email:iraicu@cs.iit.edu
Web:http://www.cs.iit.edu/~iraicu/
Web:http://datasys.cs.iit.edu/
=================================================================
=================================================================
[-- Attachment #1.2.1: Type: text/html, Size: 37633 bytes --]
[-- Attachment #1.2.2: Type: image/jpeg, Size: 4462 bytes --]
[-- Attachment #2: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* Call for Participation: ACM HPDC 2012
From: Ioan Raicu @ 2012-04-14 12:14 UTC (permalink / raw)
To: virtualization
(Please accept our apologies if you receive this message multiple times)
**** CALL FOR PARTICIPATION ****
***************************************************************
*** ** EARLY REGISTRATION DEADLINE: May 25, 2012 (CET) ** ***
***************************************************************
The 21st International ACM Symposium on
High-Performance Parallel and Distributed Computing
(HPDC'12)
Delft University of Technology, Delft, the Netherlands
June 18-22, 2012
http://www.hpdc.org/2012
The ACM International Symposium on High-Performance Parallel and
Distributed Computing (HPDC)
is the premier annual conference on the design, the implementation, the
evaluation, and
the use of parallel and distributed systems for high-end computing.
HPDC'12 will take place
in Delft, the Netherlands, a historical, picturesque city that is less
than one hour away
from Amsterdam-Schiphol airport. The conference will be held on June
20-22 (Wednesday to
Friday 1 PM), with affiliated workshops taking place on June 18-19
(Monday and Tuesday).
**** MAIN CONFERENCE FEATURES ****
- High-quality single-track paper sessions
- Two keynote presentations
- Achievement Award talk (new in HPDC!)
- Poster session plus conference reception
- Seven workshops
- Visit to Museum de Prinsenhof in Delft
- Conference dinner in the historical place De Prinsenkelder in Delft
**** CONFERENCE PROGRAM ****
The program of the conference will be posted by mid-april on the
conference website.
**** KEYNOTE SPEAKERS (titles and abstracts will be posted online) ****
Ricardo Bianchini, Rutgers University, USA
Mihai Budiu, Microsoft Research, USA
**** ACHIEVEMENT AWARD TALK (title and abstract will be posted online) ****
Ian Foster, University of Chicago and Argonne National Laboratory, USA
**** CALL FOR POSTERS ****
HPDC'12 offers conference attendees the opportunity to participate in
the poster session on
Wednesday afternoon. For details on how to submit a poster, please
consult the conference website.
**** HPDC 2012 GENERAL CHAIR ****
Dick Epema, Delft University of Technology, Delft, the Netherlands
**** HPDC 2012 PROGRAM CO-CHAIRS ****
Thilo Kielmann, Vrije Universiteit, Amsterdam, the Netherlands
Matei Ripeanu, The University of British Columbia, Vancouver, Canada
**** HPDC 2012 WORKSHOPS CHAIR ****
Alexandru Iosup, Delft University of Technology, Delft, the Netherlands
**** HPDC 2012 POSTERS CHAIR ****
Ana Varbanescu, Delft University of Technology, Delft, the Netherlands
**** EARLY REGISTRATION DEADLINE ****
May 25, 2012 (CET)
**** VENUE ****
The HPDC'12 conference will be held on the campus of Delft University
of Technology, which was founded in 1842 by King William II and which is the
oldest and largest technical university in the Netherlands. It is well
established as one of the leading technical universities in the world.
Delft is a small, historical town dating back to the 13th century. Delft has
many old buildings and small canals, and it has a lively atmosphere. The
city
offers a large variety of hotels and restaurants. Many other places of
interest
(e.g., Amsterdam and The Hague) are within one hour distance of traveling.
Traveling to Delft is easy. Delft is close to Amsterdam Schiphol Airport
(60 km, 45 min by train), which has direct connections from all major
airports
in the world. Delft also has excellent train connections to the rest of
Europe.
--
=================================================================
Ioan Raicu, Ph.D.
Assistant Professor, Illinois Institute of Technology (IIT)
Guest Research Faculty, Argonne National Laboratory (ANL)
=================================================================
Data-Intensive Distributed Systems Laboratory, CS/IIT
Distributed Systems Laboratory, MCS/ANL
=================================================================
Cel: 1-847-722-0876
Office: 1-312-567-5704
Email: iraicu@cs.iit.edu
Web: http://www.cs.iit.edu/~iraicu/
Web: http://datasys.cs.iit.edu/
=================================================================
=================================================================
^ permalink raw reply
* Call for Posters: The 21st Int. ACM Symp. on High-Performance Parallel and Distributed Computing (HPDC'12)
From: Ioan Raicu @ 2012-04-14 12:13 UTC (permalink / raw)
To: virtualization
**** CALL FOR POSTERS ****
The 21st International ACM Symposium on
High-Performance Parallel and Distributed Computing
(HPDC'12)
Delft University of Technology, Delft, the Netherlands
June 18-22, 2012
http://www.hpdc.org/2012
The ACM International Symposium on High-Performance Parallel and
Distributed Computing (HPDC)
is the premier annual conference on the design, the implementation, the
evaluation, and
the use of parallel and distributed systems for high-end computing.
HPDC'12 will take place
in Delft, the Netherlands, a historical, picturesque city that is less
than one hour away
from Amsterdam-Schiphol airport. The conference will be held on June
20-22 (Wednesday to
Friday), with affiliated workshops taking place on June 18-19 (Monday
and Tuesday).
HPDC'12 will feature a poster session that will provide the right
environment for lively and
informal discussions on various high performance parallel and
distributed computing
topics.
We invite all potential authors to submit their contribution for this
poster session in the form of
a two-page PDF abstract (we recommend using the ACM Proceedings style,
and fonts not smaller than 10 point).
Posters may be accompanied by practical demonstrations.
Abstracts must be submitted by sending an email to:
hpdc-2012-posters@gmail.com before May 15th 2012, 23:59 CET.
Participating posters will be selected based on the following criteria:
* Submissions must describe new, interesting ideas on any HPDC
topics of interest.
* Submissions can present work in progress, but we strongly
encourage the authors to include preliminary
experimental results, if available.
* Student submissions meeting the above criteria will be given
preference.
Please provide the following information in your PDF file:
* Poster title.
* Author names, affiliations, and email addresses.
* Note which authors, if any, are students.
* Indicate if you plan to set up a demo with your poster (the
authors and organizers need to agree that
the requirements for the demo to function can be met at the site of
the poster exhibition).
Authors will be notified of acceptance or rejection via e-mail by May
20th, 2012. No reviews will be provided.
Posters will be published online on the conference Web site. Each poster
will also have an A0 panel
in a poster exhibition area, which will also include posters of the HPDC
accepted papers.
The poster session will be held on Wednesday, June 20, in the late
afternoon, and it will start with a poster
advertising session, during which the author(s) of each poster will give
a very short presentation (2 slides,
1-2 minutes) of their poster. Following these presentations, the poster
exhibition will be opened for visiting
and, we hope, for fruitful discussions. Therefore, we kindly request at
least one author of each poster to be
present throughout the entire session.
For any questions about the submission, selection, and presentation of
the accepted posters, please
contact the Poster Session Chair - Ana Lucia Varbanescu, Delft
University of Technology, The Netherlands.
--
=================================================================
Ioan Raicu, Ph.D.
Assistant Professor, Illinois Institute of Technology (IIT)
Guest Research Faculty, Argonne National Laboratory (ANL)
=================================================================
Data-Intensive Distributed Systems Laboratory, CS/IIT
Distributed Systems Laboratory, MCS/ANL
=================================================================
Cel: 1-847-722-0876
Office: 1-312-567-5704
Email: iraicu@cs.iit.edu
Web: http://www.cs.iit.edu/~iraicu/
Web: http://datasys.cs.iit.edu/
=================================================================
=================================================================
^ permalink raw reply
* Re: [net-next V7 PATCH] virtio-net: send gratuitous packets when needed
From: David Miller @ 2012-04-13 17:38 UTC (permalink / raw)
To: jasowang; +Cc: netdev, mst, linux-kernel, virtualization
In-Reply-To: <20120412064351.23243.84912.stgit@amd-6168-8-1.englab.nay.redhat.com>
From: Jason Wang <jasowang@redhat.com>
Date: Thu, 12 Apr 2012 14:43:52 +0800
> As hypervior does not have the knowledge of guest network configuration, it's
> better to ask guest to send gratuitous packets when needed.
>
> This patch implements VIRTIO_NET_F_GUEST_ANNOUNCE feature: hypervisor would
> notice the guest when it thinks it's time for guest to announce the link
> presnece. Guest tests VIRTIO_NET_S_ANNOUNCE bit during config change interrupt
> and woule send gratuitous packets through netif_notify_peers() and ack the
> notification through ctrl vq.
>
> We need to make sure the atomicy of read and ack in guest otherwise we may ack
> more times than being notified. This is done through handling the whole config
> change interrupt in an non-reentrant workqueue.
>
> Signed-off-by: Jason Wang <jasowang@redhat.com>
Michael, Rusty, et al.?
^ permalink raw reply
* Re: [PATCH] skbuff: struct ubuf_info callback type safety
From: David Miller @ 2012-04-13 17:09 UTC (permalink / raw)
To: mst
Cc: ian.campbell, eric.dumazet, netdev, linux-kernel, virtualization,
kvm, shemminger, xma
In-Reply-To: <20120409102402.GA5255@redhat.com>
From: "Michael S. Tsirkin" <mst@redhat.com>
Date: Mon, 9 Apr 2012 13:24:02 +0300
> The skb struct ubuf_info callback gets passed struct ubuf_info
> itself, not the arg value as the field name and the function signature
> seem to imply. Rename the arg field to ctx to match usage,
> add documentation and change the callback argument type
> to make usage clear and to have compiler check correctness.
>
> Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Applied, thanks for fixing this Michael.
^ permalink raw reply
* Re: virtio message framing
From: Anthony Liguori @ 2012-04-13 15:48 UTC (permalink / raw)
To: Stefan Hajnoczi; +Cc: Michael S. Tsirkin, Linux Virtualization
In-Reply-To: <CAJSP0QWPih2NmRvF3D-HXEH72t3pvvywoes-_wv2dAjHKg8Fjg@mail.gmail.com>
On 04/13/2012 09:50 AM, Stefan Hajnoczi wrote:
> The virtio specification says:
>
> "The descriptors used for a buff^[er should not eff^[ect the semantics
> of the message,
> except for the total length of the bu^[ffer"
>
> and
>
> "In particular, no implementation should use the descriptor boundaries
> to determine the size of any header in a request"
This was the noble intention but all of the implementations actually rely on
boundary sizes.
Both QEMU and lguest rely on boundary sizes. We've removed some of it in
virtio-net in QEMU but it still looks like it's there for virtio-blk.
kvm tool also makes this assumption.
> Why should descriptor layout not be specified?
>
> It seems that implementing arbitrary descriptor layout support (e.g.
> 1-byte descriptors) requires more code and makes input validation
> harder.
>
> Why bother with the flexibility of unspecified descriptor layouts? As
> long as the layout is specified clearly it makes everyone's lives
> easier to use a strict descriptor layout.
I hate to just change the spec here but I don't see a better option.
Regards,
Anthony Liguori
>
> The only reason I can think of is that virtio should work over
> transports that do not have the concept of "descriptors" (non-vring
> transports like pipes or streams).
>
> Stefan
>
^ permalink raw reply
* virtio message framing
From: Stefan Hajnoczi @ 2012-04-13 14:50 UTC (permalink / raw)
To: Linux Virtualization; +Cc: Anthony Liguori, Michael S. Tsirkin
The virtio specification says:
"The descriptors used for a buff^[er should not eff^[ect the semantics
of the message,
except for the total length of the bu^[ffer"
and
"In particular, no implementation should use the descriptor boundaries
to determine the size of any header in a request"
Why should descriptor layout not be specified?
It seems that implementing arbitrary descriptor layout support (e.g.
1-byte descriptors) requires more code and makes input validation
harder.
Why bother with the flexibility of unspecified descriptor layouts? As
long as the layout is specified clearly it makes everyone's lives
easier to use a strict descriptor layout.
The only reason I can think of is that virtio should work over
transports that do not have the concept of "descriptors" (non-vring
transports like pipes or streams).
Stefan
^ permalink raw reply
* Re: [PATCH 3/3] virtio_balloon: Bugfixes for PAGE_SIZE != 4k
From: David Gibson @ 2012-04-13 3:12 UTC (permalink / raw)
To: Michael S. Tsirkin; +Cc: qemu-devel, paulus, linux-kernel, virtualization
In-Reply-To: <20120412101157.GA13172@redhat.com>
On Thu, Apr 12, 2012 at 01:14:06PM +0300, Michael S. Tsirkin wrote:
> On Thu, Apr 12, 2012 at 03:36:35PM +1000, David Gibson wrote:
[snip]
> Good catch!
>
> Unfortunately I find the approach a bit convoluted.
> It also looks like when host asks for 5 balloon pages
> you interpret this as 0 where 16 is probably saner
> on a 64K system.
Hm, true. Although qemu at least actuall operates in units of
megabytes on the balloon, so I doubt it matters much in practice.
> I think it's easier if we just keep doing math in
> balloon pages. I also get confused by shift operations,
> IMO / and * are clearer where they are applicable.
> Something like the below would make more sense I think.
Sure. I thught working in local pages was clearer, but I don't really
care.
> I also wrote up a detailed commit log, so we have
> the bugs and the expected consequences listed explicitly.
>
> I'm out of time for this week - so completely untested, sorry.
> Maybe you could try this out? That would be great.
> Thanks!
Your patch has numerous syntax errors, but once those are fixed seems
to work fine with a 64k ppc64 kernel. Fixed version below. I did add
one comment, to note that with this change the num_pages field in the
vb is no longer the same as the number of elements in the pages list.
Nothing in the code relies on that, but it would probably be the first
assumption of someone looking at the structure definition.
Please apply.
From cf62f576ae1b26426d9325da08826e39db7031a1 Mon Sep 17 00:00:00 2001
From: David Gibson <david@gibson.dropbear.id.au>
Date: Fri, 13 Apr 2012 12:57:40 +1000
Subject: [PATCH] virtio_balloon: fix handling of PAGE_SIZE != 4k
As reported by David Gibson, current code handles PAGE_SIZE != 4k
completely wrong which can lead to guest memory corruption errors.
- page_to_balloon_pfn is wrong: e.g. on system with 64K page size
it gives the same pfn value for 16 different pages.
- we also need to convert back to linux pfns when we free.
- for each linux page we need to tell host about multiple balloon
pages, but code only adds one pfn to the array.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
---
drivers/virtio/virtio_balloon.c | 44 +++++++++++++++++++++++++++++++--------
1 file changed, 35 insertions(+), 9 deletions(-)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 9e95ca6..0c0c1c3 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -43,6 +43,9 @@ struct virtio_balloon
struct completion acked;
/* The pages we've told the Host we're not using. */
+ /* Note that num_pages is measured in 4k balloon pages, so if
+ * PAGE_SIZE != 4k, it will be a multiple of the actual number
+ * of elements in the pages list */
unsigned int num_pages;
struct list_head pages;
@@ -60,13 +63,23 @@ static struct virtio_device_id id_table[] = {
{ 0 },
};
+/* Balloon device works in 4K page units. So each page is
+ * pointed to by multiple balloon pages. */
+#define VIRTIO_BALLOON_PAGES_PER_PAGE (PAGE_SIZE >> VIRTIO_BALLOON_PFN_SHIFT)
+
static u32 page_to_balloon_pfn(struct page *page)
{
unsigned long pfn = page_to_pfn(page);
BUILD_BUG_ON(PAGE_SHIFT < VIRTIO_BALLOON_PFN_SHIFT);
/* Convert pfn from Linux page size to balloon page size. */
- return pfn >> (PAGE_SHIFT - VIRTIO_BALLOON_PFN_SHIFT);
+ return pfn * VIRTIO_BALLOON_PAGES_PER_PAGE;
+}
+
+static struct page *balloon_pfn_to_page(u32 pfn)
+{
+ BUG_ON(pfn % VIRTIO_BALLOON_PAGES_PER_PAGE);
+ return pfn_to_page(pfn / VIRTIO_BALLOON_PAGES_PER_PAGE);
}
static void balloon_ack(struct virtqueue *vq)
@@ -96,12 +109,23 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
wait_for_completion(&vb->acked);
}
+static void set_page_pfns(u32 pfns[], struct page *page)
+{
+ unsigned int i;
+
+ /* Set balloon pfns pointing at this page.
+ * Note that the first pfn points at start of the page. */
+ for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++)
+ pfns[i] = page_to_balloon_pfn(page) + i;
+}
+
static void fill_balloon(struct virtio_balloon *vb, size_t num)
{
/* We can only do one array worth at a time. */
num = min(num, ARRAY_SIZE(vb->pfns));
- for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
+ for (vb->num_pfns = 0; vb->num_pfns < num;
+ vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) {
struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY |
__GFP_NOMEMALLOC | __GFP_NOWARN);
if (!page) {
@@ -113,9 +137,9 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
msleep(200);
break;
}
- vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page);
+ set_page_pfns(vb->pfns + vb->num_pfns, page);
+ vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE;
totalram_pages--;
- vb->num_pages++;
list_add(&page->lru, &vb->pages);
}
@@ -130,8 +154,9 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
{
unsigned int i;
- for (i = 0; i < num; i++) {
- __free_page(pfn_to_page(pfns[i]));
+ /* Find pfns pointing at start of each page, get pages and free them. */
+ for (i = 0; i < num; i += VIRTIO_BALLOON_PAGES_PER_PAGE) {
+ __free_page(balloon_pfn_to_page(pfns[i]));
totalram_pages++;
}
}
@@ -143,11 +168,12 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num)
/* We can only do one array worth at a time. */
num = min(num, ARRAY_SIZE(vb->pfns));
- for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
+ for (vb->num_pfns = 0; vb->num_pfns < num;
+ vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE) {
page = list_first_entry(&vb->pages, struct page, lru);
list_del(&page->lru);
- vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page);
- vb->num_pages--;
+ set_page_pfns(vb->pfns + vb->num_pfns, page);
+ vb->num_pages -= VIRTIO_BALLOON_PAGES_PER_PAGE;
}
/*
--
1.7.9.5
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
^ permalink raw reply related
* Re: [PATCH 4/4] virtio_blk: use disk_name_format() to support mass of disks naming
From: Jeff Garzik @ 2012-04-12 20:17 UTC (permalink / raw)
To: Tejun Heo
Cc: Jens Axboe, KVM, SCSI, Michael S. Tsirkin, LKML, VIRTUAL,
Ren Mingxin
In-Reply-To: <20120330152606.GB28934@google.com>
On 03/30/2012 11:26 AM, Tejun Heo wrote:
> If we're gonna move it to block layer, let's add big blinking red
> comment saying "don't ever use it for any new driver".
Big ACK to that...
^ permalink raw reply
* Re: [PATCH 3/3] virtio_balloon: Bugfixes for PAGE_SIZE != 4k
From: Michael S. Tsirkin @ 2012-04-12 10:14 UTC (permalink / raw)
To: David Gibson; +Cc: qemu-devel, paulus, linux-kernel, virtualization
In-Reply-To: <1334208995-29985-4-git-send-email-david@gibson.dropbear.id.au>
On Thu, Apr 12, 2012 at 03:36:35PM +1000, David Gibson wrote:
> The virtio_balloon device is specced to always operate on 4k pages. The
> virtio_balloon driver has a feeble attempt at reconciling this with a
> lerge kernel page size, but it is (a) exactly wrong (it shifts the pfn in
> the wrong direction) and (b) insufficient (it doesn't issue multiple 4k
> balloon requests for each guest page, or correct other accounting values
> for the different in page size).
>
> This patch fixes the various problems. It has been tested with a powerpc
> guest kernel configured for 64kB base page size, running under qemu.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> drivers/virtio/virtio_balloon.c | 32 ++++++++++++++++++++------------
> 1 file changed, 20 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 553cc1f..834b7f9 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -60,13 +60,20 @@ static struct virtio_device_id id_table[] = {
> { 0 },
> };
>
> -static u32 page_to_balloon_pfn(struct page *page)
> +#define BALLOON_PAGE_ORDER (PAGE_SHIFT - VIRTIO_BALLOON_PFN_SHIFT)
> +#define PAGES_PER_ARRAY(_a) (ARRAY_SIZE(_a) >> BALLOON_PAGE_ORDER)
> +
> +static void page_to_balloon_pfns(u32 pfns[], unsigned int n, struct page *page)
> {
> - unsigned long pfn = page_to_pfn(page);
> + unsigned long bpfn = page_to_pfn(page) << BALLOON_PAGE_ORDER;
> + u32 *p = &pfns[n << BALLOON_PAGE_ORDER];
> + int i;
>
> BUILD_BUG_ON(PAGE_SHIFT < VIRTIO_BALLOON_PFN_SHIFT);
> - /* Convert pfn from Linux page size to balloon page size. */
> - return pfn >> (PAGE_SHIFT - VIRTIO_BALLOON_PFN_SHIFT);
> +
> + /* Enter a balloon pfn for each 4k subpage of the Linux page */
> + for (i = 0; i < (1 << BALLOON_PAGE_ORDER); i++)
> + p[i] = bpfn + i;
> }
>
> static void balloon_ack(struct virtqueue *vq)
> @@ -84,7 +91,8 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq,
> {
> struct scatterlist sg;
>
> - sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * n);
> + sg_init_one(&sg, vb->pfns,
> + sizeof(vb->pfns[0]) * (n << BALLOON_PAGE_ORDER));
>
> init_completion(&vb->acked);
>
> @@ -102,7 +110,7 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
> unsigned int n;
>
> /* We can only do one array worth at a time. */
> - num = min(num, ARRAY_SIZE(vb->pfns));
> + num = min(num, PAGES_PER_ARRAY(vb->pfns));
>
> for (n = 0; n < num; n++) {
> struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY |
> @@ -116,7 +124,7 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
> msleep(200);
> break;
> }
> - vb->pfns[n] = page_to_balloon_pfn(page);
> + page_to_balloon_pfns(vb->pfns, n, page);
> totalram_pages--;
> vb->num_pages++;
> list_add(&page->lru, &vb->pages);
> @@ -134,7 +142,7 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
> unsigned int i;
>
> for (i = 0; i < num; i++) {
> - __free_page(pfn_to_page(pfns[i]));
> + __free_page(pfn_to_page(pfns[i << BALLOON_PAGE_ORDER]));
> totalram_pages++;
> }
> }
> @@ -145,12 +153,12 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num)
> unsigned int n;
>
> /* We can only do one array worth at a time. */
> - num = min(num, ARRAY_SIZE(vb->pfns));
> + num = min(num, PAGES_PER_ARRAY(vb->pfns));
>
> for (n = 0; n < num; n++) {
> page = list_first_entry(&vb->pages, struct page, lru);
> list_del(&page->lru);
> - vb->pfns[n] = page_to_balloon_pfn(page);
> + page_to_balloon_pfns(vb->pfns, n, page);
> vb->num_pages--;
> }
>
> @@ -244,13 +252,13 @@ static inline s64 towards_target(struct virtio_balloon *vb)
> vb->vdev->config->get(vb->vdev,
> offsetof(struct virtio_balloon_config, num_pages),
> &v, sizeof(v));
> - target = le32_to_cpu(v);
> + target = le32_to_cpu(v) >> BALLOON_PAGE_ORDER;
> return target - vb->num_pages;
> }
>
> static void update_balloon_size(struct virtio_balloon *vb)
> {
> - __le32 actual = cpu_to_le32(vb->num_pages);
> + __le32 actual = cpu_to_le32(vb->num_pages << BALLOON_PAGE_ORDER);
>
> vb->vdev->config->set(vb->vdev,
> offsetof(struct virtio_balloon_config, actual),
> --
> 1.7.9.5
Good catch!
Unfortunately I find the approach a bit convoluted.
It also looks like when host asks for 5 balloon pages
you interpret this as 0 where 16 is probably saner
on a 64K system.
I think it's easier if we just keep doing math in
balloon pages. I also get confused by shift operations,
IMO / and * are clearer where they are applicable.
Something like the below would make more sense I think.
I also wrote up a detailed commit log, so we have
the bugs and the expected consequences listed explicitly.
I'm out of time for this week - so completely untested, sorry.
Maybe you could try this out? That would be great.
Thanks!
--->
virtio_balloon: fix handling of PAGE_SIZE != 4k
As reported by David Gibson, current code handles PAGE_SIZE != 4k
completely wrong which can lead to guest memory corruption errors.
- page_to_balloon_pfn is wrong: e.g. on system with 64K page size
it gives the same pfn value for 16 different pages.
- we also need to convert back to linux pfns when we free.
- for each linux page we need to tell host about multiple balloon
pages, but code only adds one pfn to the array.
Warning: patch is completely untested.
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
---
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 9e95ca6..e641e35 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -60,13 +60,23 @@ static struct virtio_device_id id_table[] = {
{ 0 },
};
+/* Balloon device works in 4K page units. So each page is
+ * pointed to by multiple balloon pages. */
+#define VIRTIO_BALLOON_PAGES_PER_PAGE (PAGE_SIZE >> VIRTIO_BALLOON_PFN_SHIFT)
+
static u32 page_to_balloon_pfn(struct page *page)
{
unsigned long pfn = page_to_pfn(page);
BUILD_BUG_ON(PAGE_SHIFT < VIRTIO_BALLOON_PFN_SHIFT);
/* Convert pfn from Linux page size to balloon page size. */
- return pfn >> (PAGE_SHIFT - VIRTIO_BALLOON_PFN_SHIFT);
+ return pfn * VIRTIO_BALLOON_PAGES_PER_PAGE;
+}
+
+static struct page *balloon_pfn_to_page(u32 pfn)
+{
+ BUG_ON(pfn % VIRTIO_BALLOON_PAGES_PER_PAGE);
+ return pfn_to_page(pfn / VIRTIO_BALLOON_PAGES_PER_PAGE);
}
static void balloon_ack(struct virtqueue *vq)
@@ -96,12 +106,24 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
wait_for_completion(&vb->acked);
}
+static void set_page_pfns(u32 pfns[], struct page *page)
+{
+ unsigned int i;
+
+ /* Set balloon pfns pointing at this page.
+ * Note that the first pfn points at start of the page. */
+ for (i = 0; i < VIRTIO_BALLOON_PAGES_PER_PAGE; i++)
+ pfns[i] = page_to_balloon_pfn(page) + i;
+}
+
static void fill_balloon(struct virtio_balloon *vb, size_t num)
{
/* We can only do one array worth at a time. */
num = min(num, ARRAY_SIZE(vb->pfns));
- for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
+ for (vb->num_pfns = 0; vb->num_pfns < num;
+ vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE)
+ int i;
struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY |
__GFP_NOMEMALLOC | __GFP_NOWARN);
if (!page) {
@@ -113,9 +135,9 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
msleep(200);
break;
}
- vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page);
+ set_page_pfns(vb->pfns + vb->num_pfns, page);
+ vb->num_pages += VIRTIO_BALLOON_PAGES_PER_PAGE;
totalram_pages--;
- vb->num_pages++;
list_add(&page->lru, &vb->pages);
}
@@ -130,8 +152,9 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
{
unsigned int i;
- for (i = 0; i < num; i++) {
- __free_page(pfn_to_page(pfns[i]));
+ /* Find pfns pointing at start of each page, get pages and free them. */
+ for (i = 0; i < num; i += VIRTIO_BALLOON_PAGES_PER_PAGE) {
+ __free_page(balloon_pfn_to_page(pfns[i]));
totalram_pages++;
}
}
@@ -143,11 +166,12 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num)
/* We can only do one array worth at a time. */
num = min(num, ARRAY_SIZE(vb->pfns));
- for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
+ for (vb->num_pfns = 0; vb->num_pfns < num;
+ vb->num_pfns += VIRTIO_BALLOON_PAGES_PER_PAGE)
page = list_first_entry(&vb->pages, struct page, lru);
list_del(&page->lru);
- vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page);
- vb->num_pages--;
+ set_page_pfns(vb->pfns, &vb->num_pfns, page);
+ vb->num_pages -= VIRTIO_BALLOON_PAGES_PER_PAGE;
}
/*
^ permalink raw reply related
* Re: [PATCH 2/3] virtio_balloon: Fix endian bug
From: Michael S. Tsirkin @ 2012-04-12 8:30 UTC (permalink / raw)
To: David Gibson; +Cc: qemu-devel, paulus, linux-kernel, virtualization
In-Reply-To: <1334208995-29985-3-git-send-email-david@gibson.dropbear.id.au>
On Thu, Apr 12, 2012 at 03:36:34PM +1000, David Gibson wrote:
> Although virtio config space fields are usually in guest-native endian,
> the spec for the virtio balloon device explicitly states that both fields
> in its config space are little-endian.
>
> However, the current virtio_balloon driver does not have a suitable endian
> swap for the 'num_pages' field, although it does have one for the 'actual'
> field. This patch corrects the bug, adding sparse annotation while we're
> at it.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Indeed. And qemu byte-swaps according to the spec, too.
Applied for 3.4, thanks.
> ---
> drivers/virtio/virtio_balloon.c | 7 +++++--
> 1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 6c07793..553cc1f 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -238,11 +238,14 @@ static void virtballoon_changed(struct virtio_device *vdev)
>
> static inline s64 towards_target(struct virtio_balloon *vb)
> {
> - u32 v;
> + __le32 v;
> + s64 target;
> +
> vb->vdev->config->get(vb->vdev,
> offsetof(struct virtio_balloon_config, num_pages),
> &v, sizeof(v));
> - return (s64)v - vb->num_pages;
> + target = le32_to_cpu(v);
> + return target - vb->num_pages;
> }
>
> static void update_balloon_size(struct virtio_balloon *vb)
> --
> 1.7.9.5
^ permalink raw reply
* Re: [PATCH 1/3] virtio_balloon: Remove unnecessarily persistent state
From: Michael S. Tsirkin @ 2012-04-12 8:25 UTC (permalink / raw)
To: David Gibson; +Cc: qemu-devel, paulus, linux-kernel, virtualization
In-Reply-To: <1334208995-29985-2-git-send-email-david@gibson.dropbear.id.au>
On Thu, Apr 12, 2012 at 03:36:33PM +1000, David Gibson wrote:
> The main virtio_balloon state structure contains the fields num_pfns and
> array 'pfns'. Although they are stored here persistently, the lifetime of
> useful data in there is never more than one function - they're essentially
> used as though they were local variables.
>
> For the pfns buffer, used to communicate a batch of pfns this is useful to
> avoid either transient kmalloc()s or putting too much data on the stack.
> For num_pfns, there is no reason it should not be a local, though.
>
> This patch cleans things up by making num_pfns a local in the functions it
> is used in. The pfns array remains, but the comment is updated to clarify
> that it contains no truly persistent data.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Further, this is not a bugfix so pls drop it for now
at least until 3.5.
> ---
> drivers/virtio/virtio_balloon.c | 28 ++++++++++++++++------------
> 1 file changed, 16 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 05f0a80..6c07793 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -46,8 +46,8 @@ struct virtio_balloon
> unsigned int num_pages;
> struct list_head pages;
>
> - /* The array of pfns we tell the Host about. */
> - unsigned int num_pfns;
> + /* Temporary buffer of pfns to pass to the host */
> + /* Store this here to avoid a too-large local array */
> u32 pfns[256];
>
> /* Memory statistics */
> @@ -79,11 +79,12 @@ static void balloon_ack(struct virtqueue *vq)
> complete(&vb->acked);
> }
>
> -static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
> +static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq,
> + unsigned int n)
> {
> struct scatterlist sg;
>
> - sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns);
> + sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * n);
>
> init_completion(&vb->acked);
>
> @@ -98,10 +99,12 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
>
> static void fill_balloon(struct virtio_balloon *vb, size_t num)
> {
> + unsigned int n;
> +
> /* We can only do one array worth at a time. */
> num = min(num, ARRAY_SIZE(vb->pfns));
>
> - for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
> + for (n = 0; n < num; n++) {
> struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY |
> __GFP_NOMEMALLOC | __GFP_NOWARN);
> if (!page) {
> @@ -113,17 +116,17 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
> msleep(200);
> break;
> }
> - vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page);
> + vb->pfns[n] = page_to_balloon_pfn(page);
> totalram_pages--;
> vb->num_pages++;
> list_add(&page->lru, &vb->pages);
> }
>
> /* Didn't get any? Oh well. */
> - if (vb->num_pfns == 0)
> + if (n == 0)
> return;
>
> - tell_host(vb, vb->inflate_vq);
> + tell_host(vb, vb->inflate_vq, n);
> }
>
> static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
> @@ -139,14 +142,15 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
> static void leak_balloon(struct virtio_balloon *vb, size_t num)
> {
> struct page *page;
> + unsigned int n;
>
> /* We can only do one array worth at a time. */
> num = min(num, ARRAY_SIZE(vb->pfns));
>
> - for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
> + for (n = 0; n < num; n++) {
> page = list_first_entry(&vb->pages, struct page, lru);
> list_del(&page->lru);
> - vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page);
> + vb->pfns[n] = page_to_balloon_pfn(page);
> vb->num_pages--;
> }
>
> @@ -155,8 +159,8 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num)
> * virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST);
> * is true, we *have* to do it in this order
> */
> - tell_host(vb, vb->deflate_vq);
> - release_pages_by_pfn(vb->pfns, vb->num_pfns);
> + tell_host(vb, vb->deflate_vq, n);
> + release_pages_by_pfn(vb->pfns, n);
> }
>
> static inline void update_stat(struct virtio_balloon *vb, int idx,
> --
> 1.7.9.5
^ permalink raw reply
* Re: [PATCH 1/3] virtio_balloon: Remove unnecessarily persistent state
From: Michael S. Tsirkin @ 2012-04-12 8:11 UTC (permalink / raw)
To: David Gibson; +Cc: qemu-devel, paulus, linux-kernel, virtualization
In-Reply-To: <1334208995-29985-2-git-send-email-david@gibson.dropbear.id.au>
On Thu, Apr 12, 2012 at 03:36:33PM +1000, David Gibson wrote:
> The main virtio_balloon state structure contains the fields num_pfns and
> array 'pfns'. Although they are stored here persistently, the lifetime of
> useful data in there is never more than one function - they're essentially
> used as though they were local variables.
>
> For the pfns buffer, used to communicate a batch of pfns this is useful to
> avoid either transient kmalloc()s or putting too much data on the stack.
> For num_pfns, there is no reason it should not be a local, though.
>
> This patch cleans things up by making num_pfns a local in the functions it
> is used in. The pfns array remains, but the comment is updated to clarify
> that it contains no truly persistent data.
>
> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
nak
IMO it makes sense to keep the array size around together with the
array: either we use local storage for both or for neither.
OTOH a comment is a good thing to add, just make it more specific,
see below.
> ---
> drivers/virtio/virtio_balloon.c | 28 ++++++++++++++++------------
> 1 file changed, 16 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
> index 05f0a80..6c07793 100644
> --- a/drivers/virtio/virtio_balloon.c
> +++ b/drivers/virtio/virtio_balloon.c
> @@ -46,8 +46,8 @@ struct virtio_balloon
> unsigned int num_pages;
> struct list_head pages;
>
> - /* The array of pfns we tell the Host about. */
> - unsigned int num_pfns;
> + /* Temporary buffer of pfns to pass to the host */
This needs to be more specific to be informative:
all things are temporary in this world :)
+ /* Valid for the duration of one command only */
> + /* Store this here to avoid a too-large local array */
> u32 pfns[256];
>
> /* Memory statistics */
> @@ -79,11 +79,12 @@ static void balloon_ack(struct virtqueue *vq)
> complete(&vb->acked);
> }
>
> -static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
> +static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq,
> + unsigned int n)
> {
> struct scatterlist sg;
>
> - sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * vb->num_pfns);
> + sg_init_one(&sg, vb->pfns, sizeof(vb->pfns[0]) * n);
>
> init_completion(&vb->acked);
>
> @@ -98,10 +99,12 @@ static void tell_host(struct virtio_balloon *vb, struct virtqueue *vq)
>
> static void fill_balloon(struct virtio_balloon *vb, size_t num)
> {
> + unsigned int n;
> +
> /* We can only do one array worth at a time. */
> num = min(num, ARRAY_SIZE(vb->pfns));
>
> - for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
> + for (n = 0; n < num; n++) {
> struct page *page = alloc_page(GFP_HIGHUSER | __GFP_NORETRY |
> __GFP_NOMEMALLOC | __GFP_NOWARN);
> if (!page) {
> @@ -113,17 +116,17 @@ static void fill_balloon(struct virtio_balloon *vb, size_t num)
> msleep(200);
> break;
> }
> - vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page);
> + vb->pfns[n] = page_to_balloon_pfn(page);
> totalram_pages--;
> vb->num_pages++;
> list_add(&page->lru, &vb->pages);
> }
>
> /* Didn't get any? Oh well. */
> - if (vb->num_pfns == 0)
> + if (n == 0)
> return;
>
> - tell_host(vb, vb->inflate_vq);
> + tell_host(vb, vb->inflate_vq, n);
> }
>
> static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
> @@ -139,14 +142,15 @@ static void release_pages_by_pfn(const u32 pfns[], unsigned int num)
> static void leak_balloon(struct virtio_balloon *vb, size_t num)
> {
> struct page *page;
> + unsigned int n;
>
> /* We can only do one array worth at a time. */
> num = min(num, ARRAY_SIZE(vb->pfns));
>
> - for (vb->num_pfns = 0; vb->num_pfns < num; vb->num_pfns++) {
> + for (n = 0; n < num; n++) {
> page = list_first_entry(&vb->pages, struct page, lru);
> list_del(&page->lru);
> - vb->pfns[vb->num_pfns] = page_to_balloon_pfn(page);
> + vb->pfns[n] = page_to_balloon_pfn(page);
> vb->num_pages--;
> }
>
> @@ -155,8 +159,8 @@ static void leak_balloon(struct virtio_balloon *vb, size_t num)
> * virtio_has_feature(vdev, VIRTIO_BALLOON_F_MUST_TELL_HOST);
> * is true, we *have* to do it in this order
> */
> - tell_host(vb, vb->deflate_vq);
> - release_pages_by_pfn(vb->pfns, vb->num_pfns);
> + tell_host(vb, vb->deflate_vq, n);
> + release_pages_by_pfn(vb->pfns, n);
> }
>
> static inline void update_stat(struct virtio_balloon *vb, int idx,
> --
> 1.7.9.5
^ permalink raw reply
* [net-next V7 PATCH] virtio-net: send gratuitous packets when needed
From: Jason Wang @ 2012-04-12 6:43 UTC (permalink / raw)
To: netdev, rusty, virtualization, linux-kernel, mst
As hypervior does not have the knowledge of guest network configuration, it's
better to ask guest to send gratuitous packets when needed.
This patch implements VIRTIO_NET_F_GUEST_ANNOUNCE feature: hypervisor would
notice the guest when it thinks it's time for guest to announce the link
presnece. Guest tests VIRTIO_NET_S_ANNOUNCE bit during config change interrupt
and woule send gratuitous packets through netif_notify_peers() and ack the
notification through ctrl vq.
We need to make sure the atomicy of read and ack in guest otherwise we may ack
more times than being notified. This is done through handling the whole config
change interrupt in an non-reentrant workqueue.
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
Changes from v6:
- move the whole event processing to system_nrt_wq
- introduce the config_enable and config_lock to synchronize with dev removing
and pm
- protect the ack with rtnl_lock
Changes from v5:
- notify the chain before acking the link annoucement
- ack the link announcement notification through control vq
Changes from v4:
- typos
- handle workqueue unconditionally
- move VIRTIO_NET_S_ANNOUNCE to bit 8 to separate rw bits from ro bits
Changes from v3:
- cancel the workqueue during freeze
Changes from v2:
- fix the race between unregister_dev() and workqueue
---
drivers/net/virtio_net.c | 64 +++++++++++++++++++++++++++++++++++++++++---
include/linux/virtio_net.h | 14 ++++++++++
2 files changed, 73 insertions(+), 5 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 4de2760..23403b6 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -66,12 +66,21 @@ struct virtnet_info {
/* Host will merge rx buffers for big packets (shake it! shake it!) */
bool mergeable_rx_bufs;
+ /* enable config space updates */
+ bool config_enable;
+
/* Active statistics */
struct virtnet_stats __percpu *stats;
/* Work struct for refilling if we run low on memory. */
struct delayed_work refill;
+ /* Work struct for config space updates */
+ struct work_struct config_work;
+
+ /* Lock for config space updates */
+ struct mutex config_lock;
+
/* Chain pages by the private ptr. */
struct page *pages;
@@ -781,6 +790,16 @@ static bool virtnet_send_command(struct virtnet_info *vi, u8 class, u8 cmd,
return status == VIRTIO_NET_OK;
}
+static void virtnet_ack_link_announce(struct virtnet_info *vi)
+{
+ rtnl_lock();
+ if (!virtnet_send_command(vi, VIRTIO_NET_CTRL_ANNOUNCE,
+ VIRTIO_NET_CTRL_ANNOUNCE_ACK, NULL,
+ 0, 0))
+ dev_warn(&vi->dev->dev, "Failed to ack link announce.\n");
+ rtnl_unlock();
+}
+
static int virtnet_close(struct net_device *dev)
{
struct virtnet_info *vi = netdev_priv(dev);
@@ -952,20 +971,31 @@ static const struct net_device_ops virtnet_netdev = {
#endif
};
-static void virtnet_update_status(struct virtnet_info *vi)
+static void virtnet_config_changed_work(struct work_struct *work)
{
+ struct virtnet_info *vi =
+ container_of(work, struct virtnet_info, config_work);
u16 v;
+ mutex_lock(&vi->config_lock);
+ if (!vi->config_enable)
+ goto done;
+
if (virtio_config_val(vi->vdev, VIRTIO_NET_F_STATUS,
offsetof(struct virtio_net_config, status),
&v) < 0)
- return;
+ goto done;
+
+ if (v & VIRTIO_NET_S_ANNOUNCE) {
+ netif_notify_peers(vi->dev);
+ virtnet_ack_link_announce(vi);
+ }
/* Ignore unknown (future) status bits */
v &= VIRTIO_NET_S_LINK_UP;
if (vi->status == v)
- return;
+ goto done;
vi->status = v;
@@ -976,13 +1006,15 @@ static void virtnet_update_status(struct virtnet_info *vi)
netif_carrier_off(vi->dev);
netif_stop_queue(vi->dev);
}
+done:
+ mutex_unlock(&vi->config_lock);
}
static void virtnet_config_changed(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
- virtnet_update_status(vi);
+ queue_work(system_nrt_wq, &vi->config_work);
}
static int init_vqs(struct virtnet_info *vi)
@@ -1076,6 +1108,9 @@ static int virtnet_probe(struct virtio_device *vdev)
goto free;
INIT_DELAYED_WORK(&vi->refill, refill_work);
+ mutex_init(&vi->config_lock);
+ vi->config_enable = true;
+ INIT_WORK(&vi->config_work, virtnet_config_changed_work);
sg_init_table(vi->rx_sg, ARRAY_SIZE(vi->rx_sg));
sg_init_table(vi->tx_sg, ARRAY_SIZE(vi->tx_sg));
@@ -1111,7 +1146,7 @@ static int virtnet_probe(struct virtio_device *vdev)
otherwise get link status from config. */
if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
netif_carrier_off(dev);
- virtnet_update_status(vi);
+ queue_work(system_nrt_wq, &vi->config_work);
} else {
vi->status = VIRTIO_NET_S_LINK_UP;
netif_carrier_on(dev);
@@ -1170,10 +1205,17 @@ static void __devexit virtnet_remove(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
+ /* Prevent config work handler from accessing the device. */
+ mutex_lock(&vi->config_lock);
+ vi->config_enable = false;
+ mutex_unlock(&vi->config_lock);
+
unregister_netdev(vi->dev);
remove_vq_common(vi);
+ flush_work(&vi->config_work);
+
free_percpu(vi->stats);
free_netdev(vi->dev);
}
@@ -1183,6 +1225,11 @@ static int virtnet_freeze(struct virtio_device *vdev)
{
struct virtnet_info *vi = vdev->priv;
+ /* Prevent config work handler from accessing the device */
+ mutex_lock(&vi->config_lock);
+ vi->config_enable = false;
+ mutex_unlock(&vi->config_lock);
+
virtqueue_disable_cb(vi->rvq);
virtqueue_disable_cb(vi->svq);
if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_CTRL_VQ))
@@ -1196,6 +1243,8 @@ static int virtnet_freeze(struct virtio_device *vdev)
remove_vq_common(vi);
+ flush_work(&vi->config_work);
+
return 0;
}
@@ -1216,6 +1265,10 @@ static int virtnet_restore(struct virtio_device *vdev)
if (!try_fill_recv(vi, GFP_KERNEL))
queue_delayed_work(system_nrt_wq, &vi->refill, 0);
+ mutex_lock(&vi->config_lock);
+ vi->config_enable = true;
+ mutex_unlock(&vi->config_lock);
+
return 0;
}
#endif
@@ -1233,6 +1286,7 @@ static unsigned int features[] = {
VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO,
VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ,
VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN,
+ VIRTIO_NET_F_GUEST_ANNOUNCE,
};
static struct virtio_driver virtio_net_driver = {
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 970d5a2..2470f54 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -49,8 +49,11 @@
#define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */
#define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */
#define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */
+#define VIRTIO_NET_F_GUEST_ANNOUNCE 21 /* Guest can announce device on the
+ * network */
#define VIRTIO_NET_S_LINK_UP 1 /* Link is up */
+#define VIRTIO_NET_S_ANNOUNCE 2 /* Announcement is needed */
struct virtio_net_config {
/* The config defining mac address (if VIRTIO_NET_F_MAC) */
@@ -152,4 +155,15 @@ struct virtio_net_ctrl_mac {
#define VIRTIO_NET_CTRL_VLAN_ADD 0
#define VIRTIO_NET_CTRL_VLAN_DEL 1
+/*
+ * Control link announce acknowledgement
+ *
+ * The command VIRTIO_NET_CTRL_ANNOUNCE_ACK is used to indicate that
+ * driver has recevied the notification; device would clear the
+ * VIRTIO_NET_S_ANNOUNCE bit in the status field after it receives
+ * this command.
+ */
+#define VIRTIO_NET_CTRL_ANNOUNCE 3
+ #define VIRTIO_NET_CTRL_ANNOUNCE_ACK 0
+
#endif /* _LINUX_VIRTIO_NET_H */
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox