From owner-p4-projects@FreeBSD.ORG Tue Dec 16 12:12:02 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 62F0116A4D0; Tue, 16 Dec 2003 12:12:02 -0800 (PST) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 383DC16A4CE for ; Tue, 16 Dec 2003 12:12:02 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3CE0E43D3C for ; Tue, 16 Dec 2003 12:11:59 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.10/8.12.10) with ESMTP id hBGKBx0B029286 for ; Tue, 16 Dec 2003 12:11:59 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.10/8.12.10/Submit) id hBGKBwL7029283 for perforce@freebsd.org; Tue, 16 Dec 2003 12:11:58 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 16 Dec 2003 12:11:58 -0800 (PST) Message-Id: <200312162011.hBGKBwL7029283@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to sam@freebsd.org using -f From: Sam Leffler To: Perforce Change Reviews Subject: PERFORCE change 43982 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 16 Dec 2003 20:12:02 -0000 http://perforce.freebsd.org/chv.cgi?CH=43982 Change 43982 by sam@sam_ebb on 2003/12/16 12:11:40 eliminate LOR between so_rcv and radix head by changing tcp_twrespond to not require a socket--it had been doing this to be able to create a MAC label from the socket but instead it can create it from the inpcb that is always available Affected files ... .. //depot/projects/netperf+sockets/sys/netinet/tcp_input.c#4 edit .. //depot/projects/netperf+sockets/sys/netinet/tcp_subr.c#4 edit .. //depot/projects/netperf+sockets/sys/netinet/tcp_var.h#3 edit Differences ... ==== //depot/projects/netperf+sockets/sys/netinet/tcp_input.c#4 (text+ko) ==== @@ -3044,7 +3044,7 @@ */ if (thflags != TH_ACK || tlen != 0 || th->th_seq != tw->rcv_nxt || th->th_ack != tw->snd_nxt) - tcp_twrespond(tw, NULL, m, TH_ACK); + tcp_twrespond(tw, TH_ACK); goto drop; reset: ==== //depot/projects/netperf+sockets/sys/netinet/tcp_subr.c#4 (text+ko) ==== @@ -1573,14 +1573,14 @@ } tcp_discardcb(tp); so = inp->inp_socket; - SOCK_LOCK(so); /* XXX LOR */ + SOCK_LOCK(so); so->so_pcb = NULL; tw->tw_cred = crhold(so->so_cred); tw->tw_so_options = so->so_options; + sotryfree(so); /* NB: drops lock */ + inp->inp_socket = NULL; if (acknow) - tcp_twrespond(tw, so, NULL, TH_ACK); - sotryfree(so); - inp->inp_socket = NULL; + tcp_twrespond(tw, TH_ACK); inp->inp_ppcb = (caddr_t)tw; inp->inp_vflag |= INP_TIMEWAIT; tcp_timer_2msl_reset(tw, tw_time); @@ -1644,8 +1644,7 @@ * construct a label for ay resulting packet. */ int -tcp_twrespond(struct tcptw *tw, struct socket *so, struct mbuf *msrc, - int flags) +tcp_twrespond(struct tcptw *tw, int flags) { struct inpcb *inp = tw->tw_inpcb; struct tcphdr *th; @@ -1659,8 +1658,7 @@ int isipv6 = inp->inp_inc.inc_isipv6; #endif - KASSERT(so != NULL || msrc != NULL, - ("tcp_twrespond: so and msrc NULL")); + INP_LOCK_ASSERT(inp); m = m_gethdr(M_DONTWAIT, MT_HEADER); if (m == NULL) @@ -1668,10 +1666,7 @@ m->m_data += max_linkhdr; #ifdef MAC - if (so != NULL) - mac_create_mbuf_from_socket(so, m); - else - mac_create_mbuf_netlayer(msrc, m); + mac_create_mbuf_from_inpcb(so, inp); #endif #ifdef INET6 ==== //depot/projects/netperf+sockets/sys/netinet/tcp_var.h#3 (text+ko) ==== @@ -509,7 +509,7 @@ tcp_quench(struct inpcb *, int); void tcp_respond(struct tcpcb *, void *, struct tcphdr *, struct mbuf *, tcp_seq, tcp_seq, int); -int tcp_twrespond(struct tcptw *, struct socket *, struct mbuf *, int); +int tcp_twrespond(struct tcptw *, int); void tcp_setpersist(struct tcpcb *); void tcp_slowtimo(void); struct tcptemp *