Skip to content

Commit aa5f195

Browse files
Vu PhamMatt Benjamin
Vu Pham
authored and
Matt Benjamin
committed
xio: Get the right Accelio errno code
Get the right Accelio errno code on xio_send_msg in order to correctly requeue or fail the xmsg Signed-off-by: Vu Pham <[email protected]> Signed-off-by: Matt Benjamin <[email protected]>
1 parent 37719c3 commit aa5f195

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

src/msg/xio/XioPortal.h

+16-13
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ class XioPortal : public Thread
203203
XioSubmit::Queue& send_q) {
204204
// XXX gather all already-dequeued outgoing messages for xcon
205205
// 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
207207
XioSubmit::Queue requeue_q;
208208
XioSubmit *xs;
209209
requeue_q.push_back(*xmsg);
@@ -260,18 +260,18 @@ class XioPortal : public Thread
260260
switch (xs->type) {
261261
case XioSubmit::OUTGOING_MSG: /* it was an outgoing 1-way */
262262
xmsg = static_cast<XioMsg*>(xs);
263-
if (unlikely(!xs->xcon->conn))
263+
if (unlikely(!xcon->conn || !xcon->is_connected()))
264264
code = ENOTCONN;
265265
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+
}
275275

276276
msg = &xmsg->req_0.msg;
277277
code = xio_send_msg(xcon->conn, msg);
@@ -280,6 +280,9 @@ class XioPortal : public Thread
280280
print_xio_msg_hdr(msgr->cct, "xio_send_msg", xmsg->hdr, msg);
281281
print_ceph_msg(msgr->cct, "xio_send_msg", xmsg->m);
282282
}
283+
/* get the right Accelio's errno code */
284+
if (unlikely(code))
285+
code = xio_errno();
283286
} /* !ENOTCONN */
284287
if (unlikely(code)) {
285288
switch (code) {
@@ -291,12 +294,12 @@ class XioPortal : public Thread
291294
break;
292295
default:
293296
q_iter = send_q.erase(q_iter);
294-
xs->xcon->msg_send_fail(xmsg, code);
297+
xcon->msg_send_fail(xmsg, code);
295298
continue;
296299
break;
297300
};
298301
} else {
299-
xs->xcon->send.set(msg->timestamp); // need atomic?
302+
xcon->send.set(msg->timestamp); // need atomic?
300303
xcon->send_ctr += xmsg->hdr.msg_cnt; // only inc if cb promised
301304
}
302305
break;

0 commit comments

Comments
 (0)