diff mbox series

[1/1] IB/iser: bound protection_sg size by data_sg size

Message ID 1569359027-10987-1-git-send-email-maxg@mellanox.com (mailing list archive)
State Mainlined
Commit 7718cf03c3ce4b6ebd90107643ccd01c952a1fce
Delegated to: Jason Gunthorpe
Headers show
Series [1/1] IB/iser: bound protection_sg size by data_sg size | expand

Commit Message

Max Gurtovoy Sept. 24, 2019, 9:03 p.m. UTC
In case we don't set the sg_prot_tablesize, the scsi layer assign the
default size (65535 entries). We should limit this size since we should
take into consideration the underlaying device capability. This cap is
considered when calculating the sg_tablesize. Otherwise, for example,
we can get that /sys/block/sdb/queue/max_segments is 128 and
/sys/block/sdb/queue/max_integrity_segments is 65535.

Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
---
 drivers/infiniband/ulp/iser/iscsi_iser.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Sagi Grimberg Sept. 25, 2019, 8:52 p.m. UTC | #1
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Jason Gunthorpe Oct. 1, 2019, 2:29 p.m. UTC | #2
On Wed, Sep 25, 2019 at 12:03:47AM +0300, Max Gurtovoy wrote:
> In case we don't set the sg_prot_tablesize, the scsi layer assign the
> default size (65535 entries). We should limit this size since we should
> take into consideration the underlaying device capability. This cap is
> considered when calculating the sg_tablesize. Otherwise, for example,
> we can get that /sys/block/sdb/queue/max_segments is 128 and
> /sys/block/sdb/queue/max_integrity_segments is 65535.
> 
> Signed-off-by: Max Gurtovoy <maxg@mellanox.com>
> Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
> ---
>  drivers/infiniband/ulp/iser/iscsi_iser.c | 1 +
>  1 file changed, 1 insertion(+)

Applied to for-next, thanks

Jason
diff mbox series

Patch

diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c
index 5036155..55f45ed 100644
--- a/drivers/infiniband/ulp/iser/iscsi_iser.c
+++ b/drivers/infiniband/ulp/iser/iscsi_iser.c
@@ -646,6 +646,7 @@  static void iscsi_iser_cleanup_task(struct iscsi_task *task)
 		if (ib_conn->pi_support) {
 			u32 sig_caps = ib_dev->attrs.sig_prot_cap;
 
+			shost->sg_prot_tablesize = shost->sg_tablesize;
 			scsi_host_set_prot(shost, iser_dif_prot_caps(sig_caps));
 			scsi_host_set_guard(shost, SHOST_DIX_GUARD_IP |
 						   SHOST_DIX_GUARD_CRC);