PERFORCE change 43690 for review
Sam Leffler
sam at FreeBSD.org
Tue Dec 9 11:21:58 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=43690
Change 43690 by sam at 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;
More information about the p4-projects
mailing list