From 45ce713ad3f7d78c997eb15eb205a78c38544435 Mon Sep 17 00:00:00 2001 From: Zhiqi Tao Date: Thu, 2 Dec 2010 13:50:28 +0800 Subject: [PATCH] b=23193 Land ISER performance patch for Sundance The purpose of this patch is to make ISER support 1MB RDMAs instead of splitting 2 512K RDMAs and increase the maximum number of ISCSI commands. i=alexg --- .../lustre_iser_max_sectors_tuning_lustre2.0.patch | 78 ++++++++++++++++++++++ lustre/kernel_patches/series/2.6-rhel5.series | 1 + 2 files changed, 79 insertions(+) create mode 100644 lustre/kernel_patches/patches/lustre_iser_max_sectors_tuning_lustre2.0.patch diff --git a/lustre/kernel_patches/patches/lustre_iser_max_sectors_tuning_lustre2.0.patch b/lustre/kernel_patches/patches/lustre_iser_max_sectors_tuning_lustre2.0.patch new file mode 100644 index 0000000..9f3c500 --- /dev/null +++ b/lustre/kernel_patches/patches/lustre_iser_max_sectors_tuning_lustre2.0.patch @@ -0,0 +1,78 @@ +diff -Naur base.linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iscsi_iser.c linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iscsi_iser.c +--- base.linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iscsi_iser.c 2010-09-09 16:57:15.000000000 -0400 ++++ linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iscsi_iser.c 2010-09-09 17:02:17.000000000 -0400 +@@ -586,18 +586,25 @@ + iser_conn_terminate(ib_conn); + } + ++static int iscsi_iser_slave_configure(struct scsi_device *sdev) ++{ ++ blk_queue_dma_alignment(sdev->request_queue, 0); ++ return 0; ++} ++ + static struct scsi_host_template iscsi_iser_sht = { + .module = THIS_MODULE, + .name = "iSCSI Initiator over iSER, v." DRV_VER, + .queuecommand = iscsi2_queuecommand, + .change_queue_depth = iscsi2_change_queue_depth, + .sg_tablesize = ISCSI_ISER_SG_TABLESIZE, +- .max_sectors = 1024, ++ .max_sectors = 0xffff, + .cmd_per_lun = ISER_DEF_CMD_PER_LUN, + .eh_abort_handler = iscsi2_eh_abort, + .eh_device_reset_handler= iscsi2_eh_device_reset, + .eh_host_reset_handler= iscsi2_eh_target_reset, + .use_clustering = DISABLE_CLUSTERING, ++ .slave_configure = iscsi_iser_slave_configure, + .proc_name = "iscsi_iser", + .this_id = -1, + }; +diff -Naur base.linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iscsi_iser.h linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iscsi_iser.h +--- base.linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iscsi_iser.h 2010-09-09 16:57:15.000000000 -0400 ++++ linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iscsi_iser.h 2010-09-09 17:03:17.000000000 -0400 +@@ -92,7 +92,8 @@ + #define MASK_4K (~(SIZE_4K-1)) + + /* support upto 512KB in one RDMA */ +-#define ISCSI_ISER_SG_TABLESIZE (0x80000 >> SHIFT_4K) ++/* FMR space for 1 MB of 4k-page transfers, plus 1 if not page aligned */ ++#define ISCSI_ISER_SG_TABLESIZE (((1<<20) >> SHIFT_4K) + 1) + #define ISER_DEF_CMD_PER_LUN 128 + + /* QP settings */ +diff -Naur base.linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iser_verbs.c linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iser_verbs.c +--- base.linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iser_verbs.c 2010-09-09 16:57:15.000000000 -0400 ++++ linux-2.6.18.x86_64/drivers/infiniband/ulp/iser/iser_verbs.c 2010-09-09 17:04:44.000000000 -0400 +@@ -137,7 +137,7 @@ + device = ib_conn->device; + + ib_conn->page_vec = kmalloc(sizeof(struct iser_page_vec) + +- (sizeof(u64) * (ISCSI_ISER_SG_TABLESIZE +1)), ++ sizeof(u64) * ISCSI_ISER_SG_TABLESIZE, + GFP_KERNEL); + if (!ib_conn->page_vec) { + ret = -ENOMEM; +@@ -146,9 +146,7 @@ + ib_conn->page_vec->pages = (u64 *) (ib_conn->page_vec + 1); + + params.page_shift = SHIFT_4K; +- /* when the first/last SG element are not start/end * +- * page aligned, the map whould be of N+1 pages */ +- params.max_pages_per_fmr = ISCSI_ISER_SG_TABLESIZE + 1; ++ params.max_pages_per_fmr = ISCSI_ISER_SG_TABLESIZE; + /* make the pool size twice the max number of SCSI commands * + * the ML is expected to queue, watermark for unmap at 50% */ + params.pool_size = ISCSI_DEF_XMIT_CMDS_MAX * 2; +diff -Naur base.linux-2.6.18.x86_64/include/scsi/libiscsi2.h linux-2.6.18.x86_64/include/scsi/libiscsi2.h +--- base.linux-2.6.18.x86_64/include/scsi/libiscsi2.h 2010-09-09 16:57:35.000000000 -0400 ++++ linux-2.6.18.x86_64/include/scsi/libiscsi2.h 2010-09-09 17:05:34.000000000 -0400 +@@ -43,7 +43,7 @@ + struct iscsi_nopin; + struct device; + +-#define ISCSI_DEF_XMIT_CMDS_MAX 128 /* must be power of 2 */ ++#define ISCSI_DEF_XMIT_CMDS_MAX 256 /* must be power of 2 */ + #define ISCSI_MGMT_CMDS_MAX 15 + + #define ISCSI_DEF_CMD_PER_LUN 32 diff --git a/lustre/kernel_patches/series/2.6-rhel5.series b/lustre/kernel_patches/series/2.6-rhel5.series index 240695b..db50c09 100644 --- a/lustre/kernel_patches/series/2.6-rhel5.series +++ b/lustre/kernel_patches/series/2.6-rhel5.series @@ -28,3 +28,4 @@ jbd2-commit-timer-no-jiffies-rounding.diff md-avoid-bug_on-when-bmc-overflow.patch export-symbols-for-dmu.patch jbd2_stats_proc_init-wrong-place.patch +lustre_iser_max_sectors_tuning_lustre2.0.patch -- 1.8.3.1