aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp
diff options
context:
space:
mode:
authorDave Airlie <airlied@starflyer.(none)>2006-01-03 02:18:01 -0500
committerDave Airlie <airlied@linux.ie>2006-01-03 02:18:01 -0500
commit97f2aab6698f3ab2552c41c1024a65ffd0763a6d (patch)
treebb6e3b2949459f54f884c710fc74d40eef00d834 /drivers/infiniband/ulp/srp
parentd985c1088146607532093d9eaaaf99758f6a4d21 (diff)
parent88026842b0a760145aa71d69e74fbc9ec118ca44 (diff)
drm: merge in Linus mainline
Diffstat (limited to 'drivers/infiniband/ulp/srp')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c17
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h1
2 files changed, 12 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 321a3a10e69b..ee9fe226ae99 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -802,13 +802,21 @@ static int srp_post_recv(struct srp_target_port *target)
802 802
803/* 803/*
804 * Must be called with target->scsi_host->host_lock held to protect 804 * Must be called with target->scsi_host->host_lock held to protect
805 * req_lim and tx_head. 805 * req_lim and tx_head. Lock cannot be dropped between call here and
806 * call to __srp_post_send().
806 */ 807 */
807static struct srp_iu *__srp_get_tx_iu(struct srp_target_port *target) 808static struct srp_iu *__srp_get_tx_iu(struct srp_target_port *target)
808{ 809{
809 if (target->tx_head - target->tx_tail >= SRP_SQ_SIZE) 810 if (target->tx_head - target->tx_tail >= SRP_SQ_SIZE)
810 return NULL; 811 return NULL;
811 812
813 if (unlikely(target->req_lim < 1)) {
814 if (printk_ratelimit())
815 printk(KERN_DEBUG PFX "Target has req_lim %d\n",
816 target->req_lim);
817 return NULL;
818 }
819
812 return target->tx_ring[target->tx_head & SRP_SQ_SIZE]; 820 return target->tx_ring[target->tx_head & SRP_SQ_SIZE];
813} 821}
814 822
@@ -823,11 +831,6 @@ static int __srp_post_send(struct srp_target_port *target,
823 struct ib_send_wr wr, *bad_wr; 831 struct ib_send_wr wr, *bad_wr;
824 int ret = 0; 832 int ret = 0;
825 833
826 if (target->req_lim < 1) {
827 printk(KERN_ERR PFX "Target has req_lim %d\n", target->req_lim);
828 return -EAGAIN;
829 }
830
831 list.addr = iu->dma; 834 list.addr = iu->dma;
832 list.length = len; 835 list.length = len;
833 list.lkey = target->srp_host->mr->lkey; 836 list.lkey = target->srp_host->mr->lkey;
@@ -1417,6 +1420,8 @@ static ssize_t srp_create_target(struct class_device *class_dev,
1417 if (!target_host) 1420 if (!target_host)
1418 return -ENOMEM; 1421 return -ENOMEM;
1419 1422
1423 target_host->max_lun = SRP_MAX_LUN;
1424
1420 target = host_to_target(target_host); 1425 target = host_to_target(target_host);
1421 memset(target, 0, sizeof *target); 1426 memset(target, 0, sizeof *target);
1422 1427
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index 4fec28a71367..b564f18caf78 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -54,6 +54,7 @@ enum {
54 SRP_PORT_REDIRECT = 1, 54 SRP_PORT_REDIRECT = 1,
55 SRP_DLID_REDIRECT = 2, 55 SRP_DLID_REDIRECT = 2,
56 56
57 SRP_MAX_LUN = 512,
57 SRP_MAX_IU_LEN = 256, 58 SRP_MAX_IU_LEN = 256,
58 59
59 SRP_RQ_SHIFT = 6, 60 SRP_RQ_SHIFT = 6,