svn commit: r354473 - head/sys/netinet6

Gleb Smirnoff glebius at FreeBSD.org
Thu Nov 7 20:38:54 UTC 2019


Author: glebius
Date: Thu Nov  7 20:38:53 2019
New Revision: 354473
URL: https://svnweb.freebsd.org/changeset/base/354473

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

Modified:
  head/sys/netinet6/udp6_usrreq.c

Modified: head/sys/netinet6/udp6_usrreq.c
==============================================================================
--- head/sys/netinet6/udp6_usrreq.c	Thu Nov  7 20:11:53 2019	(r354472)
+++ head/sys/netinet6/udp6_usrreq.c	Thu Nov  7 20:38:53 2019	(r354473)
@@ -214,12 +214,13 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
 	int off = *offp;
 	int cscov_partial;
 	int plen, ulen;
-	struct epoch_tracker et;
 	struct sockaddr_in6 fromsa[2];
 	struct m_tag *fwd_tag;
 	uint16_t uh_sum;
 	uint8_t nxt;
 
+	NET_EPOCH_ASSERT();
+
 	ifp = m->m_pkthdr.rcvif;
 
 #ifndef PULLDOWN_TEST
@@ -301,7 +302,6 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
 		struct inpcbhead *pcblist;
 		struct ip6_moptions *imo;
 
-		INP_INFO_RLOCK_ET(pcbinfo, et);
 		/*
 		 * In the event that laddr should be set to the link-local
 		 * address (this happens in RIPng), the multicast address
@@ -395,7 +395,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
 							UDP_PROBE(receive, NULL, last,
 							    ip6, last, uh);
 						if (udp6_append(last, n, off, fromsa))
-							goto inp_lost;
+							return (IPPROTO_DONE);
 					}
 					INP_RUNLOCK(last);
 				}
@@ -422,7 +422,7 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
 			 */
 			UDPSTAT_INC(udps_noport);
 			UDPSTAT_INC(udps_noportmcast);
-			goto badheadlocked;
+			goto badunlocked;
 		}
 		INP_RLOCK(last);
 		if (__predict_true(last->inp_flags2 & INP_FREED) == 0) {
@@ -434,8 +434,6 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
 				INP_RUNLOCK(last);
 		} else
 			INP_RUNLOCK(last);
-	inp_lost:
-		INP_INFO_RUNLOCK_ET(pcbinfo, et);
 		return (IPPROTO_DONE);
 	}
 	/*
@@ -522,8 +520,6 @@ udp6_input(struct mbuf **mp, int *offp, int proto)
 		INP_RUNLOCK(inp);
 	return (IPPROTO_DONE);
 
-badheadlocked:
-	INP_INFO_RUNLOCK_ET(pcbinfo, et);
 badunlocked:
 	if (m)
 		m_freem(m);


More information about the svn-src-head mailing list