mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Allow ethernet drivers to pass in packets connected via the nextpkt pointer.
Handling packets in this way allows drivers to amortize work during packet reception. Submitted by: Vijay Singh Sponsored by: NetApp
This commit is contained in:
parent
c4dfa475ca
commit
4857f5fbbc
1 changed files with 18 additions and 6 deletions
|
|
@ -708,13 +708,25 @@ static void
|
|||
ether_input(struct ifnet *ifp, struct mbuf *m)
|
||||
{
|
||||
|
||||
/*
|
||||
* We will rely on rcvif being set properly in the deferred context,
|
||||
* so assert it is correct here.
|
||||
*/
|
||||
KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__));
|
||||
struct mbuf *mn;
|
||||
|
||||
netisr_dispatch(NETISR_ETHER, m);
|
||||
/*
|
||||
* The drivers are allowed to pass in a chain of packets linked with
|
||||
* m_nextpkt. We split them up into separate packets here and pass
|
||||
* them up. This allows the drivers to amortize the receive lock.
|
||||
*/
|
||||
while (m) {
|
||||
mn = m->m_nextpkt;
|
||||
m->m_nextpkt = NULL;
|
||||
|
||||
/*
|
||||
* We will rely on rcvif being set properly in the deferred context,
|
||||
* so assert it is correct here.
|
||||
*/
|
||||
KASSERT(m->m_pkthdr.rcvif == ifp, ("%s: ifnet mismatch", __func__));
|
||||
netisr_dispatch(NETISR_ETHER, m);
|
||||
m = mn;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Reference in a new issue