diff mbox series

[3/4] IB/iser: enforce iser_max_sectors to be greater than 0

Message ID 20210111145754.56727-4-mgurtovoy@nvidia.com (mailing list archive)
State Accepted
Delegated to: Jason Gunthorpe
Headers show
Series IB/iser cleanups and fixes for 5.11 | expand

Commit Message

Max Gurtovoy Jan. 11, 2021, 2:57 p.m. UTC
A value of 0 will casue the driver to fail establishing a valid
connection to remote target.

The following can be seen in the log in this case:
"
iser: iser_connect: connecting to: 1.1.1.88:3260
iser: iser_cma_handler: address resolved (0): status 0 conn 00000000090aa4de id 00000000167d3b5a
iser: iser_cma_handler: route resolved  (2): status 0 conn 00000000090aa4de id 00000000167d3b5a
iser: iscsi_iser_ep_poll: iser conn 00000000090aa4de rc = 0
iser: iser_create_ib_conn_res: setting conn 00000000090aa4de cma_id 00000000167d3b5a qp 00000000efa80660 max_send_wr 4619
iser_cma_handler: established (9): status 0 conn 00000000090aa4de id 00000000167d3b5a
iser: iser_connected_handler: remote qpn:1c7 my qpn:1c6
iser: iser_connected_handler: conn 00000000090aa4de: negotiated remote invalidation
iser: iscsi_iser_ep_poll: iser conn 00000000090aa4de rc = 1
scsi host10: iSCSI Initiator over iSER
mlx5_core 0000:07:00.0: mlx5_cmd_check:769:(pid 616473): CREATE_MKEY(0x200) op_mod(0x0) failed, status bad parameter(0x3), syndrome (0x3bf6f)
iser: iser_create_fastreg_desc: Failed to allocate ib_fast_reg_mr err=-22
iser: iser_alloc_rx_descriptors: failed allocating rx descriptors / data buffers
iser: iscsi_iser_ep_disconnect: ep 00000000d2040785 iser conn 00000000090aa4de
iser: iser_conn_terminate: iser_conn 00000000090aa4de state 3
iser: iser_free_ib_conn_res: freeing conn 00000000090aa4de cma_id 00000000167d3b5a qp 00000000efa80660
iser: iser_device_try_release: device 00000000dc871b1b refcount 0
"

Reviewed-by: Israel Rukshin <israelr@nvidia.com>
Signed-off-by: Max Gurtovoy <mgurtovoy@nvidia.com>
---
 drivers/infiniband/ulp/iser/iscsi_iser.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

Comments

Sagi Grimberg Jan. 14, 2021, 12:02 a.m. UTC | #1
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
diff mbox series

Patch

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 906f52873d63..fcfdeb5dea42 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -100,8 +100,9 @@  module_param_cb(max_lun, &iscsi_iser_size_ops, &iscsi_max_lun, S_IRUGO);
 MODULE_PARM_DESC(max_lun, "Max LUNs to allow per session, should > 0 (default:512)");
 
 unsigned int iser_max_sectors = ISER_DEF_MAX_SECTORS;
-module_param_named(max_sectors, iser_max_sectors, uint, S_IRUGO | S_IWUSR);
-MODULE_PARM_DESC(max_sectors, "Max number of sectors in a single scsi command (default:1024");
+module_param_cb(max_sectors, &iscsi_iser_size_ops, &iser_max_sectors,
+		S_IRUGO | S_IWUSR);
+MODULE_PARM_DESC(max_sectors, "Max number of sectors in a single scsi command, should > 0 (default:1024)");
 
 bool iser_always_reg = true;
 module_param_named(always_register, iser_always_reg, bool, S_IRUGO);