summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2008-07-24 04:35:48 +1000
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-25 15:44:45 +1000
commit39c1ffecc6aabcc8105602a95ce769f27bcf6048 (patch)
tree69850b0c50c8628db3276581575757c4854519c8
parent7912a0ac5907df1f8b214b3ca15ccf96129daae0 (diff)
downloadlinux-39c1ffecc6aabcc8105602a95ce769f27bcf6048.tar.gz
linux-39c1ffecc6aabcc8105602a95ce769f27bcf6048.tar.bz2
linux-39c1ffecc6aabcc8105602a95ce769f27bcf6048.zip
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>
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c15
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)
return 0;
}
+/**
+ * ibmvfc_get_desired_dma - Calculate DMA resources needed by the driver
+ * @vdev: vio device struct
+ *
+ * Return value:
+ * Number of bytes the driver will need to DMA map at the same time in
+ * order to perform well.
+ */
+static unsigned long ibmvfc_get_desired_dma(struct vio_dev *vdev)
+{
+ unsigned long pool_dma = max_requests * sizeof(union ibmvfc_iu);
+ return pool_dma + ((512 * 1024) * driver_template.cmd_per_lun);
+}
+
static struct vio_device_id ibmvfc_device_table[] __devinitdata = {
{"fcp", "IBM,vfc-client"},
{ "", "" }
@@ -3829,6 +3843,7 @@ static struct vio_driver ibmvfc_driver = {
.id_table = ibmvfc_device_table,
.probe = ibmvfc_probe,
.remove = ibmvfc_remove,
+ .get_desired_dma = ibmvfc_get_desired_dma,
.driver = {
.name = IBMVFC_NAME,
.owner = THIS_MODULE,