| 1521bf3b | 17-Jul-2024 |
Shuhei Matsumoto <smatsumoto@nvidia.com> |
bdev/null: Make DIF PI format configurable at bdev creation
Make bdev's PI format configurable via the bdev_null_create RPC. Add the same check as the NVMe specification, for example, metadata size
bdev/null: Make DIF PI format configurable at bdev creation
Make bdev's PI format configurable via the bdev_null_create RPC. Add the same check as the NVMe specification, for example, metadata size should not be less than 16 bytes if format is 16/32b Guard PI.
Additionally, add dif_pi_format into write_json_config().
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Change-Id: I64a53fd3d6dae4c85865c5174d86a55854d74d87 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24110 Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com>
show more ...
|
| d2407f06 | 17-Jul-2024 |
Shuhei Matsumoto <smatsumoto@nvidia.com> |
bdev/null: Delegate or remove DIF config check of bdev_null_create RPC
NULL bdev module supports only interleaved metadata. opts->block_size is data block size. Hence, comparing opts->block_size and
bdev/null: Delegate or remove DIF config check of bdev_null_create RPC
NULL bdev module supports only interleaved metadata. opts->block_size is data block size. Hence, comparing opts->block_size and opts->md_size was a long check. Remove it.
Checking if opts->num_blocks is non-zero was duplicated.
As same as malloc bdev, we can move opts->physical_block_size check to bdev_null_create().
We can delegate DIF type check to spdk_dif_ctx_init().
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Change-Id: Ia2030d509db55f155121175694d5e82d45c49671 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24208 Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Jim Harris <jim.harris@samsung.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Community-CI: Mellanox Build Bot
show more ...
|
| 36943038 | 17-Jul-2024 |
Shuhei Matsumoto <smatsumoto@nvidia.com> |
bdev/null: bdev_null_create RPC uses bdev_null_opts directly
The bdev_null_create RPC set rpc_construct_null structure and copied it to null_bdev_opts structure. However, this was not efficient or c
bdev/null: bdev_null_create RPC uses bdev_null_opts directly
The bdev_null_create RPC set rpc_construct_null structure and copied it to null_bdev_opts structure. However, this was not efficient or clean.
The difference of rpc_construct_null structure and null_bdev_opts structure were: 1. null_bdev_opts::block_size was block size, rpc_construct_null::block_size was data block size 2. null_bdev_opts::uuid was pointer, rpc_construct_null::uuid was instance
For #1, as we do for malloc bdev, we can use null_bdev_opts::block_size as data block size. If null_bdev_opts::block_size is data block size, we do not have to compare opts::block_size and opts::md_size.
For #2, as we do for malloc bdev, null_bdev_opts::uuid can be instance and we can copy null_bdev_opts::uuid to spdk_bdev::uuid.
Additionally, spdk_null_bdev_opts is not a public data structure. Hence, it should not have "spdk_" prefix.
Signed-off-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Change-Id: If53702071cf02fe23d03f464a63c2495c70e1f12 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/24109 Reviewed-by: Jim Harris <jim.harris@samsung.com> Reviewed-by: Aleksey Marchuk <alexeymar@nvidia.com> Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Community-CI: Mellanox Build Bot
show more ...
|
| a7d174e2 | 27-Feb-2022 |
Kefu Chai <tchaikov@gmail.com> |
bdev/null: call spdk_bdev_module_fini_done() even if not registered
in bdev subsystem, if any of the bdev module fails to initialize in bdev_modules_init(), this function just stops immediately. in
bdev/null: call spdk_bdev_module_fini_done() even if not registered
in bdev subsystem, if any of the bdev module fails to initialize in bdev_modules_init(), this function just stops immediately. in general, the non-zero rc is returned to the callback func passed to spdk_subsystem_init(). if spdk app is used for building the spdk application, it's very likely that app_start_rpc() is used as this very callback func. in this case, app_start_rpc() would just pass the `rc` to spdk_app_stop() which tears down all subsystems one after another.
bdev tears itself down by calling all its modules' module_fini(), including those whose .module_init never gets called. the problem is, if a bdev module marks its `.async_fini` true, and it calls spdk_bdev_module_fini_done() only if spdk_io_device_unregister(), then a bdev module which fails to initialize would leave us an spdk application hanging in the air.
a typical logging message sequence looks like:
[2022-02-27 20:47:13.766578] bdev.c:1438:spdk_bdev_initialize: *ERROR*: bdev modules init failed [2022-02-27 20:47:13.766622] subsystem.c: 169:spdk_subsystem_init_next: *ERROR*: Init subsystem bdev failed [2022-02-27 20:47:13.766638] app.c: 691:spdk_app_stop: *WARNING*: spdk_app_stop'd on non-zero [2022-02-27 20:47:13.766658] thread.c:2050:spdk_io_device_unregister: *ERROR*: io_device 0x10d3c30 not found
this is exactly the case we could run into if a bdev module fails to initialize and bdev_null is unable to call spdk_bdev_module_fini_done() when being teared down, because spdk_io_device_unregister() just refuses to call the callback if the I/O device is never registered.
since `g_null_read_buf` is set in bdev_null_initialize(), in this change, this pointer is checked for zero before calling spdk_io_device_unregister(), if it is NULL, spdk_bdev_module_fini_done() is called directly instead of calling spdk_io_device_unregister(). this helps to address the hanging issue.
Signed-off-by: Kefu Chai <tchaikov@gmail.com> Change-Id: I3a41fcd2f1c986e416dacecd5ca352dfd1e379b7 Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/11750 Community-CI: Broadcom CI <spdk-ci.pdl@broadcom.com> Community-CI: Mellanox Build Bot Tested-by: SPDK CI Jenkins <sys_sgci@intel.com> Reviewed-by: Shuhei Matsumoto <smatsumoto@nvidia.com> Reviewed-by: Ben Walker <benjamin.walker@intel.com>
show more ...
|