mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-19 10:53:58 +00: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
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=258328
@ -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 New Issue
Block a user