tcp_offload.c (180674) | tcp_offload.c (181803) |
---|---|
1/*- 2 * Copyright (c) 2007, Chelsio Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, --- 12 unchanged lines hidden (view full) --- 21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2007, Chelsio Inc. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright notice, --- 12 unchanged lines hidden (view full) --- 21 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * POSSIBILITY OF SUCH DAMAGE. 26 */ 27 28#include <sys/cdefs.h> |
29__FBSDID("$FreeBSD: head/sys/netinet/tcp_offload.c 180674 2008-07-21 21:22:56Z kmacy $"); | 29__FBSDID("$FreeBSD: head/sys/netinet/tcp_offload.c 181803 2008-08-17 23:27:27Z bz $"); |
30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/types.h> 34#include <sys/malloc.h> 35#include <sys/kernel.h> 36#include <sys/sysctl.h> 37#include <sys/mbuf.h> 38#include <sys/socket.h> 39#include <sys/socketvar.h> | 30 31#include <sys/param.h> 32#include <sys/systm.h> 33#include <sys/types.h> 34#include <sys/malloc.h> 35#include <sys/kernel.h> 36#include <sys/sysctl.h> 37#include <sys/mbuf.h> 38#include <sys/socket.h> 39#include <sys/socketvar.h> |
40#include <sys/vimage.h> |
|
40 41#include <net/if.h> 42#include <net/if_types.h> 43#include <net/if_var.h> 44 45#include <netinet/in.h> 46#include <netinet/in_systm.h> 47#include <netinet/in_pcb.h> --- 49 unchanged lines hidden (view full) --- 97 * This file contains code as a short-term staging area before it is moved in 98 * to sys/netinet/tcp_offload.c 99 */ 100 101void 102tcp_offload_twstart(struct tcpcb *tp) 103{ 104 | 41 42#include <net/if.h> 43#include <net/if_types.h> 44#include <net/if_var.h> 45 46#include <netinet/in.h> 47#include <netinet/in_systm.h> 48#include <netinet/in_pcb.h> --- 49 unchanged lines hidden (view full) --- 98 * This file contains code as a short-term staging area before it is moved in 99 * to sys/netinet/tcp_offload.c 100 */ 101 102void 103tcp_offload_twstart(struct tcpcb *tp) 104{ 105 |
105 INP_INFO_WLOCK(&tcbinfo); | 106 INP_INFO_WLOCK(&V_tcbinfo); |
106 INP_WLOCK(tp->t_inpcb); 107 tcp_twstart(tp); | 107 INP_WLOCK(tp->t_inpcb); 108 tcp_twstart(tp); |
108 INP_INFO_WUNLOCK(&tcbinfo); | 109 INP_INFO_WUNLOCK(&V_tcbinfo); |
109} 110 111struct tcpcb * 112tcp_offload_close(struct tcpcb *tp) 113{ 114 | 110} 111 112struct tcpcb * 113tcp_offload_close(struct tcpcb *tp) 114{ 115 |
115 INP_INFO_WLOCK(&tcbinfo); | 116 INP_INFO_WLOCK(&V_tcbinfo); |
116 INP_WLOCK(tp->t_inpcb); 117 tp = tcp_close(tp); | 117 INP_WLOCK(tp->t_inpcb); 118 tp = tcp_close(tp); |
118 INP_INFO_WUNLOCK(&tcbinfo); | 119 INP_INFO_WUNLOCK(&V_tcbinfo); |
119 if (tp) 120 INP_WUNLOCK(tp->t_inpcb); 121 122 return (tp); 123} 124 125struct tcpcb * 126tcp_offload_drop(struct tcpcb *tp, int error) 127{ 128 | 120 if (tp) 121 INP_WUNLOCK(tp->t_inpcb); 122 123 return (tp); 124} 125 126struct tcpcb * 127tcp_offload_drop(struct tcpcb *tp, int error) 128{ 129 |
129 INP_INFO_WLOCK(&tcbinfo); | 130 INP_INFO_WLOCK(&V_tcbinfo); |
130 INP_WLOCK(tp->t_inpcb); 131 tp = tcp_drop(tp, error); | 131 INP_WLOCK(tp->t_inpcb); 132 tp = tcp_drop(tp, error); |
132 INP_INFO_WUNLOCK(&tcbinfo); | 133 INP_INFO_WUNLOCK(&V_tcbinfo); |
133 if (tp) 134 INP_WUNLOCK(tp->t_inpcb); 135 136 return (tp); 137} 138 | 134 if (tp) 135 INP_WUNLOCK(tp->t_inpcb); 136 137 return (tp); 138} 139 |