From mboxrd@z Thu Jan 1 00:00:00 1970 Content-Type: multipart/mixed; boundary="===============2505808711339956655==" MIME-Version: 1.0 From: Kumaraparameshwaran Rathnavel Subject: Re: [SPDK] BDEV Registration Date: Fri, 21 Oct 2016 09:39:03 +0530 Message-ID: <3439EAD2-ACB6-431A-BB54-D3AAF171C3AF@cloudsimple.com> In-Reply-To: c22353ee-7e25-ff66-d9b9-085528f3aa84@intel.com List-ID: To: spdk@lists.01.org --===============2505808711339956655== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Thanks Daniel. When will the bdev subsystem get initialised? Which part of the code handle= s the bdev subsystem initialisation. Thanking You, Param > On 21-Oct-2016, at 3:29 AM, Daniel Verkamp w= rote: > = > 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 targe= t implementation using SPDK. I need to use the Virtual Subsystem. I see tha= t there is support for RAM disks and I am using it as reference to my Virtu= al implementation . >> = >> There is a function called SPDK_BDEV_MODULE_REGISTER in the file lib/bde= v/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 def= ined. 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 regi= ster 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 det= ermining which bdevs are created and what options to use (e.g. the malloc b= dev uses the [Malloc] section of the configuration file). > = > When registering a bdev, you must provide another set of function pointer= s in fn_table which perform operations on the individual bdevs, like creati= ng 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 als= o 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 S= PDK tree that use bdev modules. > = > Please let us know if you have any further questions - the bdev module AP= I 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 --===============2505808711339956655==--