Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 27616
b: refs/heads/master
c: 6bfa24f
h: refs/heads/master
v: v3
  • Loading branch information
Roland Dreier committed Jun 18, 2006
1 parent 575de8d commit 1af67bc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7ac4ab497e44cba75fb0e9e5afca06776518934
refs/heads/master: 6bfa24fa3e189269e113197a80e12862c211b3d3
21 changes: 15 additions & 6 deletions trunk/drivers/infiniband/ulp/srp/ib_srp.c
Original file line number Diff line number Diff line change
Expand Up @@ -894,12 +894,8 @@ static struct srp_iu *__srp_get_tx_iu(struct srp_target_port *target)
if (target->tx_head - target->tx_tail >= SRP_SQ_SIZE)
return NULL;

if (unlikely(target->req_lim < 1)) {
if (printk_ratelimit())
printk(KERN_DEBUG PFX "Target has req_lim %d\n",
target->req_lim);
return NULL;
}
if (unlikely(target->req_lim < 1))
++target->zero_req_lim;

return target->tx_ring[target->tx_head & SRP_SQ_SIZE];
}
Expand Down Expand Up @@ -1422,18 +1418,31 @@ static ssize_t show_dgid(struct class_device *cdev, char *buf)
be16_to_cpu(((__be16 *) target->path.dgid.raw)[7]));
}

static ssize_t show_zero_req_lim(struct class_device *cdev, char *buf)
{
struct srp_target_port *target = host_to_target(class_to_shost(cdev));

if (target->state == SRP_TARGET_DEAD ||
target->state == SRP_TARGET_REMOVED)
return -ENODEV;

return sprintf(buf, "%d\n", target->zero_req_lim);
}

static CLASS_DEVICE_ATTR(id_ext, S_IRUGO, show_id_ext, NULL);
static CLASS_DEVICE_ATTR(ioc_guid, S_IRUGO, show_ioc_guid, NULL);
static CLASS_DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL);
static CLASS_DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL);
static CLASS_DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL);
static CLASS_DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL);

static struct class_device_attribute *srp_host_attrs[] = {
&class_device_attr_id_ext,
&class_device_attr_ioc_guid,
&class_device_attr_service_id,
&class_device_attr_pkey,
&class_device_attr_dgid,
&class_device_attr_zero_req_lim,
NULL
};

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/infiniband/ulp/srp/ib_srp.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ struct srp_target_port {
int max_ti_iu_len;
s32 req_lim;

int zero_req_lim;

unsigned rx_head;
struct srp_iu *rx_ring[SRP_RQ_SIZE];

Expand Down

0 comments on commit 1af67bc

Please sign in to comment.