Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 23 Jan 2020 01:38:52 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r357009 - head/sys/net
Message-ID:  <202001230138.00N1cqw6036225@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001230138.00N1cqw6036225>