linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: target: cxgbit: increase max DataSegmentLength
@ 2021-10-13 14:24 Varun Prakash
  2021-10-17  2:44 ` Martin K. Petersen
  2021-10-21  3:42 ` Martin K. Petersen
  0 siblings, 2 replies; 3+ messages in thread
From: Varun Prakash @ 2021-10-13 14:24 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, target-devel, varun

Current value of max DataSegmentLength is 8K, T5/T6 adapters supports
max DataSegmentLength upto 16K, so increase max DataSegmentLength.

Signed-off-by: Varun Prakash <varun@chelsio.com>
---
 drivers/target/iscsi/cxgbit/cxgbit_main.c | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/drivers/target/iscsi/cxgbit/cxgbit_main.c b/drivers/target/iscsi/cxgbit/cxgbit_main.c
index bd37f2a..c6678dc 100644
--- a/drivers/target/iscsi/cxgbit/cxgbit_main.c
+++ b/drivers/target/iscsi/cxgbit/cxgbit_main.c
@@ -33,11 +33,18 @@ static void cxgbit_set_mdsl(struct cxgbit_device *cdev)
 	struct cxgb4_lld_info *lldi = &cdev->lldi;
 	u32 mdsl;
 
-#define ULP2_MAX_PKT_LEN 16224
-#define ISCSI_PDU_NONPAYLOAD_LEN 312
-	mdsl = min_t(u32, lldi->iscsi_iolen - ISCSI_PDU_NONPAYLOAD_LEN,
-		     ULP2_MAX_PKT_LEN - ISCSI_PDU_NONPAYLOAD_LEN);
-	mdsl = min_t(u32, mdsl, 8192);
+#define CXGBIT_T5_MAX_PDU_LEN 16224
+#define CXGBIT_PDU_NONPAYLOAD_LEN 312 /* 48(BHS) + 256(AHS) + 8(Digest) */
+	if (is_t5(lldi->adapter_type)) {
+		mdsl = min_t(u32, lldi->iscsi_iolen - CXGBIT_PDU_NONPAYLOAD_LEN,
+			     CXGBIT_T5_MAX_PDU_LEN - CXGBIT_PDU_NONPAYLOAD_LEN);
+	} else {
+		mdsl = lldi->iscsi_iolen - CXGBIT_PDU_NONPAYLOAD_LEN;
+		mdsl = min(mdsl, 16384U);
+	}
+
+	mdsl = round_down(mdsl, 4);
+	mdsl = min_t(u32, mdsl, 4 * PAGE_SIZE);
 	mdsl = min_t(u32, mdsl, (MAX_SKB_FRAGS - 1) * PAGE_SIZE);
 
 	cdev->mdsl = mdsl;
-- 
2.0.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: target: cxgbit: increase max DataSegmentLength
  2021-10-13 14:24 [PATCH] scsi: target: cxgbit: increase max DataSegmentLength Varun Prakash
@ 2021-10-17  2:44 ` Martin K. Petersen
  2021-10-21  3:42 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-10-17  2:44 UTC (permalink / raw)
  To: Varun Prakash; +Cc: martin.petersen, linux-scsi, target-devel


Varun,

> Current value of max DataSegmentLength is 8K, T5/T6 adapters supports
> max DataSegmentLength upto 16K, so increase max DataSegmentLength.

Applied to 5.16/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] scsi: target: cxgbit: increase max DataSegmentLength
  2021-10-13 14:24 [PATCH] scsi: target: cxgbit: increase max DataSegmentLength Varun Prakash
  2021-10-17  2:44 ` Martin K. Petersen
@ 2021-10-21  3:42 ` Martin K. Petersen
  1 sibling, 0 replies; 3+ messages in thread
From: Martin K. Petersen @ 2021-10-21  3:42 UTC (permalink / raw)
  To: Varun Prakash; +Cc: Martin K . Petersen, target-devel, linux-scsi

On Wed, 13 Oct 2021 19:54:47 +0530, Varun Prakash wrote:

> Current value of max DataSegmentLength is 8K, T5/T6 adapters supports
> max DataSegmentLength upto 16K, so increase max DataSegmentLength.
> 
> 

Applied to 5.16/scsi-queue, thanks!

[1/1] scsi: target: cxgbit: increase max DataSegmentLength
      https://git.kernel.org/mkp/scsi/c/7f96c7a67e40

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-21  3:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-13 14:24 [PATCH] scsi: target: cxgbit: increase max DataSegmentLength Varun Prakash
2021-10-17  2:44 ` Martin K. Petersen
2021-10-21  3:42 ` Martin K. Petersen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).