aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorRoland Dreier <rolandd@cisco.com>2006-06-17 23:37:33 -0400
committerRoland Dreier <rolandd@cisco.com>2006-06-17 23:37:33 -0400
commit6bfa24fa3e189269e113197a80e12862c211b3d3 (patch)
treecdd5adcb58ce726708a48636d3b657155000e8cf /drivers/infiniband
parentb7ac4ab497e44cba75fb0e9e5afca06776518934 (diff)
IB/srp: Get rid of "Target has req_lim 0" messages
It's perfectly valid for a connection to an SRP target to have a request limit of 0, so get rid of the message about it, which can spam kernel logs even with printk_ratelimit(). Keep a count of such events in a "zero_req_lim" SCSI host attribute instead, so someone who cares can look at the statistics. Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c21
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.h2
2 files changed, 17 insertions, 6 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index 4ba790f54a24..f1401e1f2f97 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -894,12 +894,8 @@ static struct srp_iu *__srp_get_tx_iu(struct srp_target_port *target)
894 if (target->tx_head - target->tx_tail >= SRP_SQ_SIZE) 894 if (target->tx_head - target->tx_tail >= SRP_SQ_SIZE)
895 return NULL; 895 return NULL;
896 896
897 if (unlikely(target->req_lim < 1)) { 897 if (unlikely(target->req_lim < 1))
898 if (printk_ratelimit()) 898 ++target->zero_req_lim;
899 printk(KERN_DEBUG PFX "Target has req_lim %d\n",
900 target->req_lim);
901 return NULL;
902 }
903 899
904 return target->tx_ring[target->tx_head & SRP_SQ_SIZE]; 900 return target->tx_ring[target->tx_head & SRP_SQ_SIZE];
905} 901}
@@ -1422,11 +1418,23 @@ static ssize_t show_dgid(struct class_device *cdev, char *buf)
1422 be16_to_cpu(((__be16 *) target->path.dgid.raw)[7])); 1418 be16_to_cpu(((__be16 *) target->path.dgid.raw)[7]));
1423} 1419}
1424 1420
1421static ssize_t show_zero_req_lim(struct class_device *cdev, char *buf)
1422{
1423 struct srp_target_port *target = host_to_target(class_to_shost(cdev));
1424
1425 if (target->state == SRP_TARGET_DEAD ||
1426 target->state == SRP_TARGET_REMOVED)
1427 return -ENODEV;
1428
1429 return sprintf(buf, "%d\n", target->zero_req_lim);
1430}
1431
1425static CLASS_DEVICE_ATTR(id_ext, S_IRUGO, show_id_ext, NULL); 1432static CLASS_DEVICE_ATTR(id_ext, S_IRUGO, show_id_ext, NULL);
1426static CLASS_DEVICE_ATTR(ioc_guid, S_IRUGO, show_ioc_guid, NULL); 1433static CLASS_DEVICE_ATTR(ioc_guid, S_IRUGO, show_ioc_guid, NULL);
1427static CLASS_DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL); 1434static CLASS_DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL);
1428static CLASS_DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL); 1435static CLASS_DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL);
1429static CLASS_DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL); 1436static CLASS_DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL);
1437static CLASS_DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL);
1430 1438
1431static struct class_device_attribute *srp_host_attrs[] = { 1439static struct class_device_attribute *srp_host_attrs[] = {
1432 &class_device_attr_id_ext, 1440 &class_device_attr_id_ext,
@@ -1434,6 +1442,7 @@ static struct class_device_attribute *srp_host_attrs[] = {
1434 &class_device_attr_service_id, 1442 &class_device_attr_service_id,
1435 &class_device_attr_pkey, 1443 &class_device_attr_pkey,
1436 &class_device_attr_dgid, 1444 &class_device_attr_dgid,
1445 &class_device_attr_zero_req_lim,
1437 NULL 1446 NULL
1438}; 1447};
1439 1448
diff --git a/drivers/infiniband/ulp/srp/ib_srp.h b/drivers/infiniband/ulp/srp/ib_srp.h
index 033a44772ae3..ad45e4856e1c 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.h
+++ b/drivers/infiniband/ulp/srp/ib_srp.h
@@ -138,6 +138,8 @@ struct srp_target_port {
138 int max_ti_iu_len; 138 int max_ti_iu_len;
139 s32 req_lim; 139 s32 req_lim;
140 140
141 int zero_req_lim;
142
141 unsigned rx_head; 143 unsigned rx_head;
142 struct srp_iu *rx_ring[SRP_RQ_SIZE]; 144 struct srp_iu *rx_ring[SRP_RQ_SIZE];
143 145