File tree Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Expand file tree Collapse file tree 4 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -1100,7 +1100,9 @@ int ib_post_send_mad(struct ib_mad_send_buf *send_buf,
1100
1100
mad_send_wr -> tid = ((struct ib_mad_hdr * ) send_buf -> mad )-> tid ;
1101
1101
/* Timeout will be updated after send completes */
1102
1102
mad_send_wr -> timeout = msecs_to_jiffies (send_buf -> timeout_ms );
1103
- mad_send_wr -> retries = send_buf -> retries ;
1103
+ mad_send_wr -> max_retries = send_buf -> retries ;
1104
+ mad_send_wr -> retries_left = send_buf -> retries ;
1105
+ send_buf -> retries = 0 ;
1104
1106
/* Reference for work request to QP + response */
1105
1107
mad_send_wr -> refcount = 1 + (mad_send_wr -> timeout > 0 );
1106
1108
mad_send_wr -> status = IB_WC_SUCCESS ;
@@ -2436,9 +2438,12 @@ static int retry_send(struct ib_mad_send_wr_private *mad_send_wr)
2436
2438
{
2437
2439
int ret ;
2438
2440
2439
- if (!mad_send_wr -> retries -- )
2441
+ if (!mad_send_wr -> retries_left )
2440
2442
return - ETIMEDOUT ;
2441
2443
2444
+ mad_send_wr -> retries_left -- ;
2445
+ mad_send_wr -> send_buf .retries ++ ;
2446
+
2442
2447
mad_send_wr -> timeout = msecs_to_jiffies (mad_send_wr -> send_buf .timeout_ms );
2443
2448
2444
2449
if (mad_send_wr -> mad_agent_priv -> agent .rmpp_version ) {
Original file line number Diff line number Diff line change @@ -131,7 +131,8 @@ struct ib_mad_send_wr_private {
131
131
struct ib_sge sg_list [IB_MAD_SEND_REQ_MAX_SG ];
132
132
__be64 tid ;
133
133
unsigned long timeout ;
134
- int retries ;
134
+ int max_retries ;
135
+ int retries_left ;
135
136
int retry ;
136
137
int refcount ;
137
138
enum ib_wc_status status ;
Original file line number Diff line number Diff line change @@ -684,7 +684,7 @@ static void process_rmpp_ack(struct ib_mad_agent_private *agent,
684
684
685
685
if (seg_num > mad_send_wr -> last_ack ) {
686
686
adjust_last_ack (mad_send_wr , seg_num );
687
- mad_send_wr -> retries = mad_send_wr -> send_buf . retries ;
687
+ mad_send_wr -> retries_left = mad_send_wr -> max_retries ;
688
688
}
689
689
mad_send_wr -> newwin = newwin ;
690
690
if (mad_send_wr -> last_ack == mad_send_wr -> send_buf .seg_count ) {
Original file line number Diff line number Diff line change @@ -230,7 +230,9 @@ struct ib_class_port_info
230
230
* @seg_count: The number of RMPP segments allocated for this send.
231
231
* @seg_size: Size of each RMPP segment.
232
232
* @timeout_ms: Time to wait for a response.
233
- * @retries: Number of times to retry a request for a response.
233
+ * @retries: Number of times to retry a request for a response. For MADs
234
+ * using RMPP, this applies per window. On completion, returns the number
235
+ * of retries needed to complete the transfer.
234
236
*
235
237
* Users are responsible for initializing the MAD buffer itself, with the
236
238
* exception of any RMPP header. Additional segment buffer space allocated
You can’t perform that action at this time.
0 commit comments