IB/iser: bound protection_sg size by data_sg size
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. Link: https://lore.kernel.org/r/1569359027-10987-1-git-send-email-maxg@mellanox.com Signed-off-by: Max Gurtovoy <maxg@mellanox.com> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
This commit is contained in:
parent
70bcc63f84
commit
7718cf03c3
|
@ -646,6 +646,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep,
|
||||||
if (ib_conn->pi_support) {
|
if (ib_conn->pi_support) {
|
||||||
u32 sig_caps = ib_dev->attrs.sig_prot_cap;
|
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_prot(shost, iser_dif_prot_caps(sig_caps));
|
||||||
scsi_host_set_guard(shost, SHOST_DIX_GUARD_IP |
|
scsi_host_set_guard(shost, SHOST_DIX_GUARD_IP |
|
||||||
SHOST_DIX_GUARD_CRC);
|
SHOST_DIX_GUARD_CRC);
|
||||||
|
|
Loading…
Reference in New Issue