I suppose your use application just works as the new type “bdev” which will be the namespace of the nvmf target? If so, the SPDK user space nvme

Bdev and aio bdev should be a good reference:

In general bdev layer, when you try to call spdk_bdev_register(), we provide the io channel creation callback as: spdk_bdev_channel_create(),

In this function, we actually will try to call the backend bdev->fn_table->get_io_channel(bdev->ctxt), this should be provided by your application, in

This function, you should implement the poll function just as bdev_nvme_poll(), so, you could keep your our poller for the backend bdev in your own

application without modify of the nvmf target driver. When the nvmf target driver try to call spdk_bdev_get_io_channel() in the function poll_group_update_subsystem(),

it will trigger all the process which I mentioned above.

 

-Cunyin

 

From: SPDK [mailto:spdk-bounces@lists.01.org] On Behalf Of Shahar Salzman
Sent: Sunday, January 14, 2018 5:10 PM
To: Storage Performance Development Kit <spdk@lists.01.org>
Cc: Yael Shavit <yael.shavit@kaminario.com>; Amir Sasson <amir.sasson@kaminario.com>; Ilan Steinberg <ilan.steinberg@kaminario.com>
Subject: [SPDK] SPDK + user space appliance

 

Hi experts,

 

We have been integrating spdk into our system using a blockdev module, currently only a POC version.

Our use case is a user space appliance processing IOs, with an SPDK frontend to do the NVMeF.

 

Currently all of the user bdevs are created via configuration file, but we are working to add functions + rpc's which allow creation/deletion of these namespaces.

IO is sent to user space via callback, implementation is up to user space, but obviously the longer it lingers there the lower the performance, we use a set of rings + threads processing them, so that the time spent in the appliance is minimal.

Going back from user space we use a single ring (multiple producers single consumer) onto which the completions are inserted, and the ring poll function is registered with spdk core (spdk_poller_register).

 

Does this seem like a sane design? We'd really like your feedback, and if this can be useful to others, push the code into spdk.

Obviously we are willing to go through any review/testing process that is required. And share performance results and issues.

 

Cheers,

Shahar