Re: [PATCH v2 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-03-16 Thread Yongji Xie
On Wed, Mar 16, 2022 at 9:28 PM Stefan Hajnoczi wrote: > > On Tue, Mar 15, 2022 at 07:38:12PM +0800, Yongji Xie wrote: > > On Tue, Mar 15, 2022 at 5:48 PM Stefan Hajnoczi wrote: > > > > > > On Tue, Feb 15, 2022 at 06:59:40PM +0800, Xie Yongji wrote: > >

Re: [PATCH v2 4/6] vduse-blk: implements vduse-blk export

2022-03-16 Thread Yongji Xie
On Wed, Mar 16, 2022 at 8:16 PM Stefan Hajnoczi wrote: > > On Tue, Mar 15, 2022 at 07:52:03PM +0800, Yongji Xie wrote: > > On Tue, Mar 15, 2022 at 7:08 PM Stefan Hajnoczi wrote: > > > > > > On Tue, Feb 15, 2022 at 06:59:41PM +0800, Xie Yongji wrote: > > > &

Re: [PATCH v2 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-03-16 Thread Yongji Xie
On Wed, Mar 16, 2022 at 11:51 PM Stefan Hajnoczi wrote: > > On Wed, Mar 16, 2022 at 09:49:19PM +0800, Yongji Xie wrote: > > On Wed, Mar 16, 2022 at 9:28 PM Stefan Hajnoczi wrote: > > > > > > On Tue, Mar 15, 2022 at 07:38:12PM +0800, Yongji Xie wrote: > >

Re: [PATCH v2 6/6] libvduse: Add support for reconnecting

2022-03-15 Thread Yongji Xie
On Tue, Mar 15, 2022 at 9:48 PM Stefan Hajnoczi wrote: > > On Tue, Feb 15, 2022 at 06:59:43PM +0800, Xie Yongji wrote: > > +static int vduse_queue_inflight_get(VduseVirtq *vq, int desc_idx) > > +{ > > +vq->log->inflight.desc[desc_idx].counter = vq->counter++; > > +

Re: [PATCH v2 4/6] vduse-blk: implements vduse-blk export

2022-03-15 Thread Yongji Xie
On Tue, Mar 15, 2022 at 7:08 PM Stefan Hajnoczi wrote: > > On Tue, Feb 15, 2022 at 06:59:41PM +0800, Xie Yongji wrote: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage. > > > > The new

Re: [PATCH v2 3/6] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-03-15 Thread Yongji Xie
On Tue, Mar 15, 2022 at 5:48 PM Stefan Hajnoczi wrote: > > On Tue, Feb 15, 2022 at 06:59:40PM +0800, Xie Yongji wrote: > > VDUSE [1] is a linux framework that makes it possible to implement > > software-emulated vDPA devices in userspace. This adds a library > > as a subproject to help

Re: [PATCH v3 4/6] vduse-blk: implements vduse-blk export

2022-03-21 Thread Yongji Xie
On Mon, Mar 21, 2022 at 9:25 PM Eric Blake wrote: > > On Mon, Mar 21, 2022 at 03:14:37PM +0800, Xie Yongji wrote: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage. > > > > The new command-line

Re: [PATCH 4/5] vduse-blk: Add vduse-blk resize support

2022-02-07 Thread Yongji Xie
On Mon, Feb 7, 2022 at 10:18 PM Stefan Hajnoczi wrote: > > On Tue, Jan 25, 2022 at 09:17:59PM +0800, Xie Yongji wrote: > > To support block resize, this uses vduse_dev_update_config() > > to update the capacity field in configuration space and inject > > config interrupt on the block resize

Re: [PATCH 2/5] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-02-07 Thread Yongji Xie
On Mon, Feb 7, 2022 at 10:01 PM Stefan Hajnoczi wrote: > > On Tue, Jan 25, 2022 at 09:17:57PM +0800, Xie Yongji wrote: > > VDUSE [1] is a linux framework that makes it possible to implement > > software-emulated vDPA devices in userspace. This adds a library > > as a subproject to help

Re: [PATCH 5/5] libvduse: Add support for reconnecting

2022-02-08 Thread Yongji Xie
On Mon, Feb 7, 2022 at 10:39 PM Stefan Hajnoczi wrote: > > On Tue, Jan 25, 2022 at 09:18:00PM +0800, Xie Yongji wrote: > > To support reconnecting after restart or crash, VDUSE backend > > might need to resubmit inflight I/Os. This stores the metadata > > such as the index of inflight I/O's

Re: [PATCH 5/5] libvduse: Add support for reconnecting

2022-02-08 Thread Yongji Xie
On Tue, Feb 8, 2022 at 4:09 PM Stefan Hajnoczi wrote: > > On Tue, Feb 08, 2022 at 03:35:27PM +0800, Yongji Xie wrote: > > On Mon, Feb 7, 2022 at 10:39 PM Stefan Hajnoczi wrote: > > > > > > On Tue, Jan 25, 2022 at 09:18:00PM +0800, Xie Yongji wrote: > > > &

Re: [PATCH 1/5] linux-headers: Add vduse.h

2022-02-07 Thread Yongji Xie
On Mon, Feb 7, 2022 at 9:12 PM Stefan Hajnoczi wrote: > > On Tue, Jan 25, 2022 at 09:17:56PM +0800, Xie Yongji wrote: > > diff --git a/scripts/update-linux-headers.sh > > b/scripts/update-linux-headers.sh > > index fea4d6eb65..4c7846076f 100755 > > --- a/scripts/update-linux-headers.sh > > +++

Re: [PATCH 3/5] vduse-blk: implements vduse-blk export

2022-02-07 Thread Yongji Xie
On Mon, Feb 7, 2022 at 10:15 PM Stefan Hajnoczi wrote: > > On Tue, Jan 25, 2022 at 09:17:58PM +0800, Xie Yongji wrote: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage. > > > > The new

Re: [PATCH v4 4/6] vduse-blk: implements vduse-blk export

2022-04-26 Thread Yongji Xie
On Wed, Apr 27, 2022 at 1:03 AM Kevin Wolf wrote: > > Am 06.04.2022 um 09:59 hat Xie Yongji geschrieben: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage. > > > > The new command-line syntax

Re: [PATCH v5 0/8] Support exporting BDSs via VDUSE

2022-05-17 Thread Yongji Xie
On Fri, May 13, 2022 at 6:03 PM Michael S. Tsirkin wrote: > > On Wed, May 04, 2022 at 03:40:43PM +0800, Xie Yongji wrote: > > Hi all, > > > > Last few months ago, VDUSE (vDPA Device in Userspace) [1] has > > been merged into Linux kernel as a framework that make it > > possible to emulate a vDPA

Re: [PATCH v5 2/8] block-backend: Introduce blk_get_guest_block_size()

2022-05-19 Thread Yongji Xie
On Wed, May 18, 2022 at 9:17 PM Stefan Hajnoczi wrote: > > On Wed, May 04, 2022 at 03:40:45PM +0800, Xie Yongji wrote: > > Support getting the guest block size for the block backend. > > It's needed for the following commit. > > > > Signed-off-by: Xie Yongji > > --- > > block/block-backend.c

Re: [PATCH v5 3/8] block/export: Abstract out the logic of virtio-blk I/O process

2022-05-19 Thread Yongji Xie
On Wed, May 18, 2022 at 9:14 PM Stefan Hajnoczi wrote: > > On Wed, May 04, 2022 at 03:40:46PM +0800, Xie Yongji wrote: > > -static void vu_blk_req_complete(VuBlkReq *req) > > +static void vu_blk_req_complete(VuBlkReq *req, size_t in_len) > > { > > VuDev *vu_dev = >server->vu_dev; > > > > -

Re: [PATCH v5 8/8] libvduse: Add support for reconnecting

2022-05-19 Thread Yongji Xie
On Wed, May 18, 2022 at 10:03 PM Stefan Hajnoczi wrote: > > On Wed, May 04, 2022 at 03:40:51PM +0800, Xie Yongji wrote: > > @@ -291,6 +294,15 @@ static int vduse_blk_exp_create(BlockExport *exp, > > BlockExportOptions *opts, > > return -ENOMEM; > > } > > > > +

Re: [PATCH v5 5/8] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-05-19 Thread Yongji Xie
On Wed, May 18, 2022 at 9:46 PM Stefan Hajnoczi wrote: > > On Wed, May 04, 2022 at 03:40:48PM +0800, Xie Yongji wrote: > > +static int vduse_queue_update_vring(VduseVirtq *vq, uint64_t desc_addr, > > +uint64_t avail_addr, uint64_t > > used_addr) > > +{ > > +

Re: [PATCH v5 8/8] libvduse: Add support for reconnecting

2022-05-19 Thread Yongji Xie
On Thu, May 19, 2022 at 5:44 PM Stefan Hajnoczi wrote: > > On Thu, May 19, 2022 at 04:25:13PM +0800, Yongji Xie wrote: > > On Wed, May 18, 2022 at 10:03 PM Stefan Hajnoczi > > wrote: > > > > > > On Wed, May 04, 2022 at 03:40:51PM +0800, Xie Yongji wrote: >

Re: [PATCH] qsd: document vduse-blk exports

2022-05-26 Thread Yongji Xie
On Wed, May 25, 2022 at 8:19 PM Stefan Hajnoczi wrote: > > Document vduse-blk exports in qemu-storage-daemon --help and the > qemu-storage-daemon(1) man page. > > Based-on: <20220523084611.91-1-xieyon...@bytedance.com> > Cc: Xie Yongji > Signed-off-by: Stefan Hajnoczi > --- >

Re: [PATCH v2] vduse-blk: Add name option

2022-06-01 Thread Yongji Xie
On Wed, Jun 1, 2022 at 9:03 PM Stefan Hajnoczi wrote: > > On Tue, May 31, 2022 at 05:52:21PM +0800, Xie Yongji wrote: > > Currently we use 'id' option as the name of VDUSE device. > > It's a bit confusing since we use one value for two different > > purposes: the ID to identfy the export within

Re: [PATCH v6 0/8] Support exporting BDSs via VDUSE

2022-05-25 Thread Yongji Xie
On Wed, May 25, 2022 at 8:48 PM Stefan Hajnoczi wrote: > > On Mon, May 23, 2022 at 04:46:03PM +0800, Xie Yongji wrote: > > Hi all, > > > > Last few months ago, VDUSE (vDPA Device in Userspace) [1] has > > been merged into Linux kernel as a framework that make it > > possible to emulate a vDPA

Re: [PATCH v6 0/8] Support exporting BDSs via VDUSE

2022-05-25 Thread Yongji Xie
On Wed, May 25, 2022 at 7:02 PM Stefan Hajnoczi wrote: > > On Mon, May 23, 2022 at 04:46:03PM +0800, Xie Yongji wrote: > > Hi all, > > > > Last few months ago, VDUSE (vDPA Device in Userspace) [1] has > > been merged into Linux kernel as a framework that make it > > possible to emulate a vDPA

Re: [PATCH v6 6/8] vduse-blk: Implement vduse-blk export

2022-05-29 Thread Yongji Xie
On Fri, May 27, 2022 at 11:34 PM Kevin Wolf wrote: > > Am 23.05.2022 um 10:46 hat Xie Yongji geschrieben: > > This implements a VDUSE block backends based on > > the libvduse library. We can use it to export the BDSs > > for both VM and container (host) usage. > > > > The new command-line syntax

Re: [PULL v2 10/20] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-06-27 Thread Yongji Xie
On Mon, Jun 27, 2022 at 12:45 PM Markus Armbruster wrote: > > Kevin Wolf writes: > > > From: Xie Yongji > > > > VDUSE [1] is a linux framework that makes it possible to implement > > software-emulated vDPA devices in userspace. This adds a library > > as a subproject to help implementing VDUSE

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Yongji Xie
On Wed, Jun 29, 2022 at 5:41 PM Markus Armbruster wrote: > > Xie Yongji writes: > > > Coverity pointed out (CID 1490222, 1490227) that we called > > ioctl somewhere without checking the return value. This > > patch fixes these issues. > > > > Fixes: Coverity CID 1490222, 1490227 > >

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Yongji Xie
On Wed, Jun 29, 2022 at 7:39 PM Markus Armbruster wrote: > > Yongji Xie writes: > > > On Wed, Jun 29, 2022 at 5:41 PM Markus Armbruster wrote: > >> > >> Xie Yongji writes: > >> > >> > Coverity pointed out (CID 1490222, 1490227) that we cal

Re: [PATCH 4/4] libvduse: Check the return value of some ioctls

2022-06-29 Thread Yongji Xie
On Wed, Jun 29, 2022 at 9:22 PM Markus Armbruster wrote: > > Yongji Xie writes: > > > On Wed, Jun 29, 2022 at 7:39 PM Markus Armbruster wrote: > >> > >> Yongji Xie writes: > >> > >> > On Wed, Jun 29, 2022 at 5:41 PM Markus Armbrus

Re: [PATCH 2/4] libvduse: Replace strcpy() with strncpy()

2022-06-27 Thread Yongji Xie
On Tue, Jun 28, 2022 at 8:26 AM Richard Henderson wrote: > > On 6/27/22 14:32, Xie Yongji wrote: > > -strcpy(dev_config->name, name); > > +strncpy(dev_config->name, name, VDUSE_NAME_MAX); > > +dev_config->name[VDUSE_NAME_MAX - 1] = '\0'; > > g_strlcpy > Now we don't have a dependency

Re: [PATCH v2] vduse-blk: Add name option

2022-06-06 Thread Yongji Xie
On Mon, Jun 6, 2022 at 7:05 PM Stefan Hajnoczi wrote: > > On Wed, Jun 01, 2022 at 09:10:58PM +0800, Yongji Xie wrote: > > On Wed, Jun 1, 2022 at 9:03 PM Stefan Hajnoczi wrote: > > > > > > On Tue, May 31, 2022 at 05:52:21PM +0800, Xie Yongji wrote: > > > >

Re: Re: [PULL 00/18] Block layer patches

2022-06-13 Thread Yongji Xie
On Tue, Jun 14, 2022 at 1:04 AM Kevin Wolf wrote: > > Am 09.06.2022 um 22:18 hat Richard Henderson geschrieben: > > On 6/9/22 10:21, Kevin Wolf wrote: > > > The following changes since commit > > > 028f2361d0c2d28d6f918fe618f389228ac22b60: > > > > > >Merge tag 'pull-target-arm-20220609' of

Re: [PATCH v6 5/8] libvduse: Add VDUSE (vDPA Device in Userspace) library

2022-06-06 Thread Yongji Xie
On Fri, Jun 3, 2022 at 7:25 PM Maxime Coquelin wrote: > > Hi Yongji, > > On 5/23/22 10:46, Xie Yongji wrote: > > VDUSE [1] is a linux framework that makes it possible to implement > > software-emulated vDPA devices in userspace. This adds a library > > as a subproject to help implementing VDUSE

Re: [PATCH v4 4/6] vduse-blk: implements vduse-blk export

2022-04-27 Thread Yongji Xie
On Wed, Apr 27, 2022 at 9:22 PM Kevin Wolf wrote: > > Am 27.04.2022 um 05:11 hat Yongji Xie geschrieben: > > On Wed, Apr 27, 2022 at 1:03 AM Kevin Wolf wrote: > > > > > > Am 06.04.2022 um 09:59 hat Xie Yongji geschrieben: > > > > Th

Re: [PATCH v3 13/20] block/export: rewrite vduse-blk drain code

2023-04-20 Thread Yongji Xie
Hi Stefan, On Thu, Apr 20, 2023 at 7:39 PM Stefan Hajnoczi wrote: > > vduse_blk_detach_ctx() waits for in-flight requests using > AIO_WAIT_WHILE(). This is not allowed according to a comment in > bdrv_set_aio_context_commit(): > > /* >* Take the old AioContex when detaching it from bs. >

Re: [PATCH v3 13/20] block/export: rewrite vduse-blk drain code

2023-04-25 Thread Yongji Xie
On Wed, Apr 26, 2023 at 12:43 AM Stefan Hajnoczi wrote: > > On Fri, Apr 21, 2023 at 11:36:02AM +0800, Yongji Xie wrote: > > Hi Stefan, > > > > On Thu, Apr 20, 2023 at 7:39 PM Stefan Hajnoczi wrote: > > > > > > vduse_blk_detach_ctx() waits for in-