freebsd_network: ether_input needs to support multiple packets.

It does on FreeBSD, though not many drivers make use
of this functionality (on Haiku, only iflib appeared to,
and it has a workaround at the moment.)
This commit is contained in:
Augustin Cavalier
2024-01-26 16:00:13 -05:00
parent 17aa6d0125
commit 9504fccf29
+17 -3
View File
@@ -793,10 +793,24 @@ ether_output(struct ifnet *ifp, struct mbuf *m, struct sockaddr *dst,
}
static void ether_input(struct ifnet *ifp, struct mbuf *m)
static void
ether_input(struct ifnet *ifp, struct mbuf *m)
{
IF_ENQUEUE(&ifp->receive_queue, m);
release_sem_etc(ifp->receive_sem, 1, B_DO_NOT_RESCHEDULE);
int32 count = 0;
IF_LOCK(&ifp->receive_queue);
while (m != NULL) {
struct mbuf *mn = m->m_nextpkt;
m->m_nextpkt = NULL;
_IF_ENQUEUE(&ifp->receive_queue, m);
count++;
m = mn;
}
IF_UNLOCK(&ifp->receive_queue);
release_sem_etc(ifp->receive_sem, count, B_DO_NOT_RESCHEDULE);
}