Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76809
b: refs/heads/master
c: 4fc8cd4
h: refs/heads/master
i:
  76807: 9c0b625
v: v3
  • Loading branch information
Sean Hefty authored and Roland Dreier committed Jan 25, 2008
1 parent 4e67dd9 commit b0e73cb
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 6 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: 547af76521b3fd4b9ec5c9a9975a17eadb95e6f6
refs/heads/master: 4fc8cd4919428f9b86f0b65e2f3245a1c186737f
9 changes: 7 additions & 2 deletions trunk/drivers/infiniband/core/mad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,9 @@ int ib_post_send_mad(struct ib_mad_send_buf *send_buf,
mad_send_wr->tid = ((struct ib_mad_hdr *) send_buf->mad)->tid;
/* Timeout will be updated after send completes */
mad_send_wr->timeout = msecs_to_jiffies(send_buf->timeout_ms);
mad_send_wr->retries = send_buf->retries;
mad_send_wr->max_retries = send_buf->retries;
mad_send_wr->retries_left = send_buf->retries;
send_buf->retries = 0;
/* Reference for work request to QP + response */
mad_send_wr->refcount = 1 + (mad_send_wr->timeout > 0);
mad_send_wr->status = IB_WC_SUCCESS;
Expand Down Expand Up @@ -2436,9 +2438,12 @@ static int retry_send(struct ib_mad_send_wr_private *mad_send_wr)
{
int ret;

if (!mad_send_wr->retries--)
if (!mad_send_wr->retries_left)
return -ETIMEDOUT;

mad_send_wr->retries_left--;
mad_send_wr->send_buf.retries++;

mad_send_wr->timeout = msecs_to_jiffies(mad_send_wr->send_buf.timeout_ms);

if (mad_send_wr->mad_agent_priv->agent.rmpp_version) {
Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/infiniband/core/mad_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ struct ib_mad_send_wr_private {
struct ib_sge sg_list[IB_MAD_SEND_REQ_MAX_SG];
__be64 tid;
unsigned long timeout;
int retries;
int max_retries;
int retries_left;
int retry;
int refcount;
enum ib_wc_status status;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/infiniband/core/mad_rmpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,7 @@ static void process_rmpp_ack(struct ib_mad_agent_private *agent,

if (seg_num > mad_send_wr->last_ack) {
adjust_last_ack(mad_send_wr, seg_num);
mad_send_wr->retries = mad_send_wr->send_buf.retries;
mad_send_wr->retries_left = mad_send_wr->max_retries;
}
mad_send_wr->newwin = newwin;
if (mad_send_wr->last_ack == mad_send_wr->send_buf.seg_count) {
Expand Down
4 changes: 3 additions & 1 deletion trunk/include/rdma/ib_mad.h
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,9 @@ struct ib_class_port_info
* @seg_count: The number of RMPP segments allocated for this send.
* @seg_size: Size of each RMPP segment.
* @timeout_ms: Time to wait for a response.
* @retries: Number of times to retry a request for a response.
* @retries: Number of times to retry a request for a response. For MADs
* using RMPP, this applies per window. On completion, returns the number
* of retries needed to complete the transfer.
*
* Users are responsible for initializing the MAD buffer itself, with the
* exception of any RMPP header. Additional segment buffer space allocated
Expand Down

0 comments on commit b0e73cb

Please sign in to comment.