netmap: Handle packet batches in generic mode

ifnets are allowed to pass batches of multiple packets to if_input,
linked by the m_nextpkt pointer.  iflib_rxeof() sometimes does this, for
example.  Netmap's generic mode did not handle this and would only
deliver the first packet in the batch, leaking the rest.

PR:		270636
Reviewed by:	vmaffione
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D39426
This commit is contained in:
Mark Johnston 2023-04-05 16:52:41 -04:00
parent f401d82ef7
commit 5f6d37787f

View file

@ -325,10 +325,17 @@ freebsd_generic_rx_handler(if_t ifp, struct mbuf *m)
return;
}
stolen = generic_rx_handler(ifp, m);
if (!stolen) {
NA(ifp)->if_input(ifp, m);
}
do {
struct mbuf *n;
n = m->m_nextpkt;
m->m_nextpkt = NULL;
stolen = generic_rx_handler(ifp, m);
if (!stolen) {
NA(ifp)->if_input(ifp, m);
}
m = n;
} while (m != NULL);
}
/*