Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 Jan 2014 21:30:05 +0000 (UTC)
From:      Kai Wang <kaiw@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r261245 - in projects/elftoolchain/sys: dev/acpica netinet
Message-ID:  <201401282130.s0SLU5JV081977@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kaiw
Date: Tue Jan 28 21:30:05 2014
New Revision: 261245
URL: http://svnweb.freebsd.org/changeset/base/261245

Log:
  MFH@261244.

Modified:
  projects/elftoolchain/sys/dev/acpica/acpi.c
  projects/elftoolchain/sys/netinet/tcp_input.c
  projects/elftoolchain/sys/netinet/tcp_syncache.c
  projects/elftoolchain/sys/netinet/tcp_usrreq.c
Directory Properties:
  projects/elftoolchain/   (props changed)
  projects/elftoolchain/sys/   (props changed)

Modified: projects/elftoolchain/sys/dev/acpica/acpi.c
==============================================================================
--- projects/elftoolchain/sys/dev/acpica/acpi.c	Tue Jan 28 21:13:15 2014	(r261244)
+++ projects/elftoolchain/sys/dev/acpica/acpi.c	Tue Jan 28 21:30:05 2014	(r261245)
@@ -1190,12 +1190,28 @@ acpi_set_resource(device_t dev, device_t
     struct acpi_softc *sc = device_get_softc(dev);
     struct acpi_device *ad = device_get_ivars(child);
     struct resource_list *rl = &ad->ad_rl;
+    ACPI_DEVICE_INFO *devinfo;
     u_long end;
     
     /* Ignore IRQ resources for PCI link devices. */
     if (type == SYS_RES_IRQ && ACPI_ID_PROBE(dev, child, pcilink_ids) != NULL)
 	return (0);
 
+    /*
+     * Ignore memory resources for PCI root bridges.  Some BIOSes
+     * incorrectly enumerate the memory ranges they decode as plain
+     * memory resources instead of as a ResourceProducer range.
+     */
+    if (type == SYS_RES_MEMORY) {
+	if (ACPI_SUCCESS(AcpiGetObjectInfo(ad->ad_handle, &devinfo))) {
+	    if ((devinfo->Flags & ACPI_PCI_ROOT_BRIDGE) != 0) {
+		AcpiOsFree(devinfo);
+		return (0);
+	    }
+	    AcpiOsFree(devinfo);
+	}
+    }
+
     /* If the resource is already allocated, fail. */
     if (resource_list_busy(rl, type, rid))
 	return (EBUSY);

Modified: projects/elftoolchain/sys/netinet/tcp_input.c
==============================================================================
--- projects/elftoolchain/sys/netinet/tcp_input.c	Tue Jan 28 21:13:15 2014	(r261244)
+++ projects/elftoolchain/sys/netinet/tcp_input.c	Tue Jan 28 21:30:05 2014	(r261245)
@@ -2429,8 +2429,19 @@ tcp_do_segment(struct mbuf *m, struct tc
 		hhook_run_tcp_est_in(tp, th, &to);
 
 		if (SEQ_LEQ(th->th_ack, tp->snd_una)) {
-			if (tlen == 0 && tiwin == tp->snd_wnd &&
-			    !(thflags & TH_FIN)) {
+			if (tlen == 0 && tiwin == tp->snd_wnd) {
+				/*
+				 * If this is the first time we've seen a
+				 * FIN from the remote, this is not a
+				 * duplicate and it needs to be processed
+				 * normally.  This happens during a
+				 * simultaneous close.
+				 */
+				if ((thflags & TH_FIN) &&
+				    (TCPS_HAVERCVDFIN(tp->t_state) == 0)) {
+					tp->t_dupacks = 0;
+					break;
+				}
 				TCPSTAT_INC(tcps_rcvdupack);
 				/*
 				 * If we have outstanding data (other than
@@ -2485,16 +2496,6 @@ tcp_do_segment(struct mbuf *m, struct tc
 						}
 					} else
 						tp->snd_cwnd += tp->t_maxseg;
-					if ((thflags & TH_FIN) &&
-					    (TCPS_HAVERCVDFIN(tp->t_state) == 0)) {
-						/* 
-						 * If its a fin we need to process
-						 * it to avoid a race where both
-						 * sides enter FIN-WAIT and send FIN|ACK
-						 * at the same time.
-						 */
-						break;
-					}
 					(void) tcp_output(tp);
 					goto drop;
 				} else if (tp->t_dupacks == tcprexmtthresh) {
@@ -2534,16 +2535,6 @@ tcp_do_segment(struct mbuf *m, struct tc
 					}
 					tp->snd_nxt = th->th_ack;
 					tp->snd_cwnd = tp->t_maxseg;
-					if ((thflags & TH_FIN) &&
-					    (TCPS_HAVERCVDFIN(tp->t_state) == 0)) {
-						/* 
-						 * If its a fin we need to process
-						 * it to avoid a race where both
-						 * sides enter FIN-WAIT and send FIN|ACK
-						 * at the same time.
-						 */
-						break;
-					}
 					(void) tcp_output(tp);
 					KASSERT(tp->snd_limited <= 2,
 					    ("%s: tp->snd_limited too big",
@@ -2571,16 +2562,6 @@ tcp_do_segment(struct mbuf *m, struct tc
 					    (tp->snd_nxt - tp->snd_una) +
 					    (tp->t_dupacks - tp->snd_limited) *
 					    tp->t_maxseg;
-					if ((thflags & TH_FIN) &&
-					    (TCPS_HAVERCVDFIN(tp->t_state) == 0)) {
-						/* 
-						 * If its a fin we need to process
-						 * it to avoid a race where both
-						 * sides enter FIN-WAIT and send FIN|ACK
-						 * at the same time.
-						 */
-						break;
-					}
 					/*
 					 * Only call tcp_output when there
 					 * is new data available to be sent.

Modified: projects/elftoolchain/sys/netinet/tcp_syncache.c
==============================================================================
--- projects/elftoolchain/sys/netinet/tcp_syncache.c	Tue Jan 28 21:13:15 2014	(r261244)
+++ projects/elftoolchain/sys/netinet/tcp_syncache.c	Tue Jan 28 21:30:05 2014	(r261245)
@@ -682,7 +682,7 @@ syncache_socket(struct syncache *sc, str
 	 * connection when the SYN arrived.  If we can't create
 	 * the connection, abort it.
 	 */
-	so = sonewconn(lso, SS_ISCONNECTED);
+	so = sonewconn(lso, 0);
 	if (so == NULL) {
 		/*
 		 * Drop the connection; we will either send a RST or
@@ -922,6 +922,8 @@ syncache_socket(struct syncache *sc, str
 
 	INP_WUNLOCK(inp);
 
+	soisconnected(so);
+
 	TCPSTAT_INC(tcps_accepts);
 	return (so);
 

Modified: projects/elftoolchain/sys/netinet/tcp_usrreq.c
==============================================================================
--- projects/elftoolchain/sys/netinet/tcp_usrreq.c	Tue Jan 28 21:13:15 2014	(r261244)
+++ projects/elftoolchain/sys/netinet/tcp_usrreq.c	Tue Jan 28 21:30:05 2014	(r261245)
@@ -610,13 +610,6 @@ out:
 /*
  * Accept a connection.  Essentially all the work is done at higher levels;
  * just return the address of the peer, storing through addr.
- *
- * The rationale for acquiring the tcbinfo lock here is somewhat complicated,
- * and is described in detail in the commit log entry for r175612.  Acquiring
- * it delays an accept(2) racing with sonewconn(), which inserts the socket
- * before the inpcb address/port fields are initialized.  A better fix would
- * prevent the socket from being placed in the listen queue until all fields
- * are fully initialized.
  */
 static int
 tcp_usr_accept(struct socket *so, struct sockaddr **nam)
@@ -633,7 +626,6 @@ tcp_usr_accept(struct socket *so, struct
 
 	inp = sotoinpcb(so);
 	KASSERT(inp != NULL, ("tcp_usr_accept: inp == NULL"));
-	INP_INFO_RLOCK(&V_tcbinfo);
 	INP_WLOCK(inp);
 	if (inp->inp_flags & (INP_TIMEWAIT | INP_DROPPED)) {
 		error = ECONNABORTED;
@@ -653,7 +645,6 @@ tcp_usr_accept(struct socket *so, struct
 out:
 	TCPDEBUG2(PRU_ACCEPT);
 	INP_WUNLOCK(inp);
-	INP_INFO_RUNLOCK(&V_tcbinfo);
 	if (error == 0)
 		*nam = in_sockaddr(port, &addr);
 	return error;



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