@@ -203,7 +203,7 @@ class XioPortal : public Thread
203
203
XioSubmit::Queue& send_q) {
204
204
// XXX gather all already-dequeued outgoing messages for xcon
205
205
// and push them in FIFO order to front of the input queue,
206
- // having first marked the connection as flow-controlled
206
+ // and mark the connection as flow-controlled
207
207
XioSubmit::Queue requeue_q;
208
208
XioSubmit *xs;
209
209
requeue_q.push_back (*xmsg);
@@ -260,18 +260,18 @@ class XioPortal : public Thread
260
260
switch (xs->type ) {
261
261
case XioSubmit::OUTGOING_MSG: /* it was an outgoing 1-way */
262
262
xmsg = static_cast <XioMsg*>(xs);
263
- if (unlikely (!xs-> xcon ->conn ))
263
+ if (unlikely (!xcon-> conn || ! xcon->is_connected () ))
264
264
code = ENOTCONN;
265
265
else {
266
- /* XXX guard Accelio send queue (should be safe to rely
267
- * on Accelio's check on below, but this assures that
268
- * all chained xio_msg are accounted) */
269
- xio_qdepth_high = xcon->xio_qdepth_high_mark ();
270
- if (unlikely ((xcon->send_ctr + xmsg->hdr .msg_cnt ) >
271
- xio_qdepth_high)) {
272
- requeue_all_xcon (xmsg, xcon, q_iter, send_q);
273
- goto restart;
274
- }
266
+ /* XXX guard Accelio send queue (should be safe to rely
267
+ * on Accelio's check on below, but this assures that
268
+ * all chained xio_msg are accounted) */
269
+ xio_qdepth_high = xcon->xio_qdepth_high_mark ();
270
+ if (unlikely ((xcon->send_ctr + xmsg->hdr .msg_cnt ) >
271
+ xio_qdepth_high)) {
272
+ requeue_all_xcon (xmsg, xcon, q_iter, send_q);
273
+ goto restart;
274
+ }
275
275
276
276
msg = &xmsg->req_0 .msg ;
277
277
code = xio_send_msg (xcon->conn , msg);
@@ -280,6 +280,9 @@ class XioPortal : public Thread
280
280
print_xio_msg_hdr (msgr->cct , " xio_send_msg" , xmsg->hdr , msg);
281
281
print_ceph_msg (msgr->cct , " xio_send_msg" , xmsg->m );
282
282
}
283
+ /* get the right Accelio's errno code */
284
+ if (unlikely (code))
285
+ code = xio_errno ();
283
286
} /* !ENOTCONN */
284
287
if (unlikely (code)) {
285
288
switch (code) {
@@ -291,12 +294,12 @@ class XioPortal : public Thread
291
294
break ;
292
295
default :
293
296
q_iter = send_q.erase (q_iter);
294
- xs-> xcon ->msg_send_fail (xmsg, code);
297
+ xcon->msg_send_fail (xmsg, code);
295
298
continue ;
296
299
break ;
297
300
};
298
301
} else {
299
- xs-> xcon ->send .set (msg->timestamp ); // need atomic?
302
+ xcon->send .set (msg->timestamp ); // need atomic?
300
303
xcon->send_ctr += xmsg->hdr .msg_cnt ; // only inc if cb promised
301
304
}
302
305
break ;
0 commit comments