Deleted Added
full compact
cxgb_cpl_io.c (190948) cxgb_cpl_io.c (191816)
1/**************************************************************************
2
3Copyright (c) 2007-2008, Chelsio Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

--- 14 unchanged lines hidden (view full) ---

23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
28***************************************************************************/
29
30#include <sys/cdefs.h>
1/**************************************************************************
2
3Copyright (c) 2007-2008, Chelsio Inc.
4All rights reserved.
5
6Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met:
8

--- 14 unchanged lines hidden (view full) ---

23INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26POSSIBILITY OF SUCH DAMAGE.
27
28***************************************************************************/
29
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c 190948 2009-04-11 22:07:19Z rwatson $");
31__FBSDID("$FreeBSD: head/sys/dev/cxgb/ulp/tom/cxgb_cpl_io.c 191816 2009-05-05 10:56:12Z zec $");
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/fcntl.h>
36#include <sys/kernel.h>
37#include <sys/limits.h>
38#include <sys/ktr.h>
39#include <sys/lock.h>

--- 1172 unchanged lines hidden (view full) ---

1212 tp->t_tu = &cxgb_toe_usrreqs;
1213}
1214
1215/*
1216 * Determine the receive window scaling factor given a target max
1217 * receive window.
1218 */
1219static __inline int
32
33#include <sys/param.h>
34#include <sys/systm.h>
35#include <sys/fcntl.h>
36#include <sys/kernel.h>
37#include <sys/limits.h>
38#include <sys/ktr.h>
39#include <sys/lock.h>

--- 1172 unchanged lines hidden (view full) ---

1212 tp->t_tu = &cxgb_toe_usrreqs;
1213}
1214
1215/*
1216 * Determine the receive window scaling factor given a target max
1217 * receive window.
1218 */
1219static __inline int
1220select_rcv_wscale(int space)
1220select_rcv_wscale(int space, struct vnet *vnet)
1221{
1222 INIT_VNET_INET(so->so_vnet);
1223 int wscale = 0;
1224
1225 if (space > MAX_RCV_WND)
1226 space = MAX_RCV_WND;
1227
1228 if (V_tcp_do_rfc1323)

--- 92 unchanged lines hidden (view full) ---

1321
1322/*
1323 * The next two functions calculate the option 0 value for a socket.
1324 */
1325static inline unsigned int
1326calc_opt0h(struct socket *so, int mtu_idx)
1327{
1328 struct tcpcb *tp = so_sototcpcb(so);
1221{
1222 INIT_VNET_INET(so->so_vnet);
1223 int wscale = 0;
1224
1225 if (space > MAX_RCV_WND)
1226 space = MAX_RCV_WND;
1227
1228 if (V_tcp_do_rfc1323)

--- 92 unchanged lines hidden (view full) ---

1321
1322/*
1323 * The next two functions calculate the option 0 value for a socket.
1324 */
1325static inline unsigned int
1326calc_opt0h(struct socket *so, int mtu_idx)
1327{
1328 struct tcpcb *tp = so_sototcpcb(so);
1329 int wscale = select_rcv_wscale(tp->rcv_wnd);
1329 int wscale = select_rcv_wscale(tp->rcv_wnd, so->so_vnet);
1330
1331 return V_NAGLE((tp->t_flags & TF_NODELAY) == 0) |
1332 V_KEEP_ALIVE((so_options_get(so) & SO_KEEPALIVE) != 0) | F_TCAM_BYPASS |
1333 V_WND_SCALE(wscale) | V_MSS_IDX(mtu_idx);
1334}
1335
1336static inline unsigned int
1337calc_opt0l(struct socket *so, int ulp_mode)

--- 3131 unchanged lines hidden ---
1330
1331 return V_NAGLE((tp->t_flags & TF_NODELAY) == 0) |
1332 V_KEEP_ALIVE((so_options_get(so) & SO_KEEPALIVE) != 0) | F_TCAM_BYPASS |
1333 V_WND_SCALE(wscale) | V_MSS_IDX(mtu_idx);
1334}
1335
1336static inline unsigned int
1337calc_opt0l(struct socket *so, int ulp_mode)

--- 3131 unchanged lines hidden ---