diff options
author | Brian King <brking@linux.vnet.ibm.com> | 2008-07-23 14:35:48 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2008-07-25 01:44:45 -0400 |
commit | 39c1ffecc6aabcc8105602a95ce769f27bcf6048 (patch) | |
tree | 69850b0c50c8628db3276581575757c4854519c8 /drivers/scsi/ibmvscsi | |
parent | 7912a0ac5907df1f8b214b3ca15ccf96129daae0 (diff) |
ibmvfc: Add support for collaborative memory overcommit
Adds support to the ibmvfc driver for collaborative memory overcommit.
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Robert Jennings <rcj@linux.vnet.ibm.com>
Acked-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'drivers/scsi/ibmvscsi')
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvfc.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c index eb702b96d57c..c4a7c06793c5 100644 --- a/drivers/scsi/ibmvscsi/ibmvfc.c +++ b/drivers/scsi/ibmvscsi/ibmvfc.c | |||
@@ -3819,6 +3819,20 @@ static int ibmvfc_remove(struct vio_dev *vdev) | |||
3819 | return 0; | 3819 | return 0; |
3820 | } | 3820 | } |
3821 | 3821 | ||
3822 | /** | ||
3823 | * ibmvfc_get_desired_dma - Calculate DMA resources needed by the driver | ||
3824 | * @vdev: vio device struct | ||
3825 | * | ||
3826 | * Return value: | ||
3827 | * Number of bytes the driver will need to DMA map at the same time in | ||
3828 | * order to perform well. | ||
3829 | */ | ||
3830 | static unsigned long ibmvfc_get_desired_dma(struct vio_dev *vdev) | ||
3831 | { | ||
3832 | unsigned long pool_dma = max_requests * sizeof(union ibmvfc_iu); | ||
3833 | return pool_dma + ((512 * 1024) * driver_template.cmd_per_lun); | ||
3834 | } | ||
3835 | |||
3822 | static struct vio_device_id ibmvfc_device_table[] __devinitdata = { | 3836 | static struct vio_device_id ibmvfc_device_table[] __devinitdata = { |
3823 | {"fcp", "IBM,vfc-client"}, | 3837 | {"fcp", "IBM,vfc-client"}, |
3824 | { "", "" } | 3838 | { "", "" } |
@@ -3829,6 +3843,7 @@ static struct vio_driver ibmvfc_driver = { | |||
3829 | .id_table = ibmvfc_device_table, | 3843 | .id_table = ibmvfc_device_table, |
3830 | .probe = ibmvfc_probe, | 3844 | .probe = ibmvfc_probe, |
3831 | .remove = ibmvfc_remove, | 3845 | .remove = ibmvfc_remove, |
3846 | .get_desired_dma = ibmvfc_get_desired_dma, | ||
3832 | .driver = { | 3847 | .driver = { |
3833 | .name = IBMVFC_NAME, | 3848 | .name = IBMVFC_NAME, |
3834 | .owner = THIS_MODULE, | 3849 | .owner = THIS_MODULE, |