Stop entering the network epoch in ether_input(), unless driver

is marked with IFF_NEEDSEPOCH.
This commit is contained in:
glebius 2020-01-23 01:47:43 +00:00
parent 961867cbc5
commit c224706f7b

View File

@ -809,6 +809,7 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
* them up. This allows the drivers to amortize the receive lock. * them up. This allows the drivers to amortize the receive lock.
*/ */
CURVNET_SET_QUIET(ifp->if_vnet); CURVNET_SET_QUIET(ifp->if_vnet);
if (__predict_false(ifp->if_flags & IFF_NEEDSEPOCH))
NET_EPOCH_ENTER(et); NET_EPOCH_ENTER(et);
while (m) { while (m) {
mn = m->m_nextpkt; mn = m->m_nextpkt;
@ -824,6 +825,7 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
netisr_dispatch(NETISR_ETHER, m); netisr_dispatch(NETISR_ETHER, m);
m = mn; m = mn;
} }
if (__predict_false(ifp->if_flags & IFF_NEEDSEPOCH))
NET_EPOCH_EXIT(et); NET_EPOCH_EXIT(et);
CURVNET_RESTORE(); CURVNET_RESTORE();
} }