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

netmap_poll should check if interface is up #935

Open
jcaplan opened this issue Aug 21, 2023 · 0 comments
Open

netmap_poll should check if interface is up #935

jcaplan opened this issue Aug 21, 2023 · 0 comments

Comments

@jcaplan
Copy link

jcaplan commented Aug 21, 2023

running pkt-gen -i ix -f tx on ix or ixl interfaces, there is a period before the hardware is ready where it looks like pkt-gen is writing 30Gb/s on a 10Gb line. Eventually once the link state changes to up then the throughput comes down to something sane and packets actually start getting sent. I'm not sure poll should be returning ready in these instances so something like:

diff --git a/sys/dev/netmap/netmap.c b/sys/dev/netmap/netmap.c
index e5f6e1f1..e86ffcdd 100644
--- a/sys/dev/netmap/netmap.c
+++ b/sys/dev/netmap/netmap.c
@@ -3711,6 +3711,10 @@ netmap_poll(struct netmap_priv_d *priv, int events, NM_SELRECORD_T *sr)
                return POLLERR;
        }
 
+       if (na->ifp != NULL &&  na->ifp->if_link_state != LINK_STATE_UP) {
+               return 0;
+       }
+
        if (netmap_debug & NM_DEBUG_ON)
                nm_prinf("device %s events 0x%x", na->name, events);
        want_tx = events & (POLLOUT | POLLWRNORM);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant