tcp_sack.c (178285) | tcp_sack.c (181803) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995 3 * The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 57 unchanged lines hidden (view full) --- 66 * 67 * The views and conclusions contained in the software and documentation 68 * are those of the authors and should not be interpreted as representing 69 * official policies, either expressed or implied, of the US Naval 70 * Research Laboratory (NRL). 71 */ 72 73#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1982, 1986, 1988, 1990, 1993, 1994, 1995 3 * The Regents of the University of California. 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 57 unchanged lines hidden (view full) --- 66 * 67 * The views and conclusions contained in the software and documentation 68 * are those of the authors and should not be interpreted as representing 69 * official policies, either expressed or implied, of the US Naval 70 * Research Laboratory (NRL). 71 */ 72 73#include <sys/cdefs.h> |
74__FBSDID("$FreeBSD: head/sys/netinet/tcp_sack.c 178285 2008-04-17 21:38:18Z rwatson $"); | 74__FBSDID("$FreeBSD: head/sys/netinet/tcp_sack.c 181803 2008-08-17 23:27:27Z bz $"); |
75 76#include "opt_inet.h" 77#include "opt_inet6.h" 78#include "opt_tcpdebug.h" 79 80#include <sys/param.h> 81#include <sys/systm.h> 82#include <sys/kernel.h> 83#include <sys/sysctl.h> 84#include <sys/malloc.h> 85#include <sys/mbuf.h> 86#include <sys/proc.h> /* for proc0 declaration */ 87#include <sys/protosw.h> 88#include <sys/socket.h> 89#include <sys/socketvar.h> 90#include <sys/syslog.h> 91#include <sys/systm.h> | 75 76#include "opt_inet.h" 77#include "opt_inet6.h" 78#include "opt_tcpdebug.h" 79 80#include <sys/param.h> 81#include <sys/systm.h> 82#include <sys/kernel.h> 83#include <sys/sysctl.h> 84#include <sys/malloc.h> 85#include <sys/mbuf.h> 86#include <sys/proc.h> /* for proc0 declaration */ 87#include <sys/protosw.h> 88#include <sys/socket.h> 89#include <sys/socketvar.h> 90#include <sys/syslog.h> 91#include <sys/systm.h> |
92#include <sys/vimage.h> |
|
92 93#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */ 94 95#include <vm/uma.h> 96 97#include <net/if.h> 98#include <net/route.h> 99 --- 149 unchanged lines hidden (view full) --- 249/* 250 * Allocate struct sackhole. 251 */ 252static struct sackhole * 253tcp_sackhole_alloc(struct tcpcb *tp, tcp_seq start, tcp_seq end) 254{ 255 struct sackhole *hole; 256 | 93 94#include <machine/cpu.h> /* before tcp_seq.h, for tcp_random18() */ 95 96#include <vm/uma.h> 97 98#include <net/if.h> 99#include <net/route.h> 100 --- 149 unchanged lines hidden (view full) --- 250/* 251 * Allocate struct sackhole. 252 */ 253static struct sackhole * 254tcp_sackhole_alloc(struct tcpcb *tp, tcp_seq start, tcp_seq end) 255{ 256 struct sackhole *hole; 257 |
257 if (tp->snd_numholes >= tcp_sack_maxholes || 258 tcp_sack_globalholes >= tcp_sack_globalmaxholes) { 259 tcpstat.tcps_sack_sboverflow++; | 258 if (tp->snd_numholes >= V_tcp_sack_maxholes || 259 V_tcp_sack_globalholes >= V_tcp_sack_globalmaxholes) { 260 V_tcpstat.tcps_sack_sboverflow++; |
260 return NULL; 261 } 262 263 hole = (struct sackhole *)uma_zalloc(sack_hole_zone, M_NOWAIT); 264 if (hole == NULL) 265 return NULL; 266 267 hole->start = start; 268 hole->end = end; 269 hole->rxmit = start; 270 271 tp->snd_numholes++; | 261 return NULL; 262 } 263 264 hole = (struct sackhole *)uma_zalloc(sack_hole_zone, M_NOWAIT); 265 if (hole == NULL) 266 return NULL; 267 268 hole->start = start; 269 hole->end = end; 270 hole->rxmit = start; 271 272 tp->snd_numholes++; |
272 tcp_sack_globalholes++; | 273 V_tcp_sack_globalholes++; |
273 274 return hole; 275} 276 277/* 278 * Free struct sackhole. 279 */ 280static void 281tcp_sackhole_free(struct tcpcb *tp, struct sackhole *hole) 282{ 283 284 uma_zfree(sack_hole_zone, hole); 285 286 tp->snd_numholes--; | 274 275 return hole; 276} 277 278/* 279 * Free struct sackhole. 280 */ 281static void 282tcp_sackhole_free(struct tcpcb *tp, struct sackhole *hole) 283{ 284 285 uma_zfree(sack_hole_zone, hole); 286 287 tp->snd_numholes--; |
287 tcp_sack_globalholes--; | 288 V_tcp_sack_globalholes--; |
288 289 KASSERT(tp->snd_numholes >= 0, ("tp->snd_numholes >= 0")); | 289 290 KASSERT(tp->snd_numholes >= 0, ("tp->snd_numholes >= 0")); |
290 KASSERT(tcp_sack_globalholes >= 0, ("tcp_sack_globalholes >= 0")); | 291 KASSERT(V_tcp_sack_globalholes >= 0, ("tcp_sack_globalholes >= 0")); |
291} 292 293/* 294 * Insert new SACK hole into scoreboard. 295 */ 296static struct sackhole * 297tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, 298 struct sackhole *after) --- 383 unchanged lines hidden --- | 292} 293 294/* 295 * Insert new SACK hole into scoreboard. 296 */ 297static struct sackhole * 298tcp_sackhole_insert(struct tcpcb *tp, tcp_seq start, tcp_seq end, 299 struct sackhole *after) --- 383 unchanged lines hidden --- |