}
devices = new Device*[num];
- poll_fds = new struct pollfd[2 * num];
+ poll_fds = new struct pollfd[3 * num];
for (int i = 0; i < num; ++i) {
- struct pollfd *pfd = &poll_fds[i * 2];
+ struct pollfd *pfd = &poll_fds[i * 3];
struct Device *d;
d = new Device(cct, ib, device_list[i]);
pfd[1].fd = d->rx_cc->get_fd();
pfd[1].events = POLLIN | POLLERR | POLLNVAL | POLLHUP;
pfd[1].revents = 0;
+
+ pfd[2].fd = d->ctxt->async_fd;
+ pfd[2].events = POLLIN | POLLERR | POLLNVAL | POLLHUP;
+ pfd[2].revents = 0;
}
}
{
int r = 0;
while (!done && r == 0) {
- r = poll(poll_fds, num * 2, 100);
+ r = poll(poll_fds, num * 3, 100);
if (r < 0) {
r = -errno;
lderr(cct) << __func__ << " poll failed " << r << dendl;
if (d->rx_cc->get_cq_event())
ldout(cct, 20) << __func__ << " " << *d << ": got rx cq event" << dendl;
+
+ d->handle_async_event();
}
return r;
break;
if ((ceph_clock_now() - last_inactive).to_nsec() / 1000 > cct->_conf->ms_async_rdma_polling_us) {
- global_infiniband->handle_async_event();
if (!rearmed) {
// Clean up cq events after rearm notify ensure no new incoming event
// arrived between polling and rearm