sctp_var.h (168755) | sctp_var.h (168859) |
---|---|
1/*- 2 * Copyright (c) 2001-2007, Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. --- 17 unchanged lines hidden (view full) --- 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31/* $KAME: sctp_var.h,v 1.24 2005/03/06 16:04:19 itojun Exp $ */ 32 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2001-2007, Cisco Systems, Inc. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are met: 6 * 7 * a) Redistributions of source code must retain the above copyright notice, 8 * this list of conditions and the following disclaimer. --- 17 unchanged lines hidden (view full) --- 26 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 28 * THE POSSIBILITY OF SUCH DAMAGE. 29 */ 30 31/* $KAME: sctp_var.h,v 1.24 2005/03/06 16:04:19 itojun Exp $ */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/netinet/sctp_var.h 168755 2007-04-15 11:58:26Z rrs $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_var.h 168859 2007-04-19 11:28:43Z rrs $"); |
35 36#ifndef _NETINET_SCTP_VAR_H_ 37#define _NETINET_SCTP_VAR_H_ 38 39#include <netinet/sctp_uio.h> 40 41#if defined(_KERNEL) 42 --- 29 unchanged lines hidden (view full) --- 72#define sctp_alloc_a_readq(_stcb, _readq) { \ 73 (_readq) = SCTP_ZONE_GET(sctppcbinfo.ipi_zone_readq, struct sctp_queued_to_read); \ 74 if ((_readq)) { \ 75 SCTP_INCR_READQ_COUNT(); \ 76 } \ 77} 78 79#define sctp_free_a_strmoq(_stcb, _strmoq) { \ | 35 36#ifndef _NETINET_SCTP_VAR_H_ 37#define _NETINET_SCTP_VAR_H_ 38 39#include <netinet/sctp_uio.h> 40 41#if defined(_KERNEL) 42 --- 29 unchanged lines hidden (view full) --- 72#define sctp_alloc_a_readq(_stcb, _readq) { \ 73 (_readq) = SCTP_ZONE_GET(sctppcbinfo.ipi_zone_readq, struct sctp_queued_to_read); \ 74 if ((_readq)) { \ 75 SCTP_INCR_READQ_COUNT(); \ 76 } \ 77} 78 79#define sctp_free_a_strmoq(_stcb, _strmoq) { \ |
80 if (((_stcb)->asoc.free_strmoq_cnt > sctp_asoc_free_resc_limit) || \ 81 (sctppcbinfo.ipi_free_strmoq > sctp_system_free_resc_limit)) { \ 82 SCTP_ZONE_FREE(sctppcbinfo.ipi_zone_strmoq, (_strmoq)); \ 83 SCTP_DECR_STRMOQ_COUNT(); \ 84 } else { \ 85 TAILQ_INSERT_TAIL(&(_stcb)->asoc.free_strmoq, (_strmoq), next); \ 86 (_stcb)->asoc.free_strmoq_cnt++; \ 87 atomic_add_int(&sctppcbinfo.ipi_free_strmoq, 1); \ 88 } \ | 80 SCTP_ZONE_FREE(sctppcbinfo.ipi_zone_strmoq, (_strmoq)); \ 81 SCTP_DECR_STRMOQ_COUNT(); \ |
89} 90 91#define sctp_alloc_a_strmoq(_stcb, _strmoq) { \ | 82} 83 84#define sctp_alloc_a_strmoq(_stcb, _strmoq) { \ |
92 if (TAILQ_EMPTY(&(_stcb)->asoc.free_strmoq)) { \ 93 (_strmoq) = SCTP_ZONE_GET(sctppcbinfo.ipi_zone_strmoq, struct sctp_stream_queue_pending); \ 94 if ((_strmoq)) { \ 95 SCTP_INCR_STRMOQ_COUNT(); \ 96 } \ 97 } else { \ 98 (_strmoq) = TAILQ_FIRST(&(_stcb)->asoc.free_strmoq); \ 99 TAILQ_REMOVE(&(_stcb)->asoc.free_strmoq, (_strmoq), next); \ 100 atomic_subtract_int(&sctppcbinfo.ipi_free_strmoq, 1); \ 101 SCTP_STAT_INCR(sctps_cached_strmoq); \ 102 (_stcb)->asoc.free_strmoq_cnt--; \ 103 } \ | 85 (_strmoq) = SCTP_ZONE_GET(sctppcbinfo.ipi_zone_strmoq, struct sctp_stream_queue_pending); \ 86 if ((_strmoq)) { \ 87 SCTP_INCR_STRMOQ_COUNT(); \ 88 } \ |
104} 105 106 107#define sctp_free_a_chunk(_stcb, _chk) { \ 108 if (((_stcb)->asoc.free_chunk_cnt > sctp_asoc_free_resc_limit) || \ 109 (sctppcbinfo.ipi_free_chunks > sctp_system_free_resc_limit)) { \ 110 SCTP_ZONE_FREE(sctppcbinfo.ipi_zone_chunk, (_chk)); \ 111 SCTP_DECR_CHK_COUNT(); \ --- 220 unchanged lines hidden --- | 89} 90 91 92#define sctp_free_a_chunk(_stcb, _chk) { \ 93 if (((_stcb)->asoc.free_chunk_cnt > sctp_asoc_free_resc_limit) || \ 94 (sctppcbinfo.ipi_free_chunks > sctp_system_free_resc_limit)) { \ 95 SCTP_ZONE_FREE(sctppcbinfo.ipi_zone_chunk, (_chk)); \ 96 SCTP_DECR_CHK_COUNT(); \ --- 220 unchanged lines hidden --- |