Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 15 Jan 2020 06:18:32 +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: r356757 - head/sys/net
Message-ID:  <202001150618.00F6IWB4017436@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Wed Jan 15 06:18:32 2020
New Revision: 356757
URL: https://svnweb.freebsd.org/changeset/base/356757

Log:
  gif_transmit() must always be called in the network epoch.

Modified:
  head/sys/net/if_gif.c
  head/sys/net/if_gif.h

Modified: head/sys/net/if_gif.c
==============================================================================
--- head/sys/net/if_gif.c	Wed Jan 15 06:12:39 2020	(r356756)
+++ head/sys/net/if_gif.c	Wed Jan 15 06:18:32 2020	(r356757)
@@ -272,7 +272,7 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m)
 	uint8_t proto, ecn;
 	int error;
 
-	GIF_RLOCK();
+	NET_EPOCH_ASSERT();
 #ifdef MAC
 	error = mac_ifnet_check_transmit(ifp, m);
 	if (error) {
@@ -370,7 +370,6 @@ gif_transmit(struct ifnet *ifp, struct mbuf *m)
 err:
 	if (error)
 		if_inc_counter(ifp, IFCOUNTER_OERRORS, 1);
-	GIF_RUNLOCK();
 	return (error);
 }
 

Modified: head/sys/net/if_gif.h
==============================================================================
--- head/sys/net/if_gif.h	Wed Jan 15 06:12:39 2020	(r356756)
+++ head/sys/net/if_gif.h	Wed Jan 15 06:18:32 2020	(r356757)
@@ -97,8 +97,6 @@ struct etherip_header {
 /* mbuf adjust factor to force 32-bit alignment of IP header */
 #define	ETHERIP_ALIGN		2
 
-#define	GIF_RLOCK()	struct epoch_tracker gif_et; epoch_enter_preempt(net_epoch_preempt, &gif_et)
-#define	GIF_RUNLOCK()	epoch_exit_preempt(net_epoch_preempt, &gif_et)
 #define	GIF_WAIT()	epoch_wait_preempt(net_epoch_preempt)
 
 /* Prototypes */



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