Re: [PATCH] virtio_console: Use virtio device index to generate port name

2013-01-21 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: > From: Sjur Brændeland > > Use virtio device index for creating unique device port names. > Current index allocation in virtio is based on a monotonically > increasing variable "index". A better handling of this is to > use device index which is allocated by

Re: [PATCH] virtio_console: Don't access uninitialized data.

2013-01-21 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: > From: Sjur Brændeland > > Don't access uninitialized work-queue when removing device. > The work queue is initialized only if the device multi-queue. > So don't call cancel_work unless this is a multi-queue device. > > This fixes the following panic: Thank

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-21 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Jan 17, 2013 at 12:40:29PM +1030, Rusty Russell wrote: >> I resist sprinkling __user everywhere because it's *not* always user >> addresses, and it's deeply misleading to anyone reading it. I'd rather >> have it

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-21 Thread Rusty Russell
Rusty Russell writes: > "Michael S. Tsirkin" writes: >>> + iov->iov[iov->i].iov_base = (__force __user void *)addr; >>> + iov->iov[iov->i].iov_len = desc.len; >> >> The following comment from the previous version still a

Re: [PATCH v3] virtio-spec: set mac address by a new vq command

2013-01-20 Thread Rusty Russell
ak...@redhat.com writes: > From: Amos Kong > > Virtio-net driver currently programs MAC address byte by byte, > this means that we have an intermediate step where mac is wrong. > This patch introduced a new control command to set MAC address > in one time, and added a new feature flag VIRTIO_NET_F

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-20 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Jan 17, 2013 at 08:59:38PM +1030, Rusty Russell wrote: >> +/* Returns vring->num if empty, -ve on error. */ >> +static inline int __vringh_get_head(const struct vringh *vrh, >> +int (*getu

Re: [PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-20 Thread Rusty Russell
Sjur Brændeland writes: > On Thu, Jan 17, 2013 at 12:23 PM, Michael S. Tsirkin wrote: >> in otgher words, we might need to split a single desc to multiple >> iov entries. > > Splitting descriptors doesn't work for me. As described earlier, I > receive one IP-frame for each descriptor. So I need t

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-18 Thread Rusty Russell
Rusty Russell writes: > "Michael S. Tsirkin" writes: >> On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: >>> "Michael S. Tsirkin" writes: >>> >> +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) >>> >>

[PATCH 6/6] tools/virtio: adapt for API changes.

2013-01-17 Thread Rusty Russell
Signed-off-by: Rusty Russell --- tools/virtio/vringh_test.c | 23 +-- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tools/virtio/vringh_test.c b/tools/virtio/vringh_test.c index f3868f4..df09a3f 100644 --- a/tools/virtio/vringh_test.c +++ b/tools/virtio

[PATCH 4/6] tools/virtio: add vring_test.

2013-01-17 Thread Rusty Russell
, pinged 3172148 Time: R=17.659 U=6.640 S=6.640 ./vringh_test --eventidx --parallel: Using CPUS 0 and 3 Guest: notified 156357, pinged 156251 Host: notified 156251, pinged 78179 Time: R=4.518 U=3.536 S=3.536 Signed-off-by: Rusty Russell --- tools/virtio

[PATCH 1/6] virtio_host: host-side implementation of virtio rings.

2013-01-17 Thread Rusty Russell
, which gcc inlines correctly. Signed-off-by: Rusty Russell --- drivers/Makefile |2 +- drivers/vhost/Kconfig|8 + drivers/vhost/Kconfig.tcm|1 + drivers/vhost/Makefile |2 + drivers/vhost/vringh.c | 818

[PATCH 3/6] tools/virtio: separate headers more.

2013-01-17 Thread Rusty Russell
This makes them a bit more like the kernel headers, so we can include more real kernel headers in our tests. Signed-off-by: Rusty Russell --- tools/virtio/asm/barrier.h | 14 +++ tools/virtio/linux/bug.h|8 ++ tools/virtio/linux/err.h| 26

[PATCH 5/6] vringh: separate callback for notification.

2013-01-17 Thread Rusty Russell
=3.456 S=3.456 Using CPUS 0 and 3 Guest: notified 156578, pinged 156251 Host: notified 156251, pinged 78289 R=4.248 U=3.436 S=3.436 Using CPUS 0 and 3 Guest: notified 156594, pinged 156251 Host: notified 156251, pinged 78297 R=4.329 U=3.416 S=3.416 Signed-off-by: Rusty Russell --- drivers/vhost

[PATCH 2/6] tools/virtio: fix compile.

2013-01-17 Thread Rusty Russell
Didn't test that it actually works, mind you! Signed-off-by: Rusty Russell --- tools/virtio/linux/virtio.h |9 - tools/virtio/virtio_test.c |6 +++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/virtio/linux/virtio.h b/tools/virtio/linux/virtio.h

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-16 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Jan 16, 2013 at 01:43:32PM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> >> +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) >> >> +{ >> >> + struct iovec *new; >

Re: [QEMU PATCH v2] virtio-net: introduce a new macaddr control

2013-01-16 Thread Rusty Russell
ak...@redhat.com writes: > @@ -349,6 +351,14 @@ static int virtio_net_handle_mac(VirtIONet *n, uint8_t > cmd, > { > struct virtio_net_ctrl_mac mac_data; > > +if (cmd == VIRTIO_NET_CTRL_MAC_ADDR_SET && elem->out_num == 2 && > +elem->out_sg[1].iov_len == ETH_ALEN) { > +/*

Re: [PATCH 2/2] virtio-scsi: reset virtqueue affinity when doing cpu hotplug

2013-01-15 Thread Rusty Russell
Wanlong Gao writes: > Add hot cpu notifier to reset the request virtqueue affinity > when doing cpu hotplug. You need to be careful to get_online_cpus() and put_online_cpus() here, so CPUs can't go up and down in the middle of operations. In particular, get_online_cpus()/put_online_cpus() around

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-15 Thread Rusty Russell
"Michael S. Tsirkin" writes: >> +static int resize_iovec(struct vringh_iov *iov, gfp_t gfp) >> +{ >> +struct iovec *new; >> +unsigned int new_num = iov->max * 2; > > We must limit this I think, this is coming > from userspace. How about UIO_MAXIOV? We limit it to the ring size already; UI

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-11 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Fri, Jan 11, 2013 at 09:18:33AM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > On Thu, Jan 10, 2013 at 09:00:55PM +1030, Rusty Russell wrote: >> >> Not sure why vhost/net doesn't built a p

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-11 Thread Rusty Russell
Sjur Brændeland writes: > How do you see the in-kernel API for this? I would like to see > something similar to my previous patches, where we extend > the virtqueue API. E.g. something like this: > struct virtqueue *vring_new_virtqueueh(unsigned int index, > u

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
rtio_host.h new file mode 100644 index 000..07bb4f6 --- /dev/null +++ b/include/linux/virtio_host.h @@ -0,0 +1,88 @@ +/* + * Linux host-side vring helpers; for when the kernel needs to access + * someone else's vring. + * + * Copyright IBM Corporation, 2013. + * Parts taken from dri

Re: [RFC PATCH 0/2] make mac programming for virtio net more robust

2013-01-10 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Jan 10, 2013 at 10:45:39PM +0800, ak...@redhat.com wrote: >> From: Amos Kong >> >> Currenly mac is programmed byte by byte. This means that we >> have an intermediate step where mac is wrong. >> >> Second patch introduced a new vq control command to set

Re: [RFC PATCH 2/2] virtio-net: introduce a new control to set macaddr

2013-01-10 Thread Rusty Russell
"Michael S. Tsirkin" writes: >> +if (virtio_has_feature(vdev, VIRTIO_NET_F_MAC)) { >> +/* Set MAC address by writing config space */ >> vdev->config->set(vdev, offsetof(struct virtio_net_config, mac), >>dev->dev_addr, dev->addr_len); >>

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
Sjur Brændeland writes: > Hi Rusty, > > On Thu, Jan 10, 2013 at 11:30 AM, Rusty Russell wrote: > ... >>I now have some lightly-tested code (via a userspace harness). > > Great - thank you for looking into this. I will start integrating this > with my patches > wh

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Jan 10, 2013 at 09:00:55PM +1030, Rusty Russell wrote: >> Not sure why vhost/net doesn't built a packet and feed it in >> netif_rx_ni(). This is what tun seems to do, and with this code it >> should be fairly optimal. &

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-10 Thread Rusty Russell
Rusty Russell writes: > It basically involves moving much of vring.c into a virtio_host.c: the > parts which actually touch the ring. Then it provides accessors for > vring.c to use which are __user-safe (all casts are inside > virtio_host.c). > > I should have something to po

Re: [PATCH] virtio-spec: fix two typos

2013-01-09 Thread Rusty Russell
Stefan Hajnoczi writes: > On Wed, Jan 09, 2013 at 03:55:23PM +0800, ak...@redhat.com wrote: >> From: Amos Kong >> >> VIRTIO_NET_F_VTRL_VQ -> VIRTIO_NET_F_CTRL_VQ >> VIRTIO_NET_CTRL_MQ is defined to 4 in kernel code >> >> Signed-off-by: Amos Kong >> --- >> virtio-spec.lyx | 4 ++-- >> 1 file

Re: [PATCH V3 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-09 Thread Rusty Russell
Wanlong Gao writes: > On 01/09/2013 07:31 AM, Rusty Russell wrote: >> Wanlong Gao writes: >>> */ >>> static u16 virtnet_select_queue(struct net_device *dev, struct sk_buff >>> *skb) >>> { >>> - int t

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2013-01-08 Thread Rusty Russell
Sjur Brændeland writes: > On Fri, Dec 21, 2012 at 7:11 AM, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> >>> On Wed, Dec 05, 2012 at 03:36:58PM +0100, Sjur Brændeland wrote: >>>> Feedback on this patch-set is appreciated, particularly on

Re: [PATCH V3 1/2] virtio-net: fix the set affinity bug when CPU IDs are not consecutive

2013-01-08 Thread Rusty Russell
Wanlong Gao writes: > */ > static u16 virtnet_select_queue(struct net_device *dev, struct sk_buff *skb) > { > - int txq = skb_rx_queue_recorded(skb) ? skb_get_rx_queue(skb) : > - smp_processor_id(); > + int txq = 0; > + > + if (skb_rx_queue_recorded(skb)) > +

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-07 Thread Rusty Russell
Paolo Bonzini writes: > Il 07/01/2013 01:02, Rusty Russell ha scritto: >> Paolo Bonzini writes: >>> Il 02/01/2013 06:03, Rusty Russell ha scritto: >>>> Paolo Bonzini writes: >>>>> The virtqueue_add_buf function has two limitations: >>>

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-06 Thread Rusty Russell
Paolo Bonzini writes: > Il 02/01/2013 06:03, Rusty Russell ha scritto: >> Paolo Bonzini writes: >>> The virtqueue_add_buf function has two limitations: >>> >>> 1) it requires the caller to provide all the buffers in a single call; >>> >>> 2)

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-06 Thread Rusty Russell
Wanlong Gao writes: > On 01/02/2013 01:03 PM, Rusty Russell wrote: >> Paolo Bonzini writes: >>> The virtqueue_add_buf function has two limitations: >>> >>> 1) it requires the caller to provide all the buffers in a single call; >>> >>> 2) it d

Re: [PATCH] virtio-spec: serial: english tweak

2013-01-02 Thread Rusty Russell
"Michael S. Tsirkin" writes: > "A number of virtqueues are created" seems clearer > than "the number of virtqueues": it's > virtqueues that are created not the number. "the appropriate number" <- there is only one appropriate number. "an appropriate number" <- there is at least one appropriate nu

Re: [PATCH v2 1/5] virtio: add functions for piecewise addition of buffers

2013-01-01 Thread Rusty Russell
plementation by having another interface is pretty nasty; I think I'd prefer the chained scatterlists, if that's optimal for you. Cheers, Rusty. From: Rusty Russell Subject: virtio: use chained scatterlists. Rather than handing a scatterlist[] and out and in numbers to virtqueue_add_b

Re: [PATCH] virtio-blk: Don't free ida when disk is in use

2013-01-01 Thread Rusty Russell
Alexander Graf writes: > On 20.12.2012, at 09:46, Asias He wrote: > >> On 12/20/2012 12:15 PM, Rusty Russell wrote: >>> Alexander Graf writes: >>> >>>> When a file system is mounted on a virtio-blk disk, we then remove it >>>> and then re

Re: [PATCH 2/2] Document VIRTIO_BLK_T_GET_ID

2013-01-01 Thread Rusty Russell
Alexey Zaytsev writes: > Signed-off-by: Alexey Zaytsev > Reviewed-by: Stefan Hajnoczi Thanks, applied. Cheers, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtual

Re: [RFCv2 00/12] Introduce host-side virtio queue and CAIF Virtio.

2012-12-20 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Dec 05, 2012 at 03:36:58PM +0100, Sjur Brændeland wrote: >> Feedback on this patch-set is appreciated, particularly on structure >> and code-reuse between vhost.c and the host-side virtio-queue. >> I'd also like some suggestions on how to handle the build co

Re: [PATCH] virtio-blk: Don't free ida when disk is in use

2012-12-19 Thread Rusty Russell
Alexander Graf writes: > When a file system is mounted on a virtio-blk disk, we then remove it > and then reattach it, the reattached disk gets the same disk name and > ids as the hot removed one. > > This leads to very nasty effects - mostly rendering the newly attached > device completely unusa

Re: [Qemu-devel] [PATCH v6 12/12] virtio-blk: add x-data-plane=on|off performance feature

2012-12-19 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Tue, Dec 18, 2012 at 03:57:17PM +0100, Stefan Hajnoczi wrote: >> > > @@ -407,6 +409,14 @@ static void virtio_blk_handle_output(VirtIODevice >> > > *vdev, VirtQueue *vq) >> > > .num_writes = 0, >> > > }; >> > > >> > > +/* Some guests kick befor

Re: [PATCH] virtio-spec: fix thinko in multiport documentation

2012-12-13 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Dec 12, 2012 at 02:44:20PM +0530, Amit Shah wrote: >> On (Wed) 12 Dec 2012 [10:22:24], Michael S. Tsirkin wrote: >> > On Sun, Sep 09, 2012 at 02:08:37PM +0300, Michael S. Tsirkin wrote: >> > > spec numbers ports port0, port 1 etc, then goes on to say >> > >

Re: [[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal

2012-12-11 Thread Rusty Russell
Amit Shah writes: > On (Tue) 11 Dec 2012 [09:39:41], Rusty Russell wrote: >> Amit Shah writes: >> >> > On (Fri) 16 Nov 2012 [11:22:09], Rusty Russell wrote: >> >> Amit Shah writes: >> >> > From: Sjur Brændeland >> >> >

Re: [PATCH V3 2/2] virtio: add drv_to_virtio to make code clearly

2012-12-10 Thread Rusty Russell
Wanlong Gao writes: > Add drv_to_virtio wrapper to get virtio_driver from device_driver. > > Cc: Rusty Russell > Cc: "Michael S. Tsirkin" > Signed-off-by: Wanlong Gao Thanks, both applied. Cheers, Rusty. ___ Vi

Re: [PATCHv7] virtio-spec: virtio network device multiqueue support

2012-12-10 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Add multiqueue support to virtio network device. > Add a new feature flag VIRTIO_NET_F_MQ for this feature, a new > configuration field max_virtqueue_pairs to detect supported number of > virtqueues as well as a new command VIRTIO_NET_CTRL_MQ to program > packet ste

Re: [[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal

2012-12-10 Thread Rusty Russell
Amit Shah writes: > On (Fri) 16 Nov 2012 [11:22:09], Rusty Russell wrote: >> Amit Shah writes: >> > From: Sjur Brændeland >> > >> > Remove buffers from the out-queue when a port is removed. Rproc_serial >> > communicates with remote processors tha

Re: [PATCH 0/1] virtio: console: regression in virtqueue_add_buf() change

2012-12-09 Thread Rusty Russell
ev/virtio-ports/. > > I've just updated your commit with the small diff (attached below). > Please put this commit after > > commit e794093a52cdfef09b3fdb6294b75ab8cacb30a8 > Author: Rusty Russell > Date: Tue Oct 16 23:56:14 2012 +1030 > > virtio_n

Re: [PATCHv6] virtio-spec: virtio network device multiqueue support

2012-12-09 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Add multiqueue support to virtio network device. > Add a new feature flag VIRTIO_NET_F_MQ for this feature, a new > configuration field max_virtqueue_pairs to detect supported number of > virtqueues as well as a new command VIRTIO_NET_CTRL_MQ to program > packet stee

Re: [PATCHv5] virtio-spec: virtio network device RFS support

2012-12-06 Thread Rusty Russell
Ben Hutchings writes: > If you want a name for the whole set of > features involved, I don't see any better name than 'multiqueue'/'MQ'. OK, let's go back to multiqueue then, and perhaps refer to the current receive steering as 'automatic'. Cheers, Rusty. ___

Re: [PATCH 1/3] virtio: change to_vp_device to an inlined definition

2012-12-05 Thread Rusty Russell
Stephen Hemminger writes: > On Wed, 5 Dec 2012 15:03:27 +0800 > Wanlong Gao wrote: > >> to_vp_device is worth changing to inlined definition. >> >> Signed-off-by: Wanlong Gao >> --- >> drivers/virtio/virtio_pci.c | 6 +- >> 1 file changed, 1 insertion(+), 5 deletions(-) >> >> diff --git

Re: [PATCH 1/3] virtio: change to_vp_device to an inlined definition

2012-12-05 Thread Rusty Russell
Wanlong Gao writes: > to_vp_device is worth changing to inlined definition. Why? Thanks, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization

Re: [net-next rfc v7 1/3] virtio-net: separate fields of sending/receiving queue from virtnet_info

2012-12-03 Thread Rusty Russell
Jason Wang writes: > On Monday, December 03, 2012 12:25:42 PM Rusty Russell wrote: >> > + >> > + /* Work struct for refilling if we run low on memory. */ >> > + struct delayed_work refill; >> >> I can't really see the justificaiton for a refill pe

Re: [net-next rfc v7 1/3] virtio-net: separate fields of sending/receiving queue from virtnet_info

2012-12-02 Thread Rusty Russell
Jason Wang writes: > To support multiqueue transmitq/receiveq, the first step is to separate queue > related structure from virtnet_info. This patch introduce send_queue and > receive_queue structure and use the pointer to them as the parameter in > functions handling sending/receiving. OK, seems

Re: [net-next rfc v7 2/3] virtio_net: multiqueue support

2012-12-02 Thread Rusty Russell
Jason Wang writes: > +static const struct ethtool_ops virtnet_ethtool_ops; > + > +/* > + * Converting between virtqueue no. and kernel tx/rx queue no. > + * 0:rx0 1:tx0 2:cvq 3:rx1 4:tx1 ... 2N+1:rxN 2N+2:txN > + */ > +static int vq2txq(struct virtqueue *vq) > +{ > + int index = virtqueue_get_

Re: [PATCHv4] virtio-spec: virtio network device RFS support

2012-12-02 Thread Rusty Russell
"Michael S. Tsirkin" writes: > Add RFS support to virtio network device. > Add a new feature flag VIRTIO_NET_F_RFS for this feature, a new > configuration field max_virtqueue_pairs to detect supported number of > virtqueues as well as a new command VIRTIO_NET_CTRL_RFS to program > packet steering

Re: [[PATCH v9 3/3] 1/1] virtio_console: Remove buffers from out_vq at port removal

2012-11-15 Thread Rusty Russell
Amit Shah writes: > From: Sjur Brændeland > > Remove buffers from the out-queue when a port is removed. Rproc_serial > communicates with remote processors that may crash and leave buffers in > the out-queue. The virtio serial ports may have buffers in the out-queue > as well, e.g. for non-blockin

Re: [PATCH v11 5/7] virtio_balloon: introduce migration primitives to balloon pages

2012-11-11 Thread Rusty Russell
Rafael Aquini writes: > On Thu, Nov 08, 2012 at 09:32:18AM +1030, Rusty Russell wrote: >> The first one can be delayed, the second one can be delayed if the host >> didn't ask for VIRTIO_BALLOON_F_MUST_TELL_HOST (qemu doesn't). >> >> We could implement

Re: [PATCH v3] virtio-mmio: Fix irq parsing in command line parameter

2012-11-08 Thread Rusty Russell
Pawel Moll writes: > When the resource_size_t is 64-bit long, the sscanf() on > the virtio device command line paramter string may return > wrong value because its format was defined as "%u". Fixed > by using an intermediate local value of a known length. > > Also added cleaned up the resource cre

Re: [PATCH] virtio: Don't access index after unregister.

2012-11-08 Thread Rusty Russell
Cornelia Huck writes: > Virtio wants to release used indices after the corresponding > virtio device has been unregistered. However, virtio does not > hold an extra reference, giving up its last reference with > device_unregister(), making accessing dev->index afterwards > invalid. > > I actually

Re: [PATCH] virtio-mmio: Fix irq parsing in command line parameter

2012-11-08 Thread Rusty Russell
Lee Jones writes: >> > Resorted to poaching now have we Pawel? > >> I hope you were joking! > > Yes, of course. I thought that was clearly indicated by the jovial winking > smiley. :) > > I realise it wasn't obvious soley by this exchange, but Pawel and I are > actually ol' friends. > >> Doing yo

Re: [PATCH] virtio-mmio: Fix irq parsing in command line parameter

2012-11-07 Thread Rusty Russell
Lee Jones writes: > On Mon, 05 Nov 2012, Pawel Moll wrote: > >> On 64-bit machines resource_size_t is a 64-bit value, while >> sscanf() format for this argument was defined as "%u". Fixed >> by using an intermediate local value of a known length. >> >> Also added cleaned up the resource creation

Re: [PATCH 1/1] vhost-blk: Add vhost-blk support v4

2012-11-07 Thread Rusty Russell
Asias He writes: > vhost-blk is an in-kernel virito-blk device accelerator. > > Due to lack of proper in-kernel AIO interface, this version converts > guest's I/O request to bio and use submit_bio() to submit I/O directly. > So this version any supports raw block device as guest's disk image, > e.

Re: [PATCH v2] virtio-mmio: Fix irq parsing in the command line

2012-11-07 Thread Rusty Russell
Pawel Moll writes: > On 64-bit machines resource_size_t is a 64-bit value, while > sscanf() format for this argument was defined as "%u". Fixed > by using an intermediate local value of a known length. Actually, on 32-bit machines, too (eg. x86 with PAE). Otherwise we'd just change it to %lu.

Re: [PATCH resend] virtio_console: Free buffers from out-queue upon close

2012-11-07 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: > From: Sjur Brændeland > > Free pending output buffers from the virtio out-queue when > host has acknowledged port_close. Also removed WARN_ON() > in remove_port_data(). > > Signed-off-by: Sjur Brændeland > --- > > Resending, this time including a proper "

Re: [PATCH v11 5/7] virtio_balloon: introduce migration primitives to balloon pages

2012-11-07 Thread Rusty Russell
Rafael Aquini writes: > + * virtballoon_migratepage - perform the balloon page migration on behalf of > + *a compation thread. (called under page lock) > + if (!mutex_trylock(&vb->balloon_lock)) > + return -EAGAIN; Erk, OK... > + /* balloon's page

Re: [RFC virtio-next 0/4] Introduce CAIF Virtio and reversed Vrings

2012-11-05 Thread Rusty Russell
Sjur Brændeland writes: > Hi Rusty, > >> So, this adds another host-side virtqueue implementation. >> >> Can we combine them together conveniently? You pulled out more stuff >> into vring.h which is a start, but it's a bit overloaded. >> Perhaps we should separate the common fields into struct vr

Re: [PATCHv8 0/3]virtio_console: Add rproc_serial driver

2012-11-05 Thread Rusty Russell
Amit Shah writes: > On (Mon) 05 Nov 2012 [11:31:24], Amit Shah wrote: >> On (Mon) 05 Nov 2012 [09:11:45], Rusty Russell wrote: >> > Sjur Brændeland writes: >> > >> > > From: Sjur Brændeland >> > > >> > > This patch-set introd

Re: [PATCH 6/9] virtio_mmio: Cast &resources[1].start to ‘unsigned int *’ to rid compiler warning

2012-11-04 Thread Rusty Russell
Lee Jones writes: > drivers/virtio/virtio_mmio.c: In function ‘vm_cmdline_set’: > drivers/virtio/virtio_mmio.c:535:4: warning: format ‘%u’ expects argument of > type ‘unsigned int *’, but argument 4 has type ‘resource_size_t *’ [-Wformat] > > Cc: Rusty Russell > Cc: virtuali

Re: [rfc net-next v6 2/3] virtio_net: multiqueue support

2012-11-04 Thread Rusty Russell
Jason Wang writes: > +struct virtnet_info { > + u16 num_queue_pairs;/* # of RX/TX vq pairs */ > + u16 total_queue_pairs; > + > + struct send_queue *sq; > + struct receive_queue *rq; > + struct virtqueue *cvq; > + > + struct virtio_device *vdev; > + struct ne

Re: [PATCHv8 0/3]virtio_console: Add rproc_serial driver

2012-11-04 Thread Rusty Russell
Sjur Brændeland writes: > From: Sjur Brændeland > > This patch-set introduces a new virtio type "rproc_serial" for communicating > with remote processors over shared memory. The driver depends on the > the remoteproc framework. As preparation for introducing "rproc_serial" > I've done a refactor

Re: [rfc net-next v6 2/3] virtio_net: multiqueue support

2012-11-04 Thread Rusty Russell
Jason Wang writes: > This addes multiqueue support to virtio_net driver. There's two mode > supported: > single queue pair mode and multiple queue pairs mode. An obvious > difference compared with a physical mq card is that virtio-net reserve > first two virtqueues when it is working in multiqueu

Re: [rfc net-next v6 3/3] virtio-net: change the number of queues through ethtool

2012-11-04 Thread Rusty Russell
Jason Wang writes: > This patch implement the {set|get}_channels method of ethool to allow user to > change the number of queues dymaically when the device is running. This would > let the user to tune the device for specific applications. ... > + /* Only two modes were support currently */ >

Re: [PATCHv7 4/4] virtio_console: Add support for remoteproc serial

2012-11-01 Thread Rusty Russell
Amit Shah writes: > On (Tue) 23 Oct 2012 [12:17:49], Rusty Russell wrote: >> sjur.brandel...@stericsson.com writes: >> > From: Sjur Brændeland > >> > @@ -1415,7 +1524,16 @@ static void remove_port_data(struct port *port) >> > >> >/* Remove b

Re: [RFC virtio-next 0/4] Introduce CAIF Virtio and reversed Vrings

2012-11-01 Thread Rusty Russell
Sjur Brændeland writes: > Zero-Copy data transport on the modem is primary goal for CAIF Virtio. > In order to achieve Zero-Copy the direction of the Virtio rings are > flipped in the RX direction. So we have implemented the Virtio > access-function similar to what is found in vhost.c. So, this a

Re: [PATCH 14/16] virtio: Convert dev_printk(KERN_ to dev_(

2012-10-31 Thread Rusty Russell
Joe Perches writes: > dev_ calls take less code than dev_printk(KERN_ > and reducing object size is good. > Convert if (printk_ratelimit()) dev_printk to dev__ratelimited. > > Signed-off-by: Joe Perches Applied. Thanks, Rusty. ___ Virtualization mail

Re: Linux-next changes for module and virtio trees.

2012-10-30 Thread Rusty Russell
Stephen Rothwell writes: > Hi Rusty, > > On Tue, 02 Oct 2012 15:56:56 +0930 Rusty Russell > wrote: >> >> Please remove my quilt tree >> http://ozlabs.org/~rusty/kernel/rr-latest/ from linux-next, and use my >> git trees from now on: >> >&g

Re: [PATCH] virtio-ccw: Clarifications.

2012-10-30 Thread Rusty Russell
Cornelia Huck writes: > Clarify how indicator location is communicated and that the > feature bits are little-endian. > > Signed-off-by: Cornelia Huck Thanks, applied! Cheers, Rusty. ___ Virtualization mailing list Virtualization@lists.linux-foundati

Re: [PATCHv7 4/4] virtio_console: Add support for remoteproc serial

2012-10-22 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: > From: Sjur Brændeland > > Add a simple serial connection driver called > VIRTIO_ID_RPROC_SERIAL (11) for communicating with a > remote processor in an asymmetric multi-processing > configuration. > > This implementation reuses the existing virtio_console >

Re: [PATCH v2 1/3] mm: highmem: export kmap_to_page for modules

2012-10-22 Thread Rusty Russell
Will Deacon writes: > Some virtio device drivers (9p) need to translate high virtual addresses > to physical addresses, which are inserted into the virtqueue for > processing by userspace. > > This patch exports the kmap_to_page symbol, so that the affected drivers > can be compiled as modules.

Re: [PATCH] vhost-blk: Add vhost-blk support v2

2012-10-22 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Oct 18, 2012 at 02:50:56PM +1030, Rusty Russell wrote: >> Asias He writes: >> >>> +#define BLK_HDR 0 >> >> >> >> What's this for, exactly? Please add a comment. >> > >> > The

Re: [PATCHv7 3/4] virtio_console: Merge struct buffer_token into struct port_buffer

2012-10-22 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: > From: Sjur Brændeland > > Refactoring the splice functionality by unifying the approach for > sending scatter-lists and regular buffers. This simplifies > buffer handling and reduces code size. Splice will now allocate > a port_buffer and send_buf() and fre

Re: [PATCHv7 2/4] virtio_console: Use kmalloc instead of kzalloc

2012-10-22 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: > From: Sjur Brændeland > > Avoid the more cpu expensive kzalloc when allocating buffers. > Originally kzalloc was intended for isolating the guest from > the host by not sending random guest data to the host. But device > isolation is not yet in place so kz

Re: [PATCHv7 1/4] virtio_console: Free buffer if splice fails

2012-10-22 Thread Rusty Russell
sjur.brandel...@stericsson.com writes: > From: Sjur Brændeland > > Free the allocated scatter list if send_pages fails in function > port_splice_write. > > Signed-off-by: Sjur Brændeland Didn't see Amit ack this, but applied anyway. Thanks, Rusty. ___

Re: [PATCH] virtio: 9p: correctly pass physical address to userspace for high pages

2012-10-18 Thread Rusty Russell
Will Deacon writes: > On Thu, Oct 18, 2012 at 03:19:06AM +0100, Rusty Russell wrote: >> We do have an alternate solution: masking out __GFP_HIGHMEM from the >> kmalloc of desc. If it fails, we will fall back to laying out the >> virtio request directly inside the ring; if

Re: [PATCH] vhost-blk: Add vhost-blk support v2

2012-10-17 Thread Rusty Russell
Asias He writes: >>> +#define BLK_HDR0 >> >> What's this for, exactly? Please add a comment. > > The block headr is in the first and separate buffer. Please don't assume this! We're trying to fix all the assumptions in qemu at the moment. vhost_net handles this correctly, taking bytes off

Re: [PATCH] virtio: 9p: correctly pass physical address to userspace for high pages

2012-10-17 Thread Rusty Russell
Will Deacon writes: > When using a virtio transport, the 9p net device allocates pages to back > the descriptors inserted into the virtqueue. These allocations may be > performed from atomic context (under the channel lock) and can therefore > return high mappings which aren't suitable for virt_to

Re: [PATCH 1/5] virtio: move queue_index and num_free fields into core struct virtqueue.

2012-10-16 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Wed, Oct 17, 2012 at 12:00:48AM +1030, Rusty Russell wrote: >> * @priv: a pointer for the virtqueue implementation to use. >> + * @index: the zero-based ordinal number for this queue. >> + * @num_free: number of buffers we exp

Re: Using PCI config space to indicate config location

2012-10-16 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Tue, Oct 16, 2012 at 11:45:41PM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> I was assuming the implementation would keep two complete copies of the >> config space: writes go to the scratch version, w

Re: [PATCH 5/5] virtio: make virtqueue_add_buf() returning 0 on success, not capacity.

2012-10-16 Thread Rusty Russell
Note: I also have minor cleanups to virtio drivers to change (ret >= 0) to (ret == 0) where it would otherwise be confusing for new readers, but I didn't clutter the list with them. See my virtio-wip tree for the gory details. Cheers, Rusty. ___ Virtual

[PATCH 3/5] virtio-net: correct capacity math on ring full

2012-10-16 Thread Rusty Russell
ath. It's easy to query ring capacity so let's do just that. This change also makes it easier to move vnet header for tx around as follow-up patch does. Signed-off-by: Michael S. Tsirkin Signed-off-by: Rusty Russell --- drivers/net/virtio_net.c |9 - 1 file changed

[PATCH 5/5] virtio: make virtqueue_add_buf() returning 0 on success, not capacity.

2012-10-16 Thread Rusty Russell
Now noone relies on this behavior, we simplify virtqueue_add_buf() so it return 0 or -errno. Signed-off-by: Rusty Russell --- drivers/virtio/virtio_ring.c |7 ++- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c

[PATCH 1/5] virtio: move queue_index and num_free fields into core struct virtqueue.

2012-10-16 Thread Rusty Russell
They're generic concepts, so hoist them. This also avoids accessor functions. This goes even further than Jason Wang's 17bb6d4088 patch ("virtio-ring: move queue_index to vring_virtqueue") which moved the queue_index from the specific transport. Signed-off-by: Rusty Russell

[PATCH 4/5] virtio_net: don't rely on virtqueue_add_buf() returning capacity.

2012-10-16 Thread Rusty Russell
Now we can easily use vq->num_free to determine if there are descriptors left in the queue, we're about to change virtqueue_add_buf() to return 0 on success. The virtio_net driver is the only one which actually uses the return value, so change that. Signed-off-by: Rusty Russell --- dri

[PATCH 2/5] virtio-net: remove unused skb_vnet_hdr->num_sg field

2012-10-16 Thread Rusty Russell
From: "Michael S. Tsirkin" [Split from "correct capacity math on ring full" -- Rusty] Signed-off-by: Michael S. Tsirkin Signed-off-by: Rusty Russell --- drivers/net/virtio_net.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/vi

Re: Using PCI config space to indicate config location

2012-10-16 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Fri, Oct 12, 2012 at 08:21:50PM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > On Fri, Oct 12, 2012 at 08:59:36AM +1030, Rusty Russell wrote: >> >> >> For writes, the standard s

Re: Using PCI config space to indicate config location

2012-10-12 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Fri, Oct 12, 2012 at 08:59:36AM +1030, Rusty Russell wrote: >> >> For writes, the standard seems to be a commit latch. We could abuse the >> >> generation count for this: the driver writes to it to commit config >> &

Re: Using PCI config space to indicate config location

2012-10-11 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Oct 11, 2012 at 11:48:22AM +1030, Rusty Russell wrote: >> "Michael S. Tsirkin" writes: >> > On Mon, Oct 08, 2012 at 12:51:25PM +1030, Rusty Russell wrote: >> >> Note before anyone gets confused; we were

Re: [PATCH] [SCSI] virtio-scsi: Add real 2-clause BSD license to header

2012-10-11 Thread Rusty Russell
Paolo Bonzini writes: > Il 11/10/2012 08:41, Bryan Venteicher ha scritto: >> This is analogous to commit a1b383870a made by Rusty Russell to all >> the VirtIO headers at the time. This eases the use of the header as >> is by other OSes. >> >> Signed-off-by: Brya

Re: [PATCH 0/3] virtio-net: inline header support

2012-10-11 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Thu, Oct 11, 2012 at 10:33:31AM +1030, Rusty Russell wrote: >> OK. Well, Anthony wants qemu to be robust in this regard, so I am >> tempted to rework all the qemu drivers to handle arbitrary layouts. >> They could use a good audit

Re: [PATCH] virtio-pci: use module_pci_driver to simplify the code

2012-10-11 Thread Rusty Russell
Wei Yongjun writes: > From: Wei Yongjun > > Use the module_pci_driver() macro to make the code simpler > by eliminating module_init and module_exit calls. > > dpatch engine is used to auto generate this patch. > (https://github.com/weiyj/dpatch) > > Signed-off-by: Wei Yongjun Thanks, applied!

Re: Using PCI config space to indicate config location

2012-10-10 Thread Rusty Russell
"Michael S. Tsirkin" writes: > On Mon, Oct 08, 2012 at 12:51:25PM +1030, Rusty Russell wrote: >> Note before anyone gets confused; we were talking about using the PCI >> config space to indicate what BAR(s) the virtio stuff is in. An >> alternative would be to sim

<    1   2   3   4   5   6   7   8   9   10   >