Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix netmap_tx_queues_empty #561

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions src/common/netmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -549,25 +549,17 @@ bool netmap_tx_queues_empty(void *p)
assert(sp);

sp->cur_tx_ring = 0;
txring = NETMAP_TXRING(sp->nm_if, sp->cur_tx_ring);
while (NETMAP_TX_RING_EMPTY(txring)) {
/* current ring is empty- go to next */
++sp->cur_tx_ring;
if (sp->cur_tx_ring > sp->last_tx_ring) {
/* last ring */
sp->cur_tx_ring = 0;
return true;
}

txring = NETMAP_TXRING(sp->nm_if, sp->cur_tx_ring);
for (int i = sp->cur_tx_ring; i <= sp->last_tx_ring; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. Is this change something that affects all versions of netmap? I am concerned about backwards compatibility, i.e. do we have to #ifdef or check for netmap version numbers?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, as it seems this is not enough to fix the issue... I will investigate further

txring = NETMAP_TXRING(sp->nm_if, i);
if (!NETMAP_TX_RING_EMPTY(txring)) {
ioctl(sp->handle.fd, NIOCTXSYNC, NULL);
usleep(1);
return false;
}
}

/*
* send TX interrupt signal
*/
ioctl(sp->handle.fd, NIOCTXSYNC, NULL);

return false;
return true;
}

int sendpacket_send_netmap(void *p, const u_char *data, size_t len)
Expand Down