Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13383273ybl; Sun, 29 Dec 2019 10:33:55 -0800 (PST) X-Google-Smtp-Source: APXvYqyMAptz3X92joo3Yf3KiWoAw9CrbFtTKy53NwbPf7rlSpYuRItH+Qhp6k+2M50s3rykBVge X-Received: by 2002:a9d:2dca:: with SMTP id g68mr64379203otb.150.1577644435010; Sun, 29 Dec 2019 10:33:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577644435; cv=none; d=google.com; s=arc-20160816; b=n80ydfsyO0OzFXYjxIHedcAvbifggKT9adPtk1IQs0JzyNgE/z3o21RmW1D5rHSYd/ nvcs5UFASPFIKa/v2uzlWe+ZMPqfLWtxxIkMCPsMgm3n6tvtoKJyugZPuQlb+5MFk4sL wloRnap6+60zCe7cqg9CwZs0vdUGc1FMzJyCmnNgI6KojuO6eyAGWLZ/q3u4o17rOiCU grU3+Fru0RX3WEf3RMhkn2WYSDvIg4oXlIc/O+sA9M8lz4jZmn9vlP/88z9OAEX8FZxy kkV8zurnupoQPub18GEixRnzoTzH6tWIkBqFAL6WleEZVFPRoepuX/GG+fJzfibDzfg5 +5Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=riT42vlza6znktpNO1aWRqsuL4/c1a8knpmw2CFy7kA=; b=w2sz2IJGSiOc0/Wax+yPrH4VgBmo5LcA1A7yTuPTiyqAf/7cg6aEDbGRntJhmGKWbb FFlR2Ou3jYsovCneINNxnnOeu+UbU9maMjmXOkGu/3h4da406LdSweAbZMMUdDzFAjUO G8CtXc0L8IiKuMvKfQG0b7nUFHA/1tF915AFBjZOcnTTSVuYKf4EEnj0XwRcdm2jzOSQ g59Y8Rog/85pRQPG61OZIc0XdpwrnLzyZQ79KiXgkAA7qXPgQCoAQycMbADExTOx40OX zuTvBGXarxofRQiCwNrzYcS7mmBQRfyo0y7mstYWMQYs7kyVsC+KLVF7XQZNXkgTzgbw Ml9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q+gKvmdz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z10si22589601oto.36.2019.12.29.10.33.35; Sun, 29 Dec 2019 10:33:55 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Q+gKvmdz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727218AbfL2RWI (ORCPT + 99 others); Sun, 29 Dec 2019 12:22:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:38048 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727159AbfL2RWF (ORCPT ); Sun, 29 Dec 2019 12:22:05 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 48220222C2; Sun, 29 Dec 2019 17:22:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577640124; bh=oTX0xPOCnnbamz3I+m9s4b9mbLtvyeyF7BHS82zwt1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Q+gKvmdz3xt/cLsgicodhynudqR3mxelshoMw6GDtkEjIsXhlu2/VfLXqekCVsrv/ aN6sRqoSkUDdhMwpUPNF0gGMLxEmjxbOilJgFmqA6fFMLBrghLYYIzGUkZ1tOdnNnh XymnuES0v6CI4JcTRpYbM6NIDbiV8tHCVIhnakas= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Max Gurtovoy , Sagi Grimberg , Jason Gunthorpe , Sasha Levin Subject: [PATCH 4.14 028/161] IB/iser: bound protection_sg size by data_sg size Date: Sun, 29 Dec 2019 18:17:56 +0100 Message-Id: <20191229162406.955565288@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229162355.500086350@linuxfoundation.org> References: <20191229162355.500086350@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Max Gurtovoy [ 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 Reviewed-by: Sagi Grimberg Signed-off-by: Jason Gunthorpe Signed-off-by: Sasha Levin --- drivers/infiniband/ulp/iser/iscsi_iser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/ulp/iser/iscsi_iser.c b/drivers/infiniband/ulp/iser/iscsi_iser.c index 19624e023ebd..b5a789567b4e 100644 --- a/drivers/infiniband/ulp/iser/iscsi_iser.c +++ b/drivers/infiniband/ulp/iser/iscsi_iser.c @@ -648,6 +648,7 @@ iscsi_iser_session_create(struct iscsi_endpoint *ep, if (ib_conn->pi_support) { u32 sig_caps = ib_conn->device->ib_device->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); -- 2.20.1