PERFORCE change 130671 for review
Kip Macy
kmacy at FreeBSD.org
Tue Dec 11 21:51:29 PST 2007
http://perforce.freebsd.org/chv.cgi?CH=130671
Change 130671 by kmacy at 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 <netinet/tcp_timer.h>
#include <netinet/tcp_var.h>
#include <netinet/tcp_syncache.h>
+#include <netinet/tcp_ofld.h>
#ifdef INET6
#include <netinet6/tcp6_var.h>
#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 <netinet/tcp_debug.h>
#endif
+#include <netinet/tcp_ofld.h>
/*
* 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);
/*
More information about the p4-projects
mailing list