Author: glebius
Date: Thu Jan 23 01:38:51 2020
New Revision: 357009
URL: https://svnweb.freebsd.org/changeset/base/357009

Log:
  tap(4) calls ether_input() in context of write(2).  Enter network
  epoch here.
  
  The tun(4) side doesn't need this, as netisr code will take care.

Modified:
  head/sys/net/if_tuntap.c

Modified: head/sys/net/if_tuntap.c
==============================================================================
--- head/sys/net/if_tuntap.c    Thu Jan 23 01:35:02 2020        (r357008)
+++ head/sys/net/if_tuntap.c    Thu Jan 23 01:38:51 2020        (r357009)
@@ -1778,6 +1778,7 @@ static int
 tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m,
            struct virtio_net_hdr_mrg_rxbuf *vhdr)
 {
+       struct epoch_tracker et;
        struct ether_header *eh;
        struct ifnet *ifp;
 
@@ -1808,7 +1809,9 @@ tunwrite_l2(struct tuntap_softc *tp, struct mbuf *m,
 
        /* Pass packet up to parent. */
        CURVNET_SET(ifp->if_vnet);
+       NET_EPOCH_ENTER(et);
        (*ifp->if_input)(ifp, m);
+       NET_EPOCH_EXIT(et);
        CURVNET_RESTORE();
        /* ibytes are counted in parent */
        if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
_______________________________________________
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