Storage Performance Development Kit (SPDK)
 help / color / mirror / Atom feed
From: Kumaraparameshwaran Rathnavel <krath at cloudsimple.com>
To: spdk@lists.01.org
Subject: Re: [SPDK] BDEV Registration
Date: Fri, 21 Oct 2016 11:39:17 +0530	[thread overview]
Message-ID: <1DB89603-65B0-4308-8B49-507CFC7A4451@cloudsimple.com> (raw)
In-Reply-To: FA6C2217B01E9D48A581BB4866021014376507F7@shsmsx102.ccr.corp.intel.com

[-- Attachment #1: Type: text/plain, Size: 3920 bytes --]

Thanks for the update.

I am still not clear who should call the function SPDK_SUBSYSTEM_REGISTER. I just wanted to add virtual mode subsystem as the NVMe/F target. In configuration the Virtual has two Malloc drives. So even before the main function I should create these devices and add. I find SPDK_SUBSYSTEM_REGISTER in lib/bdev/malloc/blocdev_malloc.c . So who should call this function? Should I call it by writing a separate program.

Thanking You,
Param 
> 
> Hi Param,
> 
> In the iscsi_tgt's main:
> 
> spdk_app_init  -> spdk_subsystem_init   ->   subsystem->init()
> 
> (bdev is also a subsystem:   registered with  SPDK_SUBSYSTEM_REGISTER(bdev, spdk_bdev_initialize, spdk_bdev_finish, spdk_bdev_config_text))
> 
> SPDK_SUBSYSTEM_REGISTER  in bdev will be executed before main, and add the bdev subsystem.
> 
> It will finally call spdk_bdev_initialize   ->  spdk_bdev_module_initialize  ->  call  module_init.
> Thanks.
> 
> Best Regards,
> Ziye Yang
> 
> -----Original Message-----
> From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Kumaraparameshwaran Rathnavel
> Sent: Friday, October 21, 2016 12:09 PM
> To: Storage Performance Development Kit <spdk(a)lists.01.org>
> Subject: Re: [SPDK] BDEV Registration
> 
> Thanks Daniel.
> 
> When will the bdev subsystem get initialised? Which part of the code handles the bdev subsystem initialisation.
> 
> Thanking You,
> Param
>> On 21-Oct-2016, at 3:29 AM, Daniel Verkamp <daniel.verkamp(a)intel.com> wrote:
>> 
>> On 10/20/2016 01:11 PM, Kumaraparameshwaran Rathnavel wrote:
>>> Hi All,
>>> 
>>> I have just started using SPDK. I am in need to implement a NVMe/F target implementation using SPDK. I need to use the Virtual Subsystem. I see that there is support for RAM disks and I am using it as reference to my Virtual implementation .
>>> 
>>> There is a function called SPDK_BDEV_MODULE_REGISTER in the file lib/bdev/malloc/blockdev_malloc.c.
>>> 
>>> How is this function getting called? Who calls this function
>>> 
>>> Regards
>>> Param
>> 
>> Hi Param,
>> 
>> You can find the interface for writing new bdev modules in the header 
>> lib/bdev/bdev_module.h - this is where SPDK_BDEV_MODULE_REGISTER() is defined.  This macro creates a constructor function that adds your bdev module's function pointer table (defined using a spdk_bdev_module_if) to a global list.
>> 
>> Later, when the bdev subsystem is initialized, each bdev module will have its module_init function called, where it should create its bdevs and register them using spdk_bdev_register().  Currently, all of the bdevs in SPDK use our configuration file library to read from a common conf file when determining which bdevs are created and what options to use (e.g. the malloc bdev uses the [Malloc] section of the configuration file).
>> 
>> When registering a bdev, you must provide another set of function pointers in fn_table which perform operations on the individual bdevs, like creating a new I/O channel and submitting I/O requests on a channel.
>> 
>> To hook up your bdev module in the NVMe over Fabrics target, you will also want to modify mk/spdk.modules.mk to add your new module to the BLOCKDEV_MODULES list.  This adds linker options to all of the applications in the SPDK tree that use bdev modules.
>> 
>> Please let us know if you have any further questions - the bdev module API is still somewhat in flux and not well documented.
>> 
>> Thanks,
>> -- Daniel
>> _______________________________________________
>> SPDK mailing list
>> SPDK(a)lists.01.org
>> https://lists.01.org/mailman/listinfo/spdk
> 
> _______________________________________________
> SPDK mailing list
> SPDK(a)lists.01.org
> https://lists.01.org/mailman/listinfo/spdk
> _______________________________________________
> SPDK mailing list
> SPDK(a)lists.01.org
> https://lists.01.org/mailman/listinfo/spdk


             reply	other threads:[~2016-10-21  6:09 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21  6:09 Kumaraparameshwaran Rathnavel [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-10-21  7:25 [SPDK] BDEV Registration Kumaraparameshwaran Rathnavel
2016-10-21  6:53 Kumaraparameshwaran Rathnavel
2016-10-21  6:41 Yang, Ziye
2016-10-21  6:36 Kumaraparameshwaran Rathnavel
2016-10-21  6:29 Yang, Ziye
2016-10-21  6:27 Kumaraparameshwaran Rathnavel
2016-10-21  6:13 Yang, Ziye
2016-10-21  5:31 Yang, Ziye
2016-10-21  4:09 Kumaraparameshwaran Rathnavel
2016-10-20 21:59 Daniel Verkamp
2016-10-20 20:11 Kumaraparameshwaran Rathnavel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1DB89603-65B0-4308-8B49-507CFC7A4451@cloudsimple.com \
    --to=spdk@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox