Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 265585
b: refs/heads/master
c: dcc7e3a
h: refs/heads/master
i:
  265583: 2f7c46f
v: v3
  • Loading branch information
Michael Chan authored and David S. Miller committed Aug 28, 2011
1 parent cc6608a commit 373ebad
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 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: dc219a2e4812eecdc5438d2a0e2434b03d3efbf2
refs/heads/master: dcc7e3a6a2a2464cf96dee329f7c58fe8c230d97
17 changes: 10 additions & 7 deletions trunk/drivers/net/ethernet/broadcom/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -1875,12 +1875,12 @@ static int cnic_bnx2x_destroy_ramrod(struct cnic_dev *dev, u32 l5_cid)
hw_cid, NONE_CONNECTION_TYPE, &l5_data);

if (ret == 0) {
wait_event(ctx->waitq, ctx->wait_cond);
wait_event_timeout(ctx->waitq, ctx->wait_cond, CNIC_RAMROD_TMO);
if (unlikely(test_bit(CTX_FL_CID_ERROR, &ctx->ctx_flags)))
return -EBUSY;
}

return ret;
return 0;
}

static int cnic_bnx2x_iscsi_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
Expand Down Expand Up @@ -2428,17 +2428,20 @@ static int cnic_bnx2x_fcoe_destroy(struct cnic_dev *dev, struct kwqe *kwqe)
init_waitqueue_head(&ctx->waitq);
ctx->wait_cond = 0;

memset(&kcqe, 0, sizeof(kcqe));
kcqe.completion_status = FCOE_KCQE_COMPLETION_STATUS_ERROR;
memset(&l5_data, 0, sizeof(l5_data));
ret = cnic_submit_kwqe_16(dev, FCOE_RAMROD_CMD_ID_TERMINATE_CONN, cid,
FCOE_CONNECTION_TYPE, &l5_data);
if (ret == 0) {
wait_event(ctx->waitq, ctx->wait_cond);
set_bit(CTX_FL_DELETE_WAIT, &ctx->ctx_flags);
queue_delayed_work(cnic_wq, &cp->delete_task,
msecs_to_jiffies(2000));
wait_event_timeout(ctx->waitq, ctx->wait_cond, CNIC_RAMROD_TMO);
if (ctx->wait_cond)
kcqe.completion_status = 0;
}

memset(&kcqe, 0, sizeof(kcqe));
set_bit(CTX_FL_DELETE_WAIT, &ctx->ctx_flags);
queue_delayed_work(cnic_wq, &cp->delete_task, msecs_to_jiffies(2000));

kcqe.op_code = FCOE_KCQE_OPCODE_DESTROY_CONN;
kcqe.fcoe_conn_id = req->conn_id;
kcqe.fcoe_conn_context_id = cid;
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/net/ethernet/broadcom/cnic.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,5 +474,7 @@ struct bnx2x_bd_chain_next {
MAX_STAT_COUNTER_ID_E1))
#endif

#define CNIC_RAMROD_TMO (HZ / 4)

#endif

1 change: 1 addition & 0 deletions trunk/drivers/net/ethernet/broadcom/cnic_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
#define FCOE_KWQE_OPCODE_DESTROY (10)
#define FCOE_KWQE_OPCODE_STAT (11)

#define FCOE_KCQE_COMPLETION_STATUS_ERROR (0x1)
#define FCOE_KCQE_COMPLETION_STATUS_CTX_ALLOC_FAILURE (0x3)

/* KCQ (kernel completion queue) response op codes */
Expand Down

0 comments on commit 373ebad

Please sign in to comment.