Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Nov 2019 21:08:49 +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: r354481 - head/sys/netinet
Message-ID:  <201911072108.xA7L8n3q084904@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: glebius
Date: Thu Nov  7 21:08:49 2019
New Revision: 354481
URL: https://svnweb.freebsd.org/changeset/base/354481

Log:
  Remove unnecessary recursive epoch enter via INP_INFO_RLOCK
  macro in udp_input().  It shall always run in the network epoch.

Modified:
  head/sys/netinet/udp_usrreq.c

Modified: head/sys/netinet/udp_usrreq.c
==============================================================================
--- head/sys/netinet/udp_usrreq.c	Thu Nov  7 21:03:15 2019	(r354480)
+++ head/sys/netinet/udp_usrreq.c	Thu Nov  7 21:08:49 2019	(r354481)
@@ -399,7 +399,6 @@ udp_input(struct mbuf **mp, int *offp, int proto)
 	struct sockaddr_in udp_in[2];
 	struct mbuf *m;
 	struct m_tag *fwd_tag;
-	struct epoch_tracker et;
 	int cscov_partial, iphlen;
 
 	m = *mp;
@@ -528,7 +527,8 @@ udp_input(struct mbuf **mp, int *offp, int proto)
 		struct inpcb *last;
 		struct inpcbhead *pcblist;
 
-		INP_INFO_RLOCK_ET(pcbinfo, et);
+		NET_EPOCH_ASSERT();
+
 		pcblist = udp_get_pcblist(proto);
 		last = NULL;
 		CK_LIST_FOREACH(inp, pcblist, inp_list) {
@@ -635,7 +635,6 @@ udp_input(struct mbuf **mp, int *offp, int proto)
 			UDPSTAT_INC(udps_noportbcast);
 			if (inp)
 				INP_RUNLOCK(inp);
-			INP_INFO_RUNLOCK_ET(pcbinfo, et);
 			goto badunlocked;
 		}
 		if (proto == IPPROTO_UDPLITE)
@@ -645,7 +644,6 @@ udp_input(struct mbuf **mp, int *offp, int proto)
 		if (udp_append(last, ip, m, iphlen, udp_in) == 0) 
 			INP_RUNLOCK(last);
 	inp_lost:
-		INP_INFO_RUNLOCK_ET(pcbinfo, et);
 		return (IPPROTO_DONE);
 	}
 



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