Skip to content

Commit 11e3bb8

Browse files
committed
Fix nsdperf RDMA async poll rebuild
RdmaAsync::threadBody() rebuilt its poll lists whenever rdmaDevTab.size() differed from lastDevCount, but never updated lastDevCount and never cleared the existing lists before appending. Duplicate nonblocking async FDs could accumulate, so a repeated CLIENT_REREGISTER event could cause a second ibv_get_async_event() call on an already-drained event, returning EAGAIN and terminating nsdperf. Clear the RDMA device and pollfd lists before repopulating them and record the device count after rebuilding.
1 parent 6794da0 commit 11e3bb8

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎nsdperf.C‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8153,6 +8153,11 @@ int RdmaAsync::threadBody()
81538153
// If device table size changes, rebuild the poll list
81548154
if (rdmaDevTab.size() != lastDevCount)
81558155
{
8156+
// The async fd is non-blocking; stale duplicate entries can make one
8157+
// event look readable more than once and turn the second drain into EAGAIN.
8158+
rdevList.clear();
8159+
fdList.clear();
8160+
81568161
rdevList.reserve(rdmaDevTab.size());
81578162
fdList.reserve(rdmaDevTab.size());
81588163
pfd.events = POLLIN;
@@ -8176,6 +8181,7 @@ int RdmaAsync::threadBody()
81768181
rdevList.push_back(NULL);
81778182
pfd.fd = asyncSocks[0];
81788183
fdList.push_back(pfd);
8184+
lastDevCount = rdmaDevTab.size();
81798185
}
81808186

81818187
// Poll for an event on one of the RDMA devices

0 commit comments

Comments
 (0)