OSDN Git Service

IB/iser: bound protection_sg size by data_sg size
authorMax Gurtovoy <maxg@mellanox.com>
Tue, 24 Sep 2019 21:03:47 +0000 (00:03 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 4 Jan 2020 12:34:05 +0000 (13:34 +0100)
commitc3bb807dfc80f1ef55543d5aecad0a4eaf335c89
tree5e8781cdb55f51438dc641bc508063cc950ab3b3
parentca4fb6974bb645ebf3352f5bba7699db4b44b75f
IB/iser: bound protection_sg size by data_sg size

[ Upstream commit 7718cf03c3ce4b6ebd90107643ccd01c952a1fce ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/infiniband/ulp/iser/iscsi_iser.c