Author: glebius
Date: Thu Jan 23 01:47:43 2020
New Revision: 357012
URL: https://svnweb.freebsd.org/changeset/base/357012

Log:
  Stop entering the network epoch in ether_input(), unless driver
  is marked with IFF_NEEDSEPOCH.

Modified:
  head/sys/net/if_ethersubr.c

Modified: head/sys/net/if_ethersubr.c
==============================================================================
--- head/sys/net/if_ethersubr.c Thu Jan 23 01:46:05 2020        (r357011)
+++ head/sys/net/if_ethersubr.c Thu Jan 23 01:47:43 2020        (r357012)
@@ -809,7 +809,8 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
         * them up. This allows the drivers to amortize the receive lock.
         */
        CURVNET_SET_QUIET(ifp->if_vnet);
-       NET_EPOCH_ENTER(et);
+       if (__predict_false(ifp->if_flags & IFF_NEEDSEPOCH))
+               NET_EPOCH_ENTER(et);
        while (m) {
                mn = m->m_nextpkt;
                m->m_nextpkt = NULL;
@@ -824,7 +825,8 @@ ether_input(struct ifnet *ifp, struct mbuf *m)
                netisr_dispatch(NETISR_ETHER, m);
                m = mn;
        }
-       NET_EPOCH_EXIT(et);
+       if (__predict_false(ifp->if_flags & IFF_NEEDSEPOCH))
+               NET_EPOCH_EXIT(et);
        CURVNET_RESTORE();
 }
 
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to