numam-spdk/examples/nvme
Swapnil Ingle 6cebe9d06b nvmf: Support physical block size if exposed by bdev
(Note: this patch was previously applied as b32cfc46 and then reverted
as 63642bef.)

Today the in-guest nvme device shows physical_block_size=512 even though
the backend iSCSI bdev supports physical_block_size=4K

iSCSI targets exposes physical block size using
logical_block_per_physical_block_exponent in READ_CAPACITY_16

NPWG is one of the way to let Linux nvme driver set
physical_block_size of the nvme block device.

This patch adds spdk_bdev.phys_blocklen which is updated if the iSCSI
backend exposes physical_block_size.
Later phys_blocklen is used in nvmf to set NPWG and NAWUPF to report
back during NS identity.
Linux driver uses min(nawupf, npwg) to set physical_block_size.

Similarly in scsi_bdev fill lbppbe in READ_CAP16 response
based on spdk_bdev.phys_blocklen.

Fixes #1884

Signed-off-by: Swapnil Ingle <swapnil.ingle@nutanix.com>
Change-Id: I0b6c81f1937e346d448f49c927eda8c79d2d75c0
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/7739
Community-CI: Broadcom CI
Community-CI: Mellanox Build Bot
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Aleksey Marchuk <alexeymar@mellanox.com>
Reviewed-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
2021-05-06 07:14:40 +00:00
..
abort example/abort: Fix missing optarg. 2021-03-31 08:49:37 +00:00
arbitration examples: use "main" instead of "master" 2020-12-03 09:41:07 +00:00
cmb_copy nvme/cmb_copy: disable submission queue in CMB 2020-04-22 09:18:22 +00:00
fio_plugin nvme/fio_plugin: fix zone_append option with multiple files per thread 2021-04-26 16:16:42 +00:00
hello_world examples/nvme/hello_world: call exit() on read error 2020-10-23 13:47:09 +00:00
hotplug build: fix duplicate spdk.common.mk includes 2019-05-22 14:51:01 +00:00
identify nvmf: Support physical block size if exposed by bdev 2021-05-06 07:14:40 +00:00
nvme_manage examples: Use PRId64 for portability 2020-11-20 11:01:11 +00:00
perf sock: Add new params to configure zcopy for server, client sockets 2021-04-27 08:13:32 +00:00
pmr_persistence examples/pmr_persistence: Add PMR example application 2021-04-22 20:10:21 +00:00
reconnect NVMe/vfio-user: add initial version vfio-user transport to NVMe driver 2021-01-21 05:00:18 +00:00
Makefile examples/pmr_persistence: Add PMR example application 2021-04-22 20:10:21 +00:00