From owner-p4-projects@FreeBSD.ORG Wed Dec 12 05:51:29 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 2B10516A418; Wed, 12 Dec 2007 05:51:29 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B0F4016A421 for ; Wed, 12 Dec 2007 05:51:28 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0CA13C478 for ; Wed, 12 Dec 2007 05:51:28 +0000 (UTC) (envelope-from kmacy@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBC5pSAN020029 for ; Wed, 12 Dec 2007 05:51:28 GMT (envelope-from kmacy@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBC5pSaO020025 for perforce@freebsd.org; Wed, 12 Dec 2007 05:51:28 GMT (envelope-from kmacy@freebsd.org) Date: Wed, 12 Dec 2007 05:51:28 GMT Message-Id: <200712120551.lBC5pSaO020025@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to kmacy@freebsd.org using -f From: Kip Macy To: Perforce Change Reviews Cc: Subject: PERFORCE change 130671 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2007 05:51:29 -0000 http://perforce.freebsd.org/chv.cgi?CH=130671 Change 130671 by kmacy@kmacy:storage:toehead on 2007/12/12 05:51:17 Integrate TCP offload hooks for active open, transmit, and close Affected files ... .. //depot/projects/toehead/sys/netinet/tcp_subr.c#2 edit .. //depot/projects/toehead/sys/netinet/tcp_usrreq.c#2 edit Differences ... ==== //depot/projects/toehead/sys/netinet/tcp_subr.c#2 (text+ko) ==== @@ -85,6 +85,7 @@ #include #include #include +#include #ifdef INET6 #include #endif @@ -651,7 +652,7 @@ if (TCPS_HAVERCVDSYN(tp->t_state)) { tp->t_state = TCPS_CLOSED; - (void) tcp_output(tp); + (void) tcp_gen_abort(tp); tcpstat.tcps_drops++; } else tcpstat.tcps_conndrops++; @@ -749,6 +750,9 @@ tp->t_segqlen--; tcp_reass_qsize--; } + /* disconnect offload device, if any */ + tcp_gen_detach(tp); + tcp_free_sackholes(tp); inp->inp_ppcb = NULL; tp->t_inpcb = NULL; @@ -768,6 +772,9 @@ INP_INFO_WLOCK_ASSERT(&tcbinfo); INP_LOCK_ASSERT(inp); + if (tp->t_state == TCPS_LISTEN) + tcp_gen_listen_close(tp); + in_pcbdrop(inp); tcpstat.tcps_closed++; KASSERT(inp->inp_socket != NULL, ("tcp_close: inp_socket NULL")); @@ -1562,7 +1569,7 @@ tp->snd_recover = tp->snd_max; if (tp->t_flags & TF_SACK_PERMIT) EXIT_FASTRECOVERY(tp); - tcp_output(tp); + tcp_gen_send(tp); return (inp); } ==== //depot/projects/toehead/sys/netinet/tcp_usrreq.c#2 (text+ko) ==== @@ -85,6 +85,7 @@ #ifdef TCPDEBUG #include #endif +#include /* * TCP protocol interface to socket abstraction. @@ -385,6 +386,7 @@ if (error == 0) { tp->t_state = TCPS_LISTEN; solisten_proto(so, backlog); + tcp_gen_listen_open(tp); } SOCK_UNLOCK(so); @@ -476,7 +478,7 @@ TCPDEBUG1(); if ((error = tcp_connect(tp, nam, td)) != 0) goto out; - error = tcp_output(tp); + error = tcp_gen_connect(so, nam); out: TCPDEBUG2(PRU_CONNECT); INP_UNLOCK(inp); @@ -528,7 +530,7 @@ inp->inp_vflag &= ~INP_IPV6; if ((error = tcp_connect(tp, (struct sockaddr *)&sin, td)) != 0) goto out; - error = tcp_output(tp); + error = tcp_gen_connect(so, nam); goto out; } inp->inp_vflag &= ~INP_IPV4; @@ -536,7 +538,7 @@ inp->inp_inc.inc_isipv6 = 1; if ((error = tcp6_connect(tp, nam, td)) != 0) goto out; - error = tcp_output(tp); + error = tcp_gen_connect(so, nam); out: TCPDEBUG2(PRU_CONNECT); @@ -703,7 +705,7 @@ TCPDEBUG1(); socantsendmore(so); tcp_usrclosed(tp); - error = tcp_output(tp); + error = tcp_gen_disconnect(tp); out: TCPDEBUG2(PRU_SHUTDOWN); @@ -733,7 +735,7 @@ } tp = intotcpcb(inp); TCPDEBUG1(); - tcp_output(tp); + tcp_gen_rcvd(tp); out: TCPDEBUG2(PRU_RCVD); @@ -838,7 +840,7 @@ if (tp != NULL) { if (flags & PRUS_MORETOCOME) tp->t_flags |= TF_MORETOCOME; - error = tcp_output(tp); + error = tcp_gen_send(tp); if (flags & PRUS_MORETOCOME) tp->t_flags &= ~TF_MORETOCOME; } @@ -889,7 +891,7 @@ } tp->snd_up = tp->snd_una + so->so_snd.sb_cc; tp->t_flags |= TF_FORCEDATA; - error = tcp_output(tp); + error = tcp_gen_send(tp); tp->t_flags &= ~TF_FORCEDATA; } out: @@ -1489,7 +1491,7 @@ sbflush(&so->so_rcv); tcp_usrclosed(tp); if (!(inp->inp_vflag & INP_DROPPED)) - tcp_output(tp); + tcp_gen_disconnect(tp); } } @@ -1511,8 +1513,9 @@ INP_LOCK_ASSERT(tp->t_inpcb); switch (tp->t_state) { + case TCPS_LISTEN: + tcp_gen_listen_close(tp); case TCPS_CLOSED: - case TCPS_LISTEN: tp->t_state = TCPS_CLOSED; tp = tcp_close(tp); /*