* [PATCH 2/3] s390: virtio: Improve a size determination in virtio_ccw_setup_vq()
From: SF Markus Elfring @ 2017-05-16 15:52 UTC (permalink / raw)
To: kvm, linux-s390, virtualization, Cornelia Huck, Halil Pasic,
Heiko Carstens, Martin Schwidefsky
Cc: kernel-janitors, LKML
In-Reply-To: <d02fd34c-da59-0c33-d859-e49ecb4eb1c5@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 16 May 2017 17:05:01 +0200
Replace the specification of a data structure by a pointer dereference
as the parameter for the operator "sizeof" to make the corresponding size
determination a bit safer according to the Linux coding style convention.
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/s390/virtio/virtio_ccw.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index 447fe718c0ab..bfb845d7faa7 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -495,5 +495,5 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev,
unsigned long flags;
/* Allocate queue. */
- info = kzalloc(sizeof(struct virtio_ccw_vq_info), GFP_KERNEL);
+ info = kzalloc(sizeof(*info), GFP_KERNEL);
if (!info) {
--
2.13.0
^ permalink raw reply related
* [PATCH 1/3] s390: virtio: Delete error messages for failed memory allocations in two functions
From: SF Markus Elfring @ 2017-05-16 15:51 UTC (permalink / raw)
To: kvm, linux-s390, virtualization, Cornelia Huck, Halil Pasic,
Heiko Carstens, Martin Schwidefsky
Cc: kernel-janitors, LKML, Wolfram Sang
In-Reply-To: <d02fd34c-da59-0c33-d859-e49ecb4eb1c5@users.sourceforge.net>
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 16 May 2017 16:50:17 +0200
Omit three extra messages for memory allocation failures in these functions.
This issue was detected by using the Coccinelle software.
Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf
Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
drivers/s390/virtio/virtio_ccw.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c
index 2a76ea78a0bf..447fe718c0ab 100644
--- a/drivers/s390/virtio/virtio_ccw.c
+++ b/drivers/s390/virtio/virtio_ccw.c
@@ -499,12 +499,10 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev,
if (!info) {
- dev_warn(&vcdev->cdev->dev, "no info\n");
err = -ENOMEM;
goto out_err;
}
info->info_block = kzalloc(sizeof(*info->info_block),
GFP_DMA | GFP_KERNEL);
if (!info->info_block) {
- dev_warn(&vcdev->cdev->dev, "no info block\n");
err = -ENOMEM;
goto out_err;
}
@@ -1225,7 +1223,6 @@ static int virtio_ccw_online(struct ccw_device *cdev)
vcdev = kzalloc(sizeof(*vcdev), GFP_KERNEL);
if (!vcdev) {
- dev_warn(&cdev->dev, "Could not get memory for virtio\n");
ret = -ENOMEM;
goto out_free;
}
--
2.13.0
^ permalink raw reply related
* [PATCH 0/3] S390-virtio: Adjustments for three function implementations
From: SF Markus Elfring @ 2017-05-16 15:50 UTC (permalink / raw)
To: kvm, linux-s390, virtualization, Cornelia Huck, Halil Pasic,
Heiko Carstens, Martin Schwidefsky
Cc: kernel-janitors, LKML
From: Markus Elfring <elfring@users.sourceforge.net>
Date: Tue, 16 May 2017 17:43:21 +0200
A few update suggestions were taken into account
from static source code analysis.
Markus Elfring (3):
Delete error messages for failed memory allocations in two functions
Improve a size determination in virtio_ccw_setup_vq()
Adjust a null pointer check in two functions
drivers/s390/virtio/virtio_ccw.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
--
2.13.0
^ permalink raw reply
* RE: [PATCH 1/3] Fix ERROR: trailing statements should be on next line
From: David Laight @ 2017-05-15 14:25 UTC (permalink / raw)
To: 'Alex Williamson', Michael S. Tsirkin
Cc: netdev@vger.kernel.org, virtualization@lists.linux-foundation.org,
linux-kernel@vger.kernel.org, Maciek Fijalkowski
In-Reply-To: <20170514212048.24ee7667@t450s.home>
From: Alex Williamson
> Sent: 15 May 2017 04:21
...
> > > /* Find end of list, sew whole thing into vi->rq.pages. */
> > > - for (end = page; end->private; end = (struct page *)end->private);
> > > + for (end = page; end->private; end = (struct page *)end->private)
> > > + ;
>
> FWIW, I generally like to put a comment on the next line to make it
> abundantly clear that there's nothing in the body of the loop, it's
> also more aesthetically pleasing than a semi-colon on the line by
> itself, ex. /* Nothing */; It's just too easy to misinterpret the
> loop otherwise, especially without gratuitous white space. Thanks,
My preference is to put 'continue;' on a line by itself.
Or even move the termination condition into the loop:
for (end = page;; end = (struct page *)end->private)
if (!end->private)
break;
(oh, is that cast needed??)
David
^ permalink raw reply
* Re: Support of lguest?
From: Juergen Gross @ 2017-05-15 14:24 UTC (permalink / raw)
To: Vitaly Kuznetsov
Cc: lguest, xen-devel, Linux Kernel Mailing List, virtualization
In-Reply-To: <87r2zqi4iz.fsf@vitty.brq.redhat.com>
On 15/05/17 16:22, Vitaly Kuznetsov wrote:
> Juergen Gross <jgross@suse.com> writes:
>
>> Lguest and Xen pv-guests are the only users of pv_mmu_ops (with the
>> one exception of the .exit_mmap member, which is being used by Xen
>> HVM-guests, too).
>>
>> As it is possible now to build a kernel without Xen pv-guest support
>> while keeping PVH and PVHVM support, I thought about putting most
>> pv_mmu_ops functions in #ifdef CONFIG_XEN_HAS_PVMMU sections.
>
> There is an ongoing work to enable PV TLB flushing for Hyper-V guests:
> http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2017-April/104411.html
>
> it utilizes .flush_tlb_others member in pv_mmu_ops.
>
> hopefully, this work will be merged in 4.13.
Thanks for the information. I'll keep .flush_tlb_others member outside
the #ifdef section.
Juergen
^ permalink raw reply
* Re: Support of lguest?
From: Vitaly Kuznetsov @ 2017-05-15 14:22 UTC (permalink / raw)
To: Juergen Gross
Cc: lguest, xen-devel, Linux Kernel Mailing List, virtualization
In-Reply-To: <7696c3d8-0ede-2704-34bb-d3d7dac6883d@suse.com>
Juergen Gross <jgross@suse.com> writes:
> Lguest and Xen pv-guests are the only users of pv_mmu_ops (with the
> one exception of the .exit_mmap member, which is being used by Xen
> HVM-guests, too).
>
> As it is possible now to build a kernel without Xen pv-guest support
> while keeping PVH and PVHVM support, I thought about putting most
> pv_mmu_ops functions in #ifdef CONFIG_XEN_HAS_PVMMU sections.
There is an ongoing work to enable PV TLB flushing for Hyper-V guests:
http://driverdev.linuxdriverproject.org/pipermail/driverdev-devel/2017-April/104411.html
it utilizes .flush_tlb_others member in pv_mmu_ops.
hopefully, this work will be merged in 4.13.
--
Vitaly
^ permalink raw reply
* Support of lguest?
From: Juergen Gross @ 2017-05-15 14:09 UTC (permalink / raw)
To: Rusty Russell, Linux Kernel Mailing List, virtualization,
xen-devel, lguest
Lguest and Xen pv-guests are the only users of pv_mmu_ops (with the
one exception of the .exit_mmap member, which is being used by Xen
HVM-guests, too).
As it is possible now to build a kernel without Xen pv-guest support
while keeping PVH and PVHVM support, I thought about putting most
pv_mmu_ops functions in #ifdef CONFIG_XEN_HAS_PVMMU sections. If there
wouldn't be lguest...
So my question: is anybody still using lguest or would like to keep it?
If yes, I'd add CONFIG_PARAVIRT_MMU selected by CONFIG_XEN_PV and
CONFIG_LGUEST_GUEST.
If no, I'd remove lguest support and just use CONFIG_XEN_HAS_PVMMU,
in case nobody would like me to use CONFIG_PARAVIRT_MMU even if
lguest isn't there any more.
Juergen
^ permalink raw reply
* Re: [PATCH 1/3] Fix ERROR: trailing statements should be on next line
From: Alex Williamson @ 2017-05-15 3:20 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: netdev, virtualization, linux-kernel, Maciek Fijalkowski
In-Reply-To: <20170515055700-mutt-send-email-mst@kernel.org>
On Mon, 15 May 2017 05:58:05 +0300
"Michael S. Tsirkin" <mst@redhat.com> wrote:
> On Sun, May 14, 2017 at 07:51:28PM +0200, Maciek Fijalkowski wrote:
> > From: Maciej Fijalkowski <macfij7@wp.pl>
> >
> > Signed-off-by: Maciej Fijalkowski <macfij7@wp.pl>
>
> I prefer the original form - ; isn't a full statement.
>
> > ---
> > drivers/net/virtio_net.c | 3 ++-
> > 1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> > index 9320d96..f20dfb8 100644
> > --- a/drivers/net/virtio_net.c
> > +++ b/drivers/net/virtio_net.c
> > @@ -217,7 +217,8 @@ static void give_pages(struct receive_queue *rq, struct page *page)
> > struct page *end;
> >
> > /* Find end of list, sew whole thing into vi->rq.pages. */
> > - for (end = page; end->private; end = (struct page *)end->private);
> > + for (end = page; end->private; end = (struct page *)end->private)
> > + ;
FWIW, I generally like to put a comment on the next line to make it
abundantly clear that there's nothing in the body of the loop, it's
also more aesthetically pleasing than a semi-colon on the line by
itself, ex. /* Nothing */; It's just too easy to misinterpret the
loop otherwise, especially without gratuitous white space. Thanks,
Alex
> > end->private = (unsigned long)rq->pages;
> > rq->pages = page;
> > }
> > --
> > 2.4.11
> _______________________________________________
> Virtualization mailing list
> Virtualization@lists.linux-foundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* Re: [PATCH 3/3] Fix ERROR: code indent should use tabs where possible
From: Michael S. Tsirkin @ 2017-05-15 3:00 UTC (permalink / raw)
To: Maciek Fijalkowski; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <20170514175130.18664-3-macfij7@wp.pl>
On Sun, May 14, 2017 at 07:51:30PM +0200, Maciek Fijalkowski wrote:
> From: Maciej Fijalkowski <macfij7@wp.pl>
>
> Signed-off-by: Maciej Fijalkowski <macfij7@wp.pl>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
But you really want to fix the subject. Make it less verbose
drop upper case and add info about module. Something like:
virtio_net: coding style fix: use tabs for indent
Also, you misspelled Jason's email.
> ---
> drivers/net/virtio_net.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 6c8170c..5d71e9f 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2717,7 +2717,7 @@ static __init int virtio_net_driver_init(void)
> if (ret)
> goto err_dead;
>
> - ret = register_virtio_driver(&virtio_net_driver);
> + ret = register_virtio_driver(&virtio_net_driver);
> if (ret)
> goto err_virtio;
> return 0;
> --
> 2.4.11
^ permalink raw reply
* Re: [PATCH 1/3] Fix ERROR: trailing statements should be on next line
From: Michael S. Tsirkin @ 2017-05-15 2:58 UTC (permalink / raw)
To: Maciek Fijalkowski; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <20170514175130.18664-1-macfij7@wp.pl>
On Sun, May 14, 2017 at 07:51:28PM +0200, Maciek Fijalkowski wrote:
> From: Maciej Fijalkowski <macfij7@wp.pl>
>
> Signed-off-by: Maciej Fijalkowski <macfij7@wp.pl>
I prefer the original form - ; isn't a full statement.
> ---
> drivers/net/virtio_net.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index 9320d96..f20dfb8 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -217,7 +217,8 @@ static void give_pages(struct receive_queue *rq, struct page *page)
> struct page *end;
>
> /* Find end of list, sew whole thing into vi->rq.pages. */
> - for (end = page; end->private; end = (struct page *)end->private);
> + for (end = page; end->private; end = (struct page *)end->private)
> + ;
> end->private = (unsigned long)rq->pages;
> rq->pages = page;
> }
> --
> 2.4.11
^ permalink raw reply
* Re: [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
From: Michael S. Tsirkin @ 2017-05-15 2:56 UTC (permalink / raw)
To: Maciek Fijalkowski; +Cc: netdev, linux-kernel, virtualization
In-Reply-To: <20170514175130.18664-2-macfij7@wp.pl>
On Sun, May 14, 2017 at 07:51:29PM +0200, Maciek Fijalkowski wrote:
> From: Maciej Fijalkowski <macfij7@wp.pl>
>
> Signed-off-by: Maciej Fijalkowski <macfij7@wp.pl>
This is not a complex value.
> ---
> drivers/net/virtio_net.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
> index f20dfb8..6c8170c 100644
> --- a/drivers/net/virtio_net.c
> +++ b/drivers/net/virtio_net.c
> @@ -2663,7 +2663,7 @@ static struct virtio_device_id id_table[] = {
> };
>
> #define VIRTNET_FEATURES \
> - VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
> + (VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
> VIRTIO_NET_F_MAC, \
> VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
> VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
> @@ -2672,7 +2672,7 @@ static struct virtio_device_id id_table[] = {
> VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
> VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
> VIRTIO_NET_F_CTRL_MAC_ADDR, \
> - VIRTIO_NET_F_MTU
> + VIRTIO_NET_F_MTU)
>
> static unsigned int features[] = {
> VIRTNET_FEATURES,
> --
> 2.4.11
^ permalink raw reply
* Re: [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
From: Andrew Lunn @ 2017-05-15 0:25 UTC (permalink / raw)
To: Maciek Fijalkowski; +Cc: jasonwang, virtualization, netdev, linux-kernel, mst
In-Reply-To: <20170514175130.18664-2-macfij7@wp.pl>
On Sun, May 14, 2017 at 07:51:29PM +0200, Maciek Fijalkowski wrote:
> From: Maciej Fijalkowski <macfij7@wp.pl>
Hi Maciek
Please include some commit message, even if it is just the checkpatch
error you are fixing.
Please include the subsystem/driver you are patch in the subject line.
Also, your subject of Fix ERROR: makes it sound a lot worse than it
is.
net: virtio: Fix checkpatch error Complex macros should use ()
Also, you should at least compile test your change. It is clearly
wrong, as shown by 0-day.
Andrew
^ permalink raw reply
* Re: [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
From: kbuild test robot @ 2017-05-14 18:48 UTC (permalink / raw)
Cc: mst, netdev, linux-kernel, virtualization, jasonwang, kbuild-all,
Maciej Fijalkowski
In-Reply-To: <20170514175130.18664-2-macfij7@wp.pl>
[-- Attachment #1: Type: text/plain, Size: 9598 bytes --]
Hi Maciej,
[auto build test ERROR on net-next/master]
[also build test ERROR on v4.12-rc1 next-20170512]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Maciek-Fijalkowski/Fix-ERROR-trailing-statements-should-be-on-next-line/20170515-021304
config: x86_64-acpi-redef (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64
All error/warnings (new ones prefixed by >>):
drivers//net/virtio_net.c:2647:20: warning: left-hand operand of comma expression has no effect [-Wunused-value]
(VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2647:45: warning: left-hand operand of comma expression has no effect [-Wunused-value]
(VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2648:18: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_MAC, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2649:24: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2649:47: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2649:71: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2650:23: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2650:48: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2650:73: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2651:24: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2651:48: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2652:24: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2652:45: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2652:67: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2653:22: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2653:46: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2654:29: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2654:46: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
drivers//net/virtio_net.c:2655:28: warning: left-hand operand of comma expression has no effect [-Wunused-value]
VIRTIO_NET_F_CTRL_MAC_ADDR, \
^
>> drivers//net/virtio_net.c:2659:2: note: in expansion of macro 'VIRTNET_FEATURES'
VIRTNET_FEATURES,
^~~~~~~~~~~~~~~~
>> drivers//net/virtio_net.c:2647:2: error: initializer element is not constant
(VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
^
vim +/VIRTNET_FEATURES +2659 drivers//net/virtio_net.c
296f96fc Rusty Russell 2007-10-22 2641 static struct virtio_device_id id_table[] = {
296f96fc Rusty Russell 2007-10-22 2642 { VIRTIO_ID_NET, VIRTIO_DEV_ANY_ID },
296f96fc Rusty Russell 2007-10-22 2643 { 0 },
296f96fc Rusty Russell 2007-10-22 2644 };
296f96fc Rusty Russell 2007-10-22 2645
f3358507 Michael S. Tsirkin 2016-11-04 2646 #define VIRTNET_FEATURES \
d66a5bc5 Maciej Fijalkowski 2017-05-14 @2647 (VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
f3358507 Michael S. Tsirkin 2016-11-04 2648 VIRTIO_NET_F_MAC, \
f3358507 Michael S. Tsirkin 2016-11-04 2649 VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
f3358507 Michael S. Tsirkin 2016-11-04 2650 VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
f3358507 Michael S. Tsirkin 2016-11-04 2651 VIRTIO_NET_F_GUEST_ECN, VIRTIO_NET_F_GUEST_UFO, \
f3358507 Michael S. Tsirkin 2016-11-04 2652 VIRTIO_NET_F_MRG_RXBUF, VIRTIO_NET_F_STATUS, VIRTIO_NET_F_CTRL_VQ, \
f3358507 Michael S. Tsirkin 2016-11-04 2653 VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
f3358507 Michael S. Tsirkin 2016-11-04 2654 VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
f3358507 Michael S. Tsirkin 2016-11-04 2655 VIRTIO_NET_F_CTRL_MAC_ADDR, \
d66a5bc5 Maciej Fijalkowski 2017-05-14 2656 VIRTIO_NET_F_MTU)
f3358507 Michael S. Tsirkin 2016-11-04 2657
c45a6816 Rusty Russell 2008-05-02 2658 static unsigned int features[] = {
f3358507 Michael S. Tsirkin 2016-11-04 @2659 VIRTNET_FEATURES,
f3358507 Michael S. Tsirkin 2016-11-04 2660 };
f3358507 Michael S. Tsirkin 2016-11-04 2661
f3358507 Michael S. Tsirkin 2016-11-04 2662 static unsigned int features_legacy[] = {
:::::: The code at line 2659 was first introduced by commit
:::::: f3358507c11999c91abf54744658bccd49b5879c virtio-net: drop legacy features in virtio 1 mode
:::::: TO: Michael S. Tsirkin <mst@redhat.com>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31444 bytes --]
[-- Attachment #3: Type: text/plain, Size: 183 bytes --]
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
^ permalink raw reply
* [PATCH 3/3] Fix ERROR: code indent should use tabs where possible
From: Maciek Fijalkowski @ 2017-05-14 17:51 UTC (permalink / raw)
To: mst; +Cc: Maciej Fijalkowski, jasonwang, netdev, linux-kernel,
virtualization
In-Reply-To: <20170514175130.18664-1-macfij7@wp.pl>
From: Maciej Fijalkowski <macfij7@wp.pl>
Signed-off-by: Maciej Fijalkowski <macfij7@wp.pl>
---
drivers/net/virtio_net.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 6c8170c..5d71e9f 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2717,7 +2717,7 @@ static __init int virtio_net_driver_init(void)
if (ret)
goto err_dead;
- ret = register_virtio_driver(&virtio_net_driver);
+ ret = register_virtio_driver(&virtio_net_driver);
if (ret)
goto err_virtio;
return 0;
--
2.4.11
^ permalink raw reply related
* [PATCH 2/3] Fix ERROR: Macros with complex values should be enclosed in parentheses
From: Maciek Fijalkowski @ 2017-05-14 17:51 UTC (permalink / raw)
To: mst; +Cc: Maciej Fijalkowski, jasonwang, netdev, linux-kernel,
virtualization
In-Reply-To: <20170514175130.18664-1-macfij7@wp.pl>
From: Maciej Fijalkowski <macfij7@wp.pl>
Signed-off-by: Maciej Fijalkowski <macfij7@wp.pl>
---
drivers/net/virtio_net.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index f20dfb8..6c8170c 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -2663,7 +2663,7 @@ static struct virtio_device_id id_table[] = {
};
#define VIRTNET_FEATURES \
- VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
+ (VIRTIO_NET_F_CSUM, VIRTIO_NET_F_GUEST_CSUM, \
VIRTIO_NET_F_MAC, \
VIRTIO_NET_F_HOST_TSO4, VIRTIO_NET_F_HOST_UFO, VIRTIO_NET_F_HOST_TSO6, \
VIRTIO_NET_F_HOST_ECN, VIRTIO_NET_F_GUEST_TSO4, VIRTIO_NET_F_GUEST_TSO6, \
@@ -2672,7 +2672,7 @@ static struct virtio_device_id id_table[] = {
VIRTIO_NET_F_CTRL_RX, VIRTIO_NET_F_CTRL_VLAN, \
VIRTIO_NET_F_GUEST_ANNOUNCE, VIRTIO_NET_F_MQ, \
VIRTIO_NET_F_CTRL_MAC_ADDR, \
- VIRTIO_NET_F_MTU
+ VIRTIO_NET_F_MTU)
static unsigned int features[] = {
VIRTNET_FEATURES,
--
2.4.11
^ permalink raw reply related
* [PATCH 1/3] Fix ERROR: trailing statements should be on next line
From: Maciek Fijalkowski @ 2017-05-14 17:51 UTC (permalink / raw)
To: mst; +Cc: Maciej Fijalkowski, jasonwang, netdev, linux-kernel,
virtualization
From: Maciej Fijalkowski <macfij7@wp.pl>
Signed-off-by: Maciej Fijalkowski <macfij7@wp.pl>
---
drivers/net/virtio_net.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index 9320d96..f20dfb8 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -217,7 +217,8 @@ static void give_pages(struct receive_queue *rq, struct page *page)
struct page *end;
/* Find end of list, sew whole thing into vi->rq.pages. */
- for (end = page; end->private; end = (struct page *)end->private);
+ for (end = page; end->private; end = (struct page *)end->private)
+ ;
end->private = (unsigned long)rq->pages;
rq->pages = page;
}
--
2.4.11
^ permalink raw reply related
* Call for Papers: The 13th IEEE International Conference on eScience 2017 in Auckland, New Zealand
From: Ioan Raicu @ 2017-05-13 0:19 UTC (permalink / raw)
To: virtualization@lists.linux-foundation.org,
micro_publicity@crhc.uiuc.edu, performance@merlot.usc.edu,
sigplan-l@acm.uiuc.edu, cphc-conf
[-- Attachment #1.1: Type: text/plain, Size: 4073 bytes --]
Call for Papers
The 13th IEEE International Conference on eScience 2017
24–27 October 2017
Auckland, New Zealand
www.escience2017.org.nz <http://www.escience2017.org.nz/>
The thirteenth IEEE eScience conference will be held in Auckland, New Zealand from 24 October 2017. The objective of the eScience Conference is to promote and encourage all aspects of eScience and its associated technologies, applications, and tools.
The way in which research is carried out is undergoing a series of radical changes as a result of the digital revolution. Researchers in all disciplines are increasingly adopting digital tools, techniques and practices in communities and projects that span multiple disciplines, laboratories, organizations, and national boundaries. eScience 2017 brings together leading international and interdisciplinary research communities, developers, and users of eScience applications and enabling IT technologies. The conference serves as the premier forum to present the results of the latest research and product/tool developments and to highlight related activities from around the world.
We are particularly interested in advances in the application of technology in a particular discipline. Accordingly, significant advances in practice are considered to be as important as the development of new technologies themselves. Further, we welcome contributions in educational activities under any of these disciplines. As a result, the conference will be structured around the following eScience themes:
• Arts, Humanities and Social Science
• Bioinformatics and Health
• Physical Sciences and Engineering
• Climate, Environmental and Earth Sciences
• Data Science, Digital Repositories, Data Management and Big Data
• Research Software Engineering and Computational Science
• Cyberinfrastructure to support eScience, including novel hardware, software and services
• eScience in the cloud
• Education, training and eScience practice
In addition to this call for papers, there are a number of ways to participate in eScience 2017: please see the eScience 2017 website (http://escience2017.org.nz/ <http://escience2017.org.nz/>) for further information.
Key Dates
Submissions Due: Friday 19 May 2017
Notification of Acceptance: Wednesday 5 July 2017
Authors are invited to submit unpublished, original work, using the IEEE 8.5 × 11 manuscript guidelines: double-column text using single-spaced 10 point font on 8.5 × 11 inch pages. Templates are available from http://www.ieee.org/conferences_events/conferences/publishing/templates.html <http://www.ieee.org/conferences_events/conferences/publishing/templates.html>.
The conference proceedings will be made available online through the IEEE Digital Library.
Three types of papers will be accepted:
• Full research papers (up to 10 pages): focus on new research achievements in eScience, spanning core technologies and applications.
• Experience papers (up to 10 pages): focus on practical outcomes through applying eScience tools and techniques to novel problems.
• Posters (up to 2 pages): focus on early stage results for presentation in a poster session, giving presenters a chance to showcase their latest results and innovations.
Authors should submit a PDF to https://easychair.org/conferences/?conf=escience2017 <https://easychair.org/conferences/?conf=escience2017> Submissions will be fully peer-reviewed. It is a requirement that at least one author of each accepted paper attend the conference.
General Chairs: Nick Jones (New Zealand)
eScience Infrastructure: Mik Black (University of Otago)
PC Chairs: David Abramson (University of Queensland), Gillian Dobbie (University of Auckland), David Eyers (University of Otago)
—
Ioan Raicu, Ph.D.
Visiting Scholar in EECS at Northwestern University
Associate Professor in CS at Illinois Institute of Technology
Guest Research Faculty in MCS at Argonne National Laboratory
http://www.cs.iit.edu/~iraicu/
http://datasys.cs.iit.edu/
[-- Attachment #1.2.1: Type: text/html, Size: 12661 bytes --]
[-- Attachment #1.2.2: unknown.png --]
[-- Type: image/png, Size: 116 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
* [PULL] virtio: fixes, cleanups, performance
From: Michael S. Tsirkin @ 2017-05-10 12:24 UTC (permalink / raw)
To: Linus Torvalds
Cc: kvm, mst, netdev, nsekhar, linux-kernel, virtualization,
cornelia.huck, colin.king, dan.carpenter
The following changes since commit a351e9b9fc24e982ec2f0e76379a49826036da12:
Linux 4.11 (2017-04-30 19:47:48 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost.git tags/for_linus
for you to fetch changes up to c8b0d7290657996a29f318b948d2397d30e70c36:
s390/virtio: change maintainership (2017-05-09 16:43:25 +0300)
----------------------------------------------------------------
virtio: fixes, cleanups, performance
A bunch of changes to virtio, most affecting virtio net.
ptr_ring batched zeroing - first of batching enhancements
that seems ready.
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
----------------------------------------------------------------
Christian Borntraeger (1):
s390/virtio: change maintainership
Colin Ian King (1):
tools/virtio: fix spelling mistake: "wakeus" -> "wakeups"
Cornelia Huck (1):
virtio: virtio_driver doc
Dan Carpenter (2):
ringtest: fix an assert statement
virtio_net: tidy a couple debug statements
Michael S. Tsirkin (11):
virtio: wrap find_vqs
virtio: add context flag to find vqs
virtio: allow extra context per descriptor
virtio_net: allow specifying context for rx
virtio_net: rework mergeable buffer handling
virtio_net: reduce alignment for buffers
virtio_net: fix support for small rings
virtio_net: don't reset twice on XDP on/off
ptr_ring: batch ring zeroing
ringtest: support test specific parameters
ptr_ring: support testing different batching sizes
Sekhar Nori (1):
tools/virtio: fix build breakage
MAINTAINERS | 2 +-
drivers/block/virtio_blk.c | 3 +-
drivers/char/virtio_console.c | 6 +-
drivers/crypto/virtio/virtio_crypto_core.c | 3 +-
drivers/gpu/drm/virtio/virtgpu_kms.c | 3 +-
drivers/misc/mic/vop/vop_main.c | 9 +-
drivers/net/caif/caif_virtio.c | 3 +-
drivers/net/virtio_net.c | 147 ++++++++++++++++-------------
drivers/remoteproc/remoteproc_virtio.c | 10 +-
drivers/rpmsg/virtio_rpmsg_bus.c | 2 +-
drivers/s390/virtio/kvm_virtio.c | 8 +-
drivers/s390/virtio/virtio_ccw.c | 7 +-
drivers/scsi/virtio_scsi.c | 3 +-
drivers/virtio/virtio_balloon.c | 3 +-
drivers/virtio/virtio_input.c | 3 +-
drivers/virtio/virtio_mmio.c | 8 +-
drivers/virtio/virtio_pci_common.c | 17 ++--
drivers/virtio/virtio_pci_common.h | 4 +-
drivers/virtio/virtio_pci_legacy.c | 4 +-
drivers/virtio/virtio_pci_modern.c | 12 ++-
drivers/virtio/virtio_ring.c | 77 ++++++++++++---
include/linux/ptr_ring.h | 63 +++++++++++--
include/linux/virtio.h | 13 +++
include/linux/virtio_config.h | 25 ++++-
include/linux/virtio_ring.h | 3 +
net/vmw_vsock/virtio_transport.c | 6 +-
tools/virtio/linux/virtio.h | 1 +
tools/virtio/ringtest/main.c | 15 ++-
tools/virtio/ringtest/main.h | 2 +
tools/virtio/ringtest/ptr_ring.c | 3 +
tools/virtio/virtio_test.c | 4 +-
tools/virtio/vringh_test.c | 7 +-
32 files changed, 330 insertions(+), 146 deletions(-)
^ permalink raw reply
* Re: CFP: KVM Forum 2017
From: Jon Masters @ 2017-05-09 7:42 UTC (permalink / raw)
To: Paolo Bonzini; +Cc: linux-kernel, KVM list, Linux Virtualization
In-Reply-To: <2014178131.5134261.1494313561934.JavaMail.zimbra@redhat.com>
:) Podcast drops sometime next couple days - double header this week to cover every pull request in 4.12...just that part is 4500 words of summary and that's not counting ongoing dev. I think the merge window is basically some kind of ultimate curse. Sorry for top post...time to zzzzz.
--
Computer Architect | Sent from my 64-bit #ARM Powered phone
> On May 9, 2017, at 03:06, Paolo Bonzini <pbonzini@redhat.com> wrote:
>
>
>
> ----- Original Message -----
>> From: "Jon Masters" <jcm@jonmasters.org>
>> To: "Paolo Bonzini" <pbonzini@redhat.com>, "KVM list" <kvm@vger.kernel.org>, linux-kernel@vger.kernel.org, "Linux
>> Virtualization" <virtualization@lists.linux-foundation.org>
>> Sent: Tuesday, May 9, 2017 7:42:48 AM
>> Subject: Re: CFP: KVM Forum 2017
>>
>>> On 05/02/2017 06:41 AM, Paolo Bonzini wrote:
>>> ================================================================
>>> KVM Forum 2017: Call For Participation
>>> October 25-27, 2017 - Hilton Prague - Prague, Czech Republic
>>>
>>> (All submissions must be received before midnight June 15, 2017)
>>> =================================================================
>>
>> (please provide a timezone for the deadline - not including one in the
>> podcast, just saying "midnight", but it would be nice next time)
>
> Thanks for mentioning KVM Forum in the podcast! The deadline is usually
> extended unofficially by 24-36 hours, since we always get one or two people
> who mess up. :) This makes the timezone less important.
>
> Paolo
>
^ permalink raw reply
* Re: CFP: KVM Forum 2017
From: Paolo Bonzini @ 2017-05-09 7:06 UTC (permalink / raw)
To: Jon Masters; +Cc: linux-kernel, KVM list, Linux Virtualization
In-Reply-To: <bb4cc51f-440f-caf7-409d-9b99d8966a44@jonmasters.org>
----- Original Message -----
> From: "Jon Masters" <jcm@jonmasters.org>
> To: "Paolo Bonzini" <pbonzini@redhat.com>, "KVM list" <kvm@vger.kernel.org>, linux-kernel@vger.kernel.org, "Linux
> Virtualization" <virtualization@lists.linux-foundation.org>
> Sent: Tuesday, May 9, 2017 7:42:48 AM
> Subject: Re: CFP: KVM Forum 2017
>
> On 05/02/2017 06:41 AM, Paolo Bonzini wrote:
> > ================================================================
> > KVM Forum 2017: Call For Participation
> > October 25-27, 2017 - Hilton Prague - Prague, Czech Republic
> >
> > (All submissions must be received before midnight June 15, 2017)
> > =================================================================
>
> (please provide a timezone for the deadline - not including one in the
> podcast, just saying "midnight", but it would be nice next time)
Thanks for mentioning KVM Forum in the podcast! The deadline is usually
extended unofficially by 24-36 hours, since we always get one or two people
who mess up. :) This makes the timezone less important.
Paolo
^ permalink raw reply
* Re: CFP: KVM Forum 2017
From: Jon Masters @ 2017-05-09 5:42 UTC (permalink / raw)
To: Paolo Bonzini, KVM list, linux-kernel@vger.kernel.org,
Linux Virtualization
In-Reply-To: <fd522779-e417-8372-5ab1-d097c61eaa2d@redhat.com>
On 05/02/2017 06:41 AM, Paolo Bonzini wrote:
> ================================================================
> KVM Forum 2017: Call For Participation
> October 25-27, 2017 - Hilton Prague - Prague, Czech Republic
>
> (All submissions must be received before midnight June 15, 2017)
> =================================================================
(please provide a timezone for the deadline - not including one in the
podcast, just saying "midnight", but it would be nice next time)
^ permalink raw reply
* Re: [virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
From: Wei Wang @ 2017-05-09 2:45 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: aarcange@redhat.com, virtio-dev@lists.oasis-open.org,
kvm@vger.kernel.org, qemu-devel@nongnu.org, amit.shah@redhat.com,
liliang.opensource@gmail.com, Hansen, Dave,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, linux-mm@kvack.org,
cornelia.huck@de.ibm.com, pbonzini@redhat.com,
akpm@linux-foundation.org, mgorman@techsingularity.net
In-Reply-To: <20170508203533-mutt-send-email-mst@kernel.org>
On 05/09/2017 01:40 AM, Michael S. Tsirkin wrote:
> On Sun, May 07, 2017 at 04:19:28AM +0000, Wang, Wei W wrote:
>> On 05/06/2017 06:26 AM, Michael S. Tsirkin wrote:
>>> On Thu, Apr 27, 2017 at 02:31:49PM +0800, Wei Wang wrote:
>>>> On 04/27/2017 07:20 AM, Michael S. Tsirkin wrote:
>>>>> On Wed, Apr 26, 2017 at 11:03:34AM +0000, Wang, Wei W wrote:
>>>>>> Hi Michael, could you please give some feedback?
>>>>> I'm sorry, I'm not sure feedback on what you are requesting.
>>>> Oh, just some trivial things (e.g. use a field in the header,
>>>> hdr->chunks to indicate the number of chunks in the payload) that
>>>> wasn't confirmed.
>>>>
>>>> I will prepare the new version with fixing the agreed issues, and we
>>>> can continue to discuss those parts if you still find them improper.
>>>>
>>>>
>>>>> The interface looks reasonable now, even though there's a way to
>>>>> make it even simpler if we can limit chunk size to 2G (in fact 4G -
>>>>> 1). Do you think we can live with this limitation?
>>>> Yes, I think we can. So, is it good to change to use the previous
>>>> 64-bit chunk format (52-bit base + 12-bit size)?
>>> This isn't what I meant. virtio ring has descriptors with a 64 bit address and 32 bit
>>> size.
>>>
>>> If size < 4g is not a significant limitation, why not just use that to pass
>>> address/size in a standard s/g list, possibly using INDIRECT?
>> OK, I see your point, thanks. Post the two options here for an analysis:
>> Option1 (what we have now):
>> struct virtio_balloon_page_chunk {
>> __le64 chunk_num;
>> struct virtio_balloon_page_chunk_entry entry[];
>> };
>> Option2:
>> struct virtio_balloon_page_chunk {
>> __le64 chunk_num;
>> struct scatterlist entry[];
>> };
> This isn't what I meant really :) I meant vring_desc.
OK. Repost the code change:
Option2:
struct virtio_balloon_page_chunk {
__le64 chunk_num;
struct ving_desc entry[];
};
We pre-allocate a table of desc, and each desc is used to hold a chunk.
In that case, the virtqueue_add() function, which deals with sg, is not
usable for us. We may need to add a new one,
virtqueue_add_indirect_desc(),
to add a pre-allocated indirect descriptor table to vring.
>
>> I don't have an issue to change it to Option2, but I would prefer Option1,
>> because I think there is no be obvious difference between the two options,
>> while Option1 appears to have little advantages here:
>> 1) "struct virtio_balloon_page_chunk_entry" has smaller size than
>> "struct scatterlist", so the same size of allocated page chunk buffer
>> can hold more entry[] using Option1;
>> 2) INDIRECT needs on demand kmalloc();
> Within alloc_indirect? We can fix that with a separate patch.
>
>
>> 3) no 4G size limit;
> Do you see lots of >=4g chunks in practice?
It wouldn't be much in practice, but we still need the extra code to
handle the case - break larger chunks into less-than 4g ones.
Best,
Wei
^ permalink raw reply
* Re: [virtio-dev] Re: [PATCH v9 2/5] virtio-balloon: VIRTIO_BALLOON_F_BALLOON_CHUNKS
From: Michael S. Tsirkin @ 2017-05-08 17:40 UTC (permalink / raw)
To: Wang, Wei W
Cc: aarcange@redhat.com, virtio-dev@lists.oasis-open.org,
kvm@vger.kernel.org, qemu-devel@nongnu.org, amit.shah@redhat.com,
liliang.opensource@gmail.com, Hansen, Dave,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, linux-mm@kvack.org,
cornelia.huck@de.ibm.com, pbonzini@redhat.com,
akpm@linux-foundation.org, mgorman@techsingularity.net
In-Reply-To: <286AC319A985734F985F78AFA26841F7391FFBB0@shsmsx102.ccr.corp.intel.com>
On Sun, May 07, 2017 at 04:19:28AM +0000, Wang, Wei W wrote:
> On 05/06/2017 06:26 AM, Michael S. Tsirkin wrote:
> > On Thu, Apr 27, 2017 at 02:31:49PM +0800, Wei Wang wrote:
> > > On 04/27/2017 07:20 AM, Michael S. Tsirkin wrote:
> > > > On Wed, Apr 26, 2017 at 11:03:34AM +0000, Wang, Wei W wrote:
> > > > > Hi Michael, could you please give some feedback?
> > > > I'm sorry, I'm not sure feedback on what you are requesting.
> > > Oh, just some trivial things (e.g. use a field in the header,
> > > hdr->chunks to indicate the number of chunks in the payload) that
> > > wasn't confirmed.
> > >
> > > I will prepare the new version with fixing the agreed issues, and we
> > > can continue to discuss those parts if you still find them improper.
> > >
> > >
> > > >
> > > > The interface looks reasonable now, even though there's a way to
> > > > make it even simpler if we can limit chunk size to 2G (in fact 4G -
> > > > 1). Do you think we can live with this limitation?
> > > Yes, I think we can. So, is it good to change to use the previous
> > > 64-bit chunk format (52-bit base + 12-bit size)?
> >
> > This isn't what I meant. virtio ring has descriptors with a 64 bit address and 32 bit
> > size.
> >
> > If size < 4g is not a significant limitation, why not just use that to pass
> > address/size in a standard s/g list, possibly using INDIRECT?
>
> OK, I see your point, thanks. Post the two options here for an analysis:
> Option1 (what we have now):
> struct virtio_balloon_page_chunk {
> __le64 chunk_num;
> struct virtio_balloon_page_chunk_entry entry[];
> };
> Option2:
> struct virtio_balloon_page_chunk {
> __le64 chunk_num;
> struct scatterlist entry[];
> };
This isn't what I meant really :) I meant vring_desc.
> I don't have an issue to change it to Option2, but I would prefer Option1,
> because I think there is no be obvious difference between the two options,
> while Option1 appears to have little advantages here:
> 1) "struct virtio_balloon_page_chunk_entry" has smaller size than
> "struct scatterlist", so the same size of allocated page chunk buffer
> can hold more entry[] using Option1;
> 2) INDIRECT needs on demand kmalloc();
Within alloc_indirect? We can fix that with a separate patch.
> 3) no 4G size limit;
Do you see lots of >=4g chunks in practice?
> What do you think?
>
> Best,
> Wei
>
>
OTOH using existing vring APIs handles things like DMA transparently.
--
MST
^ permalink raw reply
* RE: [PATCH v10 3/6] virtio-balloon: VIRTIO_BALLOON_F_PAGE_CHUNKS
From: Wang, Wei W @ 2017-05-07 4:22 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: aarcange@redhat.com, virtio-dev@lists.oasis-open.org,
kvm@vger.kernel.org, qemu-devel@nongnu.org, amit.shah@redhat.com,
liliang.opensource@gmail.com, Hansen, Dave,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, linux-mm@kvack.org,
cornelia.huck@de.ibm.com, pbonzini@redhat.com,
akpm@linux-foundation.org, mgorman@techsingularity.net
In-Reply-To: <20170506012146-mutt-send-email-mst@kernel.org>
On 05/06/2017 06:29 AM, Michael S. Tsirkin wrote:
> On Thu, May 04, 2017 at 04:50:12PM +0800, Wei Wang wrote:
> > Add a new feature, VIRTIO_BALLOON_F_PAGE_CHUNKS, which enables the
> > transfer of the ballooned (i.e. inflated/deflated) pages in chunks to
> > the host.
> >
> > The implementation of the previous virtio-balloon is not very
> > efficient, because the ballooned pages are transferred to the host one
> > by one. Here is the breakdown of the time in percentage spent on each
> > step of the balloon inflating process (inflating 7GB of an 8GB idle
> > guest).
> >
> > 1) allocating pages (6.5%)
> > 2) sending PFNs to host (68.3%)
> > 3) address translation (6.1%)
> > 4) madvise (19%)
> >
> > It takes about 4126ms for the inflating process to complete.
> > The above profiling shows that the bottlenecks are stage 2) and stage
> > 4).
> >
> > This patch optimizes step 2) by transferring pages to the host in
> > chunks. A chunk consists of guest physically continuous pages.
> > When the pages are packed into a chunk, they are converted into
> > balloon page size (4KB) pages. A chunk is offered to the host via a
> > base PFN (i.e. the start PFN of those physically continuous
> > pages) and the size (i.e. the total number of the 4KB balloon size
> > pages). A chunk is formatted as below:
> > --------------------------------------------------------
> > | Base (52 bit) | Rsvd (12 bit) |
> > --------------------------------------------------------
> > --------------------------------------------------------
> > | Size (52 bit) | Rsvd (12 bit) |
> > --------------------------------------------------------
> >
> > By doing so, step 4) can also be optimized by doing address
> > translation and madvise() in chunks rather than page by page.
> >
> > With this new feature, the above ballooning process takes ~590ms
> > resulting in an improvement of ~85%.
> >
> > TODO: optimize stage 1) by allocating/freeing a chunk of pages instead
> > of a single page each time.
> >
> > Signed-off-by: Wei Wang <wei.w.wang@intel.com>
> > Signed-off-by: Liang Li <liang.z.li@intel.com>
> > Suggested-by: Michael S. Tsirkin <mst@redhat.com>
>
>
> This is much cleaner, thanks. It might be even better to have wrappers that put
> array and its size in a struct and manage that struct, but I won't require this for
> submission.
OK, thanks. Would this be your suggestion:
struct virtio_balloon_page_struct {
unsigned int page_bmap_num;
unsigned long *page_bmap[VIRTIO_BALLOON_PAGE_BMAP_MAX_NUM];
}
Best,
Wei
^ permalink raw reply
* RE: [PATCH v9 5/5] virtio-balloon: VIRTIO_BALLOON_F_MISC_VQ
From: Wang, Wei W @ 2017-05-07 4:20 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: aarcange@redhat.com, virtio-dev@lists.oasis-open.org,
kvm@vger.kernel.org, qemu-devel@nongnu.org, amit.shah@redhat.com,
liliang.opensource@gmail.com, Hansen, Dave,
linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, linux-mm@kvack.org,
cornelia.huck@de.ibm.com, pbonzini@redhat.com,
akpm@linux-foundation.org, mgorman@techsingularity.net
In-Reply-To: <20170506011928-mutt-send-email-mst@kernel.org>
On 05/06/2017 06:21 AM, Michael S. Tsirkin wrote:
> On Thu, Apr 27, 2017 at 02:33:44PM +0800, Wei Wang wrote:
> > On 04/14/2017 01:08 AM, Michael S. Tsirkin wrote:
> > > On Thu, Apr 13, 2017 at 05:35:08PM +0800, Wei Wang wrote:
> > > > Add a new vq, miscq, to handle miscellaneous requests between the
> > > > device and the driver.
> > > >
> > > > This patch implemnts the
> VIRTIO_BALLOON_MISCQ_INQUIRE_UNUSED_PAGES
> > > implements
> > >
> > > > request sent from the device.
> > > Commands are sent from host and handled on guest.
> > > In fact how is this so different from stats?
> > > How about reusing the stats vq then? You can use one buffer for
> > > stats and one buffer for commands.
> > >
> >
> > The meaning of the two vqs is a little different. statq is used for
> > reporting statistics, while miscq is intended to be used to handle
> > miscellaneous requests from the guest or host
>
> misc just means "anything goes". If you want it to mean "commands" name it so.
Ok, will change it.
> > (I think it can
> > also be used the other way around in the future when other new
> > features are added which need the guest to send requests and the host
> > to provide responses).
> >
> > I would prefer to have them separate, because:
> > If we plan to combine them, we need to put the previous statq related
> > implementation under miscq with a new command (I think we can't
> > combine them without using commands to distinguish the two features).
>
> Right.
> > In this way, an old driver won't work with a new QEMU or a new driver
> > won't work with an old QEMU. Would this be considered as an issue
> > here?
>
> Compatibility is and should always be handled using feature flags. There's a
> feature flag for this, isn't it?
The negotiation of the existing feature flag, VIRTIO_BALLOON_F_STATS_VQ
only indicates the support of the old statq implementation. To move the statq
implementation under cmdq, I think we would need a new feature flag for the
new statq implementation:
#define VIRTIO_BALLOON_F_CMDQ_STATS 5
What do you think?
Best,
Wei
^ permalink raw reply
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