diff options
author | Kacheong Poon <Kacheong.Poon@Sun.COM> | 2010-04-01 10:24:19 -0700 |
---|---|---|
committer | Kacheong Poon <Kacheong.Poon@Sun.COM> | 2010-04-01 10:24:19 -0700 |
commit | 66cd0f60c3182913d379abb730ae755bf6367126 (patch) | |
tree | cbdacc4e58656d42e7d3416641c7988a743eb17b /usr/src/uts/common/inet/tcp/tcp_sack.c | |
parent | f32a9dd17a38682f8ac7fe31d66bdfaa0e68748d (diff) | |
download | illumos-joyent-66cd0f60c3182913d379abb730ae755bf6367126.tar.gz |
6935348 tcp_sack_info should always be there
6924317 TCP time wait processing is called unnecessarily
6924089 TCP Timer code does double time conversion
Diffstat (limited to 'usr/src/uts/common/inet/tcp/tcp_sack.c')
-rw-r--r-- | usr/src/uts/common/inet/tcp/tcp_sack.c | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/usr/src/uts/common/inet/tcp/tcp_sack.c b/usr/src/uts/common/inet/tcp/tcp_sack.c index f3e9f81859..c4f7822e85 100644 --- a/usr/src/uts/common/inet/tcp/tcp_sack.c +++ b/usr/src/uts/common/inet/tcp/tcp_sack.c @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,12 +19,9 @@ * CDDL HEADER END */ /* - * Copyright 1997-2001, 2003 Sun Microsystems, Inc. All rights reserved. - * Use is subject to license terms. + * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. */ -#pragma ident "%Z%%M% %I% %E% SMI" - #include <sys/types.h> #include <sys/kmem.h> #include <sys/debug.h> @@ -38,6 +34,9 @@ #include <inet/ip.h> #include <inet/tcp.h> +/* kmem cache for notsack_blk_t */ +kmem_cache_t *tcp_notsack_blk_cache; + /* * To insert a new blk to the array of SACK blk in receiver. * @@ -239,7 +238,7 @@ tcp_notsack_insert(notsack_blk_t **head, tcp_seq begin, tcp_seq end, } (*num)--; *sum -= tmp->end - tmp->begin; - kmem_free(tmp, sizeof (notsack_blk_t)); + kmem_cache_free(tcp_notsack_blk_cache, tmp); return; } /* This blk is partially covered. */ @@ -254,8 +253,9 @@ tcp_notsack_insert(notsack_blk_t **head, tcp_seq begin, tcp_seq end, (tmp->sack_cnt)++; } else { /* Split the notsack blk. */ - if ((new = kmem_alloc(sizeof (notsack_blk_t), - KM_NOSLEEP)) == NULL) { + if ((new = kmem_cache_alloc( + tcp_notsack_blk_cache, KM_NOSLEEP)) == + NULL) { return; } new->end = tmp->end; @@ -297,11 +297,13 @@ tcp_notsack_insert(notsack_blk_t **head, tcp_seq begin, tcp_seq end, tmp_sum -= tmp->end - tmp->begin; if (prev != NULL) { prev->next = tmp->next; - kmem_free(tmp, sizeof (notsack_blk_t)); + kmem_cache_free(tcp_notsack_blk_cache, + tmp); tmp = prev->next; } else { *head = tmp->next; - kmem_free(tmp, sizeof (notsack_blk_t)); + kmem_cache_free(tcp_notsack_blk_cache, + tmp); tmp = *head; } } else { @@ -355,11 +357,11 @@ tcp_notsack_remove(notsack_blk_t **head, tcp_seq end, int32_t *num, tmp_sum -= tmp->end - tmp->begin; if (prev == NULL) { *head = tmp->next; - kmem_free(tmp, sizeof (notsack_blk_t)); + kmem_cache_free(tcp_notsack_blk_cache, tmp); tmp = *head; } else { prev->next = tmp->next; - kmem_free(tmp, sizeof (notsack_blk_t)); + kmem_cache_free(tcp_notsack_blk_cache, tmp); tmp = prev->next; } } else { @@ -394,8 +396,8 @@ void tcp_notsack_update(notsack_blk_t **head, tcp_seq begin, tcp_seq end, tmp = *head; /* If the list is empty, create a new one. */ if (tmp == NULL) { - if ((tmp = kmem_alloc(sizeof (notsack_blk_t), KM_NOSLEEP)) == - NULL) { + if ((tmp = kmem_cache_alloc(tcp_notsack_blk_cache, + KM_NOSLEEP)) == NULL) { return; } tmp->begin = begin; @@ -423,7 +425,7 @@ void tcp_notsack_update(notsack_blk_t **head, tcp_seq begin, tcp_seq end, tmp->end = end; } else { /* No. Need to create a new notsack blk. */ - tmp->next = kmem_alloc(sizeof (notsack_blk_t), KM_NOSLEEP); + tmp->next = kmem_cache_alloc(tcp_notsack_blk_cache, KM_NOSLEEP); if (tmp->next != NULL) { tmp = tmp->next; tmp->begin = begin; |