Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76825
b: refs/heads/master
c: 8cba207
h: refs/heads/master
i:
  76823: 8289e2d
v: v3
  • Loading branch information
David Dillow authored and Roland Dreier committed Jan 25, 2008
1 parent 764cf21 commit e0db32e
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 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: a9e527e3f9f4510e9f3450ca3bc51bc3ef2854fd
refs/heads/master: 8cba2077325b361dedf058c7dfc6c33691422497
13 changes: 9 additions & 4 deletions trunk/drivers/infiniband/ulp/srp/ib_srp.c
Original file line number Diff line number Diff line change
Expand Up @@ -930,13 +930,18 @@ static int srp_post_recv(struct srp_target_port *target)
* req_lim and tx_head. Lock cannot be dropped between call here and
* call to __srp_post_send().
*/
static struct srp_iu *__srp_get_tx_iu(struct srp_target_port *target)
static struct srp_iu *__srp_get_tx_iu(struct srp_target_port *target,
enum srp_request_type req_type)
{
s32 min = (req_type == SRP_REQ_TASK_MGMT) ? 1 : 2;

if (target->tx_head - target->tx_tail >= SRP_SQ_SIZE)
return NULL;

if (unlikely(target->req_lim < 1))
if (target->req_lim < min) {
++target->zero_req_lim;
return NULL;
}

return target->tx_ring[target->tx_head & SRP_SQ_SIZE];
}
Expand Down Expand Up @@ -993,7 +998,7 @@ static int srp_queuecommand(struct scsi_cmnd *scmnd,
return 0;
}

iu = __srp_get_tx_iu(target);
iu = __srp_get_tx_iu(target, SRP_REQ_NORMAL);
if (!iu)
goto err;

Expand Down Expand Up @@ -1283,7 +1288,7 @@ static int srp_send_tsk_mgmt(struct srp_target_port *target,

init_completion(&req->done);

iu = __srp_get_tx_iu(target);
iu = __srp_get_tx_iu(target, SRP_REQ_TASK_MGMT);
if (!iu)
goto out;

Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/infiniband/ulp/srp/ib_srp.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,11 @@ enum srp_target_state {
SRP_TARGET_REMOVED
};

enum srp_request_type {
SRP_REQ_NORMAL,
SRP_REQ_TASK_MGMT,
};

struct srp_device {
struct list_head dev_list;
struct ib_device *dev;
Expand Down

0 comments on commit e0db32e

Please sign in to comment.