[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-10 Thread Michael S. Tsirkin
On Wed, Jul 11, 2018 at 07:00:37AM +0300, Michael S. Tsirkin wrote: > On Tue, Jul 10, 2018 at 10:33:08AM -0700, Linus Torvalds wrote: > > NAK. > > > > On Tue, Jul 10, 2018 at 2:56 AM Wei Wang wrote: > > > > > > + > > > + buf_page = list_first_entry_or_null(pages, struct page, lru); > > > +

[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-10 Thread Michael S. Tsirkin
On Tue, Jul 10, 2018 at 10:33:08AM -0700, Linus Torvalds wrote: > NAK. > > On Tue, Jul 10, 2018 at 2:56 AM Wei Wang wrote: > > > > + > > + buf_page = list_first_entry_or_null(pages, struct page, lru); > > + if (!buf_page) > > + return -EINVAL; > > + buf = (__le64 *

[virtio-dev] Re: [PATCH net-next v2 0/5] virtio: support packed ring

2018-07-10 Thread Jason Wang
On 2018年07月11日 10:27, Tiwei Bie wrote: Hello everyone, This patch set implements packed ring support in virtio driver. Some functional tests have been done with Jason's packed ring implementation in vhost: https://lkml.org/lkml/2018/7/3/33 Both of ping and netperf worked as expected. v1 -

[virtio-dev] [PATCH net-next v2 0/5] virtio: support packed ring

2018-07-10 Thread Tiwei Bie
Hello everyone, This patch set implements packed ring support in virtio driver. Some functional tests have been done with Jason's packed ring implementation in vhost: https://lkml.org/lkml/2018/7/3/33 Both of ping and netperf worked as expected. v1 -> v2: - Use READ_ONCE() to read event off_wr

[virtio-dev] [PATCH net-next v2 1/5] virtio: add packed ring definitions

2018-07-10 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- include/uapi/linux/virtio_config.h | 3 +++ include/uapi/linux/virtio_ring.h | 43 ++ 2 files changed, 46 insertions(+) diff --git a/include/uapi/linux/virtio_config.h b/include/uapi/linux/virtio_config.h index 449132c76b1c..1196e1c1d4

[virtio-dev] [PATCH net-next v2 2/5] virtio_ring: support creating packed ring

2018-07-10 Thread Tiwei Bie
This commit introduces the support for creating packed ring. All split ring specific functions are added _split suffix. Some necessary stubs for packed ring are also added. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 801 +++ include/linux/virtio_r

[virtio-dev] [PATCH net-next v2 4/5] virtio_ring: add event idx support in packed ring

2018-07-10 Thread Tiwei Bie
This commit introduces the EVENT_IDX support in packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 73 1 file changed, 65 insertions(+), 8 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index f317b

[virtio-dev] [PATCH net-next v2 3/5] virtio_ring: add packed ring support

2018-07-10 Thread Tiwei Bie
This commit introduces the support (without EVENT_IDX) for packed ring. Signed-off-by: Tiwei Bie --- drivers/virtio/virtio_ring.c | 495 ++- 1 file changed, 487 insertions(+), 8 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c

[virtio-dev] [PATCH net-next v2 5/5] virtio_ring: enable packed ring

2018-07-10 Thread Tiwei Bie
Signed-off-by: Tiwei Bie --- drivers/s390/virtio/virtio_ccw.c | 14 ++ drivers/virtio/virtio_ring.c | 2 ++ 2 files changed, 16 insertions(+) diff --git a/drivers/s390/virtio/virtio_ccw.c b/drivers/s390/virtio/virtio_ccw.c index 8f5c1d7f751a..8654f3a94635 100644 --- a/drivers/s3

[virtio-dev] Re: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-10 Thread Wei Wang
On 07/11/2018 01:33 AM, Linus Torvalds wrote: NAK. On Tue, Jul 10, 2018 at 2:56 AM Wei Wang wrote: + + buf_page = list_first_entry_or_null(pages, struct page, lru); + if (!buf_page) + return -EINVAL; + buf = (__le64 *)page_address(buf_page); Stop this garbage.

Re: [virtio-dev] Re: [PATCH net-next v1 4/5] virtio_ring: add event idx support in packed ring

2018-07-10 Thread Tiwei Bie
On Tue, Jul 10, 2018 at 01:50:03PM +0800, Jason Wang wrote: > On 2018年07月09日 15:22, Tiwei Bie wrote: > > @@ -1059,9 +1059,19 @@ static bool virtqueue_kick_prepare_packed(struct > > virtqueue *_vq) > > * suppressions. */ > > virtio_mb(vq->weak_barriers); > > + old = vq->next_avail_idx -

[virtio-dev] Re: [PATCH net-next v1 5/5] virtio_ring: enable packed ring

2018-07-10 Thread Tiwei Bie
On Tue, Jul 10, 2018 at 01:51:20PM +0800, Jason Wang wrote: > On 2018年07月09日 15:22, Tiwei Bie wrote: > > Signed-off-by: Tiwei Bie > > --- > > drivers/s390/virtio/virtio_ccw.c | 8 > > drivers/virtio/virtio_ring.c | 2 ++ > > 2 files changed, 10 insertions(+) > > > > diff --git a/

Re: [virtio-dev] Re: [Qemu-devel] [PATCH v3 0/3] Use of unique identifier for pairing virtio and passthrough devices...

2018-07-10 Thread Siwei Liu
On Mon, Jul 9, 2018 at 6:54 PM, Michael S. Tsirkin wrote: > On Mon, Jul 09, 2018 at 06:11:53PM -0700, si-wei liu wrote: >> The plan is to enable group ID based matching in the first place rather than >> match by MAC, the latter of which is fragile and problematic. > > It isn't all that fragile - h

Re: [virtio-dev] Re: [Qemu-devel] [PATCH v3 0/3] Use of unique identifier for pairing virtio and passthrough devices...

2018-07-10 Thread Siwei Liu
On Mon, Jul 9, 2018 at 6:58 PM, Michael S. Tsirkin wrote: > On Mon, Jul 09, 2018 at 06:11:53PM -0700, si-wei liu wrote: >> What do we buy >> for using a random address during initial discovery and requiring VF to >> complete the handshake? > > I don't see advantages to using a random address that

[virtio-dev] Re: [PATCH v3 0/3] Use of unique identifier for pairing virtio and passthrough devices...

2018-07-10 Thread Venu Busireddy
On 2018-07-10 05:11:18 +0300, Michael S. Tsirkin wrote: > On Fri, Jun 29, 2018 at 05:19:03PM -0500, Venu Busireddy wrote: > > The current patch set includes all the feedback received for proposals [3] > > and [4]. For the sake of completeness, patch for the virtio specification > > is also included

[virtio-dev] RE: [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-10 Thread Wang, Wei W
On Tuesday, July 10, 2018 5:31 PM, Wang, Wei W wrote: > Subject: [PATCH v35 1/5] mm: support to get hints of free page blocks > > This patch adds support to get free page blocks from a free page list. > The physical addresses of the blocks are stored to a list of buffers passed > from the caller.

[virtio-dev] [PATCH v35 3/5] virtio-balloon: VIRTIO_BALLOON_F_FREE_PAGE_HINT

2018-07-10 Thread Wei Wang
Negotiation of the VIRTIO_BALLOON_F_FREE_PAGE_HINT feature indicates the support of reporting hints of guest free pages to host via virtio-balloon. Host requests the guest to report free page hints by sending a new cmd id to the guest via the free_page_report_cmd_id configuration register. As the

[virtio-dev] [PATCH v35 2/5] virtio-balloon: remove BUG() in init_vqs

2018-07-10 Thread Wei Wang
It's a bit overkill to use BUG when failing to add an entry to the stats_vq in init_vqs. So remove it and just return the error to the caller to bail out nicely. Signed-off-by: Wei Wang Cc: Michael S. Tsirkin --- drivers/virtio/virtio_balloon.c | 10 +++--- 1 file changed, 7 insertions(+),

[virtio-dev] [PATCH v35 5/5] virtio-balloon: VIRTIO_BALLOON_F_PAGE_POISON

2018-07-10 Thread Wei Wang
The VIRTIO_BALLOON_F_PAGE_POISON feature bit is used to indicate if the guest is using page poisoning. Guest writes to the poison_val config field to tell host about the page poisoning value that is in use. Suggested-by: Michael S. Tsirkin Signed-off-by: Wei Wang Cc: Michael S. Tsirkin Cc: Mich

[virtio-dev] [PATCH v35 0/5] Virtio-balloon: support free page reporting

2018-07-10 Thread Wei Wang
This patch series is separated from the previous "Virtio-balloon Enhancement" series. The new feature, VIRTIO_BALLOON_F_FREE_PAGE_HINT, implemented by this series enables the virtio-balloon driver to report hints of guest free pages to the host. It can be used to accelerate live migration of VMs.

[virtio-dev] [PATCH v35 4/5] mm/page_poison: expose page_poisoning_enabled to kernel modules

2018-07-10 Thread Wei Wang
In some usages, e.g. virtio-balloon, a kernel module needs to know if page poisoning is in use. This patch exposes the page_poisoning_enabled function to kernel modules. Signed-off-by: Wei Wang Cc: Andrew Morton Cc: Michal Hocko Cc: Michael S. Tsirkin Acked-by: Andrew Morton --- mm/page_pois

[virtio-dev] [PATCH v35 1/5] mm: support to get hints of free page blocks

2018-07-10 Thread Wei Wang
This patch adds support to get free page blocks from a free page list. The physical addresses of the blocks are stored to a list of buffers passed from the caller. The obtained free page blocks are hints about free pages, because there is no guarantee that they are still on the free page list after