From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============4760810758830118710==" MIME-Version: 1.0 From: Kumaraparameshwaran Rathnavel Subject: Re: [SPDK] BDEV Registration Date: Fri, 21 Oct 2016 11:39:17 +0530 Message-ID: <1DB89603-65B0-4308-8B49-507CFC7A4451@cloudsimple.com> In-Reply-To: FA6C2217B01E9D48A581BB4866021014376507F7@shsmsx102.ccr.corp.intel.com List-ID: To: spdk@lists.01.org --===============4760810758830118710== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable 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 config= uration 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 l= ib/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(bde= v, spdk_bdev_initialize, spdk_bdev_finish, spdk_bdev_config_text)) > = > SPDK_SUBSYSTEM_REGISTER in bdev will be executed before main, and add th= e bdev subsystem. > = > It will finally call spdk_bdev_initialize -> spdk_bdev_module_initiali= ze -> call module_init. > Thanks. > = > Best Regards, > Ziye Yang > = > -----Original Message----- > From: SPDK [mailto:spdk-bounces(a)lists.01.org] On Behalf Of Kumaraparame= shwaran Rathnavel > Sent: Friday, October 21, 2016 12:09 PM > To: Storage Performance Development Kit > Subject: Re: [SPDK] BDEV Registration > = > Thanks Daniel. > = > When will the bdev subsystem get initialised? Which part of the code hand= les the bdev subsystem initialisation. > = > Thanking You, > Param >> On 21-Oct-2016, at 3:29 AM, Daniel Verkamp = 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 targ= et implementation using SPDK. I need to use the Virtual Subsystem. I see th= at there is support for RAM disks and I am using it as reference to my Virt= ual implementation . >>> = >>> There is a function called SPDK_BDEV_MODULE_REGISTER in the file lib/bd= ev/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 de= fined. This macro creates a constructor function that adds your bdev modul= e's function pointer table (defined using a spdk_bdev_module_if) to a globa= l list. >> = >> Later, when the bdev subsystem is initialized, each bdev module will hav= e its module_init function called, where it should create its bdevs and reg= ister 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 de= termining 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 pointe= rs in fn_table which perform operations on the individual bdevs, like creat= ing 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 al= so 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 A= PI 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 --===============4760810758830118710==--