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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma

Pull rdma fix from Doug Ledford:
"Fix for max sector calculation in iSER"

* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma:
IB/iser: Fix max_sectors calculation

+10 -4
+10 -4
drivers/infiniband/ulp/iser/iscsi_iser.c
··· 612 612 struct Scsi_Host *shost; 613 613 struct iser_conn *iser_conn = NULL; 614 614 struct ib_conn *ib_conn; 615 + u32 max_fr_sectors; 615 616 u16 max_cmds; 616 617 617 618 shost = iscsi_host_alloc(&iscsi_iser_sht, 0, 0); ··· 633 632 iser_conn = ep->dd_data; 634 633 max_cmds = iser_conn->max_cmds; 635 634 shost->sg_tablesize = iser_conn->scsi_sg_tablesize; 636 - shost->max_sectors = iser_conn->scsi_max_sectors; 637 635 638 636 mutex_lock(&iser_conn->state_mutex); 639 637 if (iser_conn->state != ISER_CONN_UP) { ··· 657 657 */ 658 658 shost->sg_tablesize = min_t(unsigned short, shost->sg_tablesize, 659 659 ib_conn->device->ib_device->attrs.max_fast_reg_page_list_len); 660 - shost->max_sectors = min_t(unsigned int, 661 - 1024, (shost->sg_tablesize * PAGE_SIZE) >> 9); 662 660 663 661 if (iscsi_host_add(shost, 664 662 ib_conn->device->ib_device->dma_device)) { ··· 669 671 if (iscsi_host_add(shost, NULL)) 670 672 goto free_host; 671 673 } 674 + 675 + /* 676 + * FRs or FMRs can only map up to a (device) page per entry, but if the 677 + * first entry is misaligned we'll end up using using two entries 678 + * (head and tail) for a single page worth data, so we have to drop 679 + * one segment from the calculation. 680 + */ 681 + max_fr_sectors = ((shost->sg_tablesize - 1) * PAGE_SIZE) >> 9; 682 + shost->max_sectors = min(iser_max_sectors, max_fr_sectors); 672 683 673 684 if (cmds_max > max_cmds) { 674 685 iser_info("cmds_max changed from %u to %u\n", ··· 996 989 .queuecommand = iscsi_queuecommand, 997 990 .change_queue_depth = scsi_change_queue_depth, 998 991 .sg_tablesize = ISCSI_ISER_DEF_SG_TABLESIZE, 999 - .max_sectors = ISER_DEF_MAX_SECTORS, 1000 992 .cmd_per_lun = ISER_DEF_CMD_PER_LUN, 1001 993 .eh_abort_handler = iscsi_eh_abort, 1002 994 .eh_device_reset_handler= iscsi_eh_device_reset,