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>

authored by

Brian King and committed by
Benjamin Herrenschmidt
39c1ffec 7912a0ac

+15
+15
drivers/scsi/ibmvscsi/ibmvfc.c
··· 3819 return 0; 3820 } 3821 3822 static struct vio_device_id ibmvfc_device_table[] __devinitdata = { 3823 {"fcp", "IBM,vfc-client"}, 3824 { "", "" } ··· 3843 .id_table = ibmvfc_device_table, 3844 .probe = ibmvfc_probe, 3845 .remove = ibmvfc_remove, 3846 .driver = { 3847 .name = IBMVFC_NAME, 3848 .owner = THIS_MODULE,
··· 3819 return 0; 3820 } 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 + 3836 static struct vio_device_id ibmvfc_device_table[] __devinitdata = { 3837 {"fcp", "IBM,vfc-client"}, 3838 { "", "" } ··· 3829 .id_table = ibmvfc_device_table, 3830 .probe = ibmvfc_probe, 3831 .remove = ibmvfc_remove, 3832 + .get_desired_dma = ibmvfc_get_desired_dma, 3833 .driver = { 3834 .name = IBMVFC_NAME, 3835 .owner = THIS_MODULE,