Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

scsi: target: cxgbit: Increase max DataSegmentLength

Current value of max DataSegmentLength is 8K. T5/T6 adapters support
DataSegmentLength upto 16K. Increase max DataSegmentLength.

Link: https://lore.kernel.org/r/1634135087-4996-1-git-send-email-varun@chelsio.com
Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Varun Prakash and committed by
Martin K. Petersen
7f96c7a6 f347c268

+12 -5
+12 -5
drivers/target/iscsi/cxgbit/cxgbit_main.c
··· 33 33 struct cxgb4_lld_info *lldi = &cdev->lldi; 34 34 u32 mdsl; 35 35 36 - #define ULP2_MAX_PKT_LEN 16224 37 - #define ISCSI_PDU_NONPAYLOAD_LEN 312 38 - mdsl = min_t(u32, lldi->iscsi_iolen - ISCSI_PDU_NONPAYLOAD_LEN, 39 - ULP2_MAX_PKT_LEN - ISCSI_PDU_NONPAYLOAD_LEN); 40 - mdsl = min_t(u32, mdsl, 8192); 36 + #define CXGBIT_T5_MAX_PDU_LEN 16224 37 + #define CXGBIT_PDU_NONPAYLOAD_LEN 312 /* 48(BHS) + 256(AHS) + 8(Digest) */ 38 + if (is_t5(lldi->adapter_type)) { 39 + mdsl = min_t(u32, lldi->iscsi_iolen - CXGBIT_PDU_NONPAYLOAD_LEN, 40 + CXGBIT_T5_MAX_PDU_LEN - CXGBIT_PDU_NONPAYLOAD_LEN); 41 + } else { 42 + mdsl = lldi->iscsi_iolen - CXGBIT_PDU_NONPAYLOAD_LEN; 43 + mdsl = min(mdsl, 16384U); 44 + } 45 + 46 + mdsl = round_down(mdsl, 4); 47 + mdsl = min_t(u32, mdsl, 4 * PAGE_SIZE); 41 48 mdsl = min_t(u32, mdsl, (MAX_SKB_FRAGS - 1) * PAGE_SIZE); 42 49 43 50 cdev->mdsl = mdsl;