for (ix = 0; ix < q_size; ++ix) {
XioSubmit::Queue::iterator q_iter = deferred_q.begin();
XioSubmit* xs = &(*q_iter);
- assert(xs->type == XioSubmit::OUTGOING_MSG);
- XioMsg* xmsg = static_cast<XioMsg*>(xs);
- deferred_q.erase(q_iter);
- // release once for each chained xio_msg
- for (ix = 0; ix < int(xmsg->hdr.msg_cnt); ++ix)
- xmsg->put();
+ XioMsg* xmsg;
+ switch (xs->type) {
+ case XioSubmit::OUTGOING_MSG:
+ xmsg = static_cast<XioMsg*>(xs);
+ deferred_q.erase(q_iter);
+ // release once for each chained xio_msg
+ for (ix = 0; ix < int(xmsg->hdr.msg_cnt); ++ix)
+ xmsg->put();
+ break;
+ case XioSubmit::INCOMING_MSG_RELEASE:
+ deferred_q.erase(q_iter);
+ portal->release_xio_rsp(static_cast<XioRsp*>(xs));
+ break;
+ default:
+ ldout(msgr->cct,0) << __func__ << ": Unknown Msg type " << xs->type << dendl;
+ break;
+ }
}
return 0;
while (q_iter != send_q.end()) {
XioSubmit *xs = &(*q_iter);
// skip retires and anything for other connections
- if ((xs->type != XioSubmit::OUTGOING_MSG) ||
- (xs->xcon != xcon))
+ if (xs->xcon != xcon) {
+ q_iter++;
continue;
+ }
xmsg = static_cast<XioMsg*>(xs);
q_iter = send_q.erase(q_iter);
requeue_q.push_back(*xmsg);
print_ceph_msg(msgr->cct, "xio_send_msg", xmsg->m);
}
/* get the right Accelio's errno code */
- if (unlikely(code))
- code = xio_errno();
+ if (unlikely(code)) {
+ if ((code == -1) && (xio_errno() == -1)) {
+ /* In case XIO does not have any credits to send,
+ * it would still queue up the message(s) for transmission,
+ * but would return -1 and errno would also be set to -1.
+ * This needs to be treated as a success.
+ */
+ code = 0;
+ }
+ else {
+ code = xio_errno();
+ }
+ }
} /* !ENOTCONN */
if (unlikely(code)) {
switch (code) {