From owner-p4-projects@FreeBSD.ORG Tue Dec 9 11:21:58 2003 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 47EBE16A4D0; Tue, 9 Dec 2003 11:21:58 -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 2313716A4CE for ; Tue, 9 Dec 2003 11:21:58 -0800 (PST) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0EB0443D2E for ; Tue, 9 Dec 2003 11:21:57 -0800 (PST) (envelope-from sam@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.9/8.12.9) with ESMTP id hB9JLuXJ016623 for ; Tue, 9 Dec 2003 11:21:56 -0800 (PST) (envelope-from sam@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.9/8.12.9/Submit) id hB9JLu1B016620 for perforce@freebsd.org; Tue, 9 Dec 2003 11:21:56 -0800 (PST) (envelope-from sam@freebsd.org) Date: Tue, 9 Dec 2003 11:21:56 -0800 (PST) Message-Id: <200312091921.hB9JLu1B016620@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 43690 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, 09 Dec 2003 19:21:58 -0000 http://perforce.freebsd.org/chv.cgi?CH=43690 Change 43690 by sam@sam_ebb on 2003/12/09 11:21:53 remove Giant bandaids not needed with socket locking Affected files ... .. //depot/projects/netperf+sockets/sys/netinet/ip_divert.c#3 edit .. //depot/projects/netperf+sockets/sys/netinet/ip_dummynet.c#4 edit .. //depot/projects/netperf+sockets/sys/netinet/ip_input.c#3 edit .. //depot/projects/netperf+sockets/sys/netinet/ip_mroute.c#3 edit Differences ... ==== //depot/projects/netperf+sockets/sys/netinet/ip_divert.c#3 (text+ko) ==== @@ -223,20 +223,6 @@ sizeof(divsrc.sin_zero)); } - /* - * XXX sbappendaddr must be protected by Giant until - * we have locking at the socket layer. When entered - * from below we come in w/o Giant and must take it - * here. Unfortunately we cannot tell whether we're - * entering from above (already holding Giant), - * below (potentially without Giant), or otherwise - * (e.g. from tcp_syncache through a timeout) so we - * have to grab it regardless. This causes a LOR with - * the tcp lock, at least, and possibly others. For - * the moment we're ignoring this. Once sockets are - * locked this cruft can be removed. - */ - mtx_lock(&Giant); /* Put packet on socket queue, if any */ sa = NULL; nport = htons((u_int16_t)divert_info(mtag)); @@ -258,7 +244,6 @@ INP_UNLOCK(inp); } INP_INFO_RUNLOCK(&divcbinfo); - mtx_unlock(&Giant); if (sa == NULL) { m_freem(m); ipstat.ips_noproto++; ==== //depot/projects/netperf+sockets/sys/netinet/ip_dummynet.c#4 (text+ko) ==== ==== //depot/projects/netperf+sockets/sys/netinet/ip_input.c#3 (text+ko) ==== @@ -925,21 +925,18 @@ * Switch out to protocol's input routine. */ ipstat.ips_delivered++; - NET_PICKUP_GIANT(); if (args.next_hop && ip->ip_p == IPPROTO_TCP) { /* attach next hop info for TCP */ mtag = m_tag_get(PACKET_TAG_IPFORWARD, sizeof(struct sockaddr_in *), M_NOWAIT); if (mtag == NULL) { /* XXX statistic */ - NET_DROP_GIANT(); goto bad; } *(struct sockaddr_in **)(mtag+1) = args.next_hop; m_tag_prepend(m, mtag); } (*inetsw[ip_protox[ip->ip_p]].pr_input)(m, hlen); - NET_DROP_GIANT(); return; bad: m_freem(m); ==== //depot/projects/netperf+sockets/sys/netinet/ip_mroute.c#3 (text+ko) ==== @@ -1289,13 +1289,10 @@ socket_send(struct socket *s, struct mbuf *mm, struct sockaddr_in *src) { if (s) { - mtx_lock(&Giant); /* XXX until sockets are locked */ if (sbappendaddr(&s->so_rcv, (struct sockaddr *)src, mm, NULL) != 0) { sorwakeup(s); - mtx_unlock(&Giant); return 0; } - mtx_unlock(&Giant); } m_freem(mm); return -1;