scsi: SCSI device supports 256 LUNs at the maximum by default

Most SCSI hosts, Linux, Windows, VMware, supports 256 LUNs per
device now, and it is not easy to test even if any other non-free
OS or driver supports more than 256 LUNs.

Hence increase the macro constant SPDK_SCSI_DEV_MAX_LUN from 64 to
256. Then we do not need to expose it publicly now. So move it to
lib/scsi/scsi_internal.h.

Update the CHANGELOG together.

Signed-off-by: Shuhei Matsumoto <shuhei.matsumoto.xt@hitachi.com>
Change-Id: Iacde46c3854f326eebfb8befb47d41fce383b027
Reviewed-on: https://review.spdk.io/gerrit/c/spdk/spdk/+/9631
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: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Shuhei Matsumoto 2021-10-06 23:59:37 +09:00 committed by Tomasz Zawadzki
parent 4265fc50d9
commit 5e87727596
4 changed files with 11 additions and 2 deletions

View File

@ -86,6 +86,9 @@ Updated DPDK submodule to DPDK 21.08.
New functions, `spdk_scsi_dev_get_first_lun` and `spdk_scsi_dev_get_next_lun`
have been added to iterate LUNs of a SCSI device.
Each SCSI device supports 256 LUNs at the maximum now and the macro constant
`SPDK_SCSI_DEV_MAX_LUN` was removed.
### util
The `spdk_fd_group_add` API now takes a `name` parameter.

View File

@ -56,7 +56,6 @@ extern "C" {
#define TRACE_SCSI_TASK_START SPDK_TPOINT_ID(TRACE_GROUP_SCSI, 0x1)
#define SPDK_SCSI_MAX_DEVS 1024
#define SPDK_SCSI_DEV_MAX_LUN 64
#define SPDK_SCSI_DEV_MAX_PORTS 4
#define SPDK_SCSI_DEV_MAX_NAME 255

View File

@ -45,6 +45,8 @@
#include "spdk/log.h"
#define SPDK_SCSI_DEV_MAX_LUN 256
enum {
SPDK_SCSI_TASK_UNKNOWN = -1,
SPDK_SCSI_TASK_COMPLETE,

View File

@ -560,7 +560,10 @@ dev_add_lun_no_free_lun_id(void)
int rc;
int i;
struct spdk_scsi_dev dev = { .luns = TAILQ_HEAD_INITIALIZER(dev.luns), };
struct spdk_scsi_lun lun[SPDK_SCSI_DEV_MAX_LUN] = { 0 };
struct spdk_scsi_lun *lun;
lun = calloc(SPDK_SCSI_DEV_MAX_LUN, sizeof(*lun));
SPDK_CU_ASSERT_FATAL(lun != NULL);
for (i = 0; i < SPDK_SCSI_DEV_MAX_LUN; i++) {
lun[i].id = i;
@ -570,6 +573,8 @@ dev_add_lun_no_free_lun_id(void)
rc = spdk_scsi_dev_add_lun(&dev, "malloc0", -1, NULL, NULL);
CU_ASSERT_NOT_EQUAL(rc, 0);
free(lun);
}
static void