Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 45426
b: refs/heads/master
c: f093840
h: refs/heads/master
v: v3
  • Loading branch information
Erez Zilber authored and Roland Dreier committed Jan 7, 2007
1 parent 546054d commit 51491d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 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: 46707e96b7254663139225ab6c9ab9922cd8c435
refs/heads/master: f0938401f2252bf39615c0815734650eab9053c8
4 changes: 2 additions & 2 deletions trunk/drivers/infiniband/ulp/iser/iscsi_iser.c
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ iscsi_iser_mtask_xmit(struct iscsi_conn *conn,
* - if yes, the mtask is recycled at iscsi_complete_pdu
* - if no, the mtask is recycled at iser_snd_completion
*/
if (error && error != -EAGAIN)
if (error && error != -ENOBUFS)
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);

return error;
Expand Down Expand Up @@ -241,7 +241,7 @@ iscsi_iser_ctask_xmit(struct iscsi_conn *conn,
error = iscsi_iser_ctask_xmit_unsol_data(conn, ctask);

iscsi_iser_ctask_xmit_exit:
if (error && error != -EAGAIN)
if (error && error != -ENOBUFS)
iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED);
return error;
}
Expand Down
26 changes: 12 additions & 14 deletions trunk/drivers/infiniband/ulp/iser/iser_initiator.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,18 +304,14 @@ int iser_conn_set_full_featured_mode(struct iscsi_conn *conn)
static int
iser_check_xmit(struct iscsi_conn *conn, void *task)
{
int rc = 0;
struct iscsi_iser_conn *iser_conn = conn->dd_data;

write_lock_bh(conn->recv_lock);
if (atomic_read(&iser_conn->ib_conn->post_send_buf_count) ==
ISER_QP_MAX_REQ_DTOS) {
iser_dbg("%ld can't xmit task %p, suspending tx\n",jiffies,task);
set_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
rc = -EAGAIN;
iser_dbg("%ld can't xmit task %p\n",jiffies,task);
return -ENOBUFS;
}
write_unlock_bh(conn->recv_lock);
return rc;
return 0;
}


Expand All @@ -340,7 +336,7 @@ int iser_send_command(struct iscsi_conn *conn,
return -EPERM;
}
if (iser_check_xmit(conn, ctask))
return -EAGAIN;
return -ENOBUFS;

edtl = ntohl(hdr->data_length);

Expand Down Expand Up @@ -426,7 +422,7 @@ int iser_send_data_out(struct iscsi_conn *conn,
}

if (iser_check_xmit(conn, ctask))
return -EAGAIN;
return -ENOBUFS;

itt = ntohl(hdr->itt);
data_seg_len = ntoh24(hdr->dlength);
Expand Down Expand Up @@ -498,7 +494,7 @@ int iser_send_control(struct iscsi_conn *conn,
}

if (iser_check_xmit(conn,mtask))
return -EAGAIN;
return -ENOBUFS;

/* build the tx desc regd header and add it to the tx desc dto */
mdesc->type = ISCSI_TX_CONTROL;
Expand Down Expand Up @@ -605,6 +601,7 @@ void iser_snd_completion(struct iser_desc *tx_desc)
struct iscsi_iser_conn *iser_conn = ib_conn->iser_conn;
struct iscsi_conn *conn = iser_conn->iscsi_conn;
struct iscsi_mgmt_task *mtask;
int resume_tx = 0;

iser_dbg("Initiator, Data sent dto=0x%p\n", dto);

Expand All @@ -613,15 +610,16 @@ void iser_snd_completion(struct iser_desc *tx_desc)
if (tx_desc->type == ISCSI_TX_DATAOUT)
kmem_cache_free(ig.desc_cache, tx_desc);

if (atomic_read(&iser_conn->ib_conn->post_send_buf_count) ==
ISER_QP_MAX_REQ_DTOS)
resume_tx = 1;

atomic_dec(&ib_conn->post_send_buf_count);

write_lock(conn->recv_lock);
if (conn->suspend_tx) {
if (resume_tx) {
iser_dbg("%ld resuming tx\n",jiffies);
clear_bit(ISCSI_SUSPEND_BIT, &conn->suspend_tx);
scsi_queue_work(conn->session->host, &conn->xmitwork);
}
write_unlock(conn->recv_lock);

if (tx_desc->type == ISCSI_TX_CONTROL) {
/* this arithmetic is legal by libiscsi dd_data allocation */
Expand Down

0 comments on commit 51491d6

Please sign in to comment.