sctp_var.h (169382) | sctp_var.h (171158) |
---|---|
1/*- 2 * Copyright (c) 2001-2007, by 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, by 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 169382 2007-05-08 17:01:12Z rrs $"); | 34__FBSDID("$FreeBSD: head/sys/netinet/sctp_var.h 171158 2007-07-02 19:22:22Z 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 --- 42 unchanged lines hidden (view full) --- 85 (_strmoq) = SCTP_ZONE_GET(sctppcbinfo.ipi_zone_strmoq, struct sctp_stream_queue_pending); \ 86 if ((_strmoq)) { \ 87 SCTP_INCR_STRMOQ_COUNT(); \ 88 } \ 89} 90 91 92#define sctp_free_a_chunk(_stcb, _chk) { \ | 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 --- 42 unchanged lines hidden (view full) --- 85 (_strmoq) = SCTP_ZONE_GET(sctppcbinfo.ipi_zone_strmoq, struct sctp_stream_queue_pending); \ 86 if ((_strmoq)) { \ 87 SCTP_INCR_STRMOQ_COUNT(); \ 88 } \ 89} 90 91 92#define sctp_free_a_chunk(_stcb, _chk) { \ |
93 if ((_chk)->whoTo) { \ 94 sctp_free_remote_addr((_chk)->whoTo); \ 95 (_chk)->whoTo = NULL; \ 96 } \ |
|
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(); \ 97 } else { \ 98 TAILQ_INSERT_TAIL(&(_stcb)->asoc.free_chunks, (_chk), sctp_next); \ 99 (_stcb)->asoc.free_chunk_cnt++; \ 100 atomic_add_int(&sctppcbinfo.ipi_free_chunks, 1); \ 101 } \ 102} 103 104#define sctp_alloc_a_chunk(_stcb, _chk) { \ 105 if (TAILQ_EMPTY(&(_stcb)->asoc.free_chunks)) { \ 106 (_chk) = SCTP_ZONE_GET(sctppcbinfo.ipi_zone_chunk, struct sctp_tmit_chunk); \ 107 if ((_chk)) { \ 108 SCTP_INCR_CHK_COUNT(); \ | 97 if (((_stcb)->asoc.free_chunk_cnt > sctp_asoc_free_resc_limit) || \ 98 (sctppcbinfo.ipi_free_chunks > sctp_system_free_resc_limit)) { \ 99 SCTP_ZONE_FREE(sctppcbinfo.ipi_zone_chunk, (_chk)); \ 100 SCTP_DECR_CHK_COUNT(); \ 101 } else { \ 102 TAILQ_INSERT_TAIL(&(_stcb)->asoc.free_chunks, (_chk), sctp_next); \ 103 (_stcb)->asoc.free_chunk_cnt++; \ 104 atomic_add_int(&sctppcbinfo.ipi_free_chunks, 1); \ 105 } \ 106} 107 108#define sctp_alloc_a_chunk(_stcb, _chk) { \ 109 if (TAILQ_EMPTY(&(_stcb)->asoc.free_chunks)) { \ 110 (_chk) = SCTP_ZONE_GET(sctppcbinfo.ipi_zone_chunk, struct sctp_tmit_chunk); \ 111 if ((_chk)) { \ 112 SCTP_INCR_CHK_COUNT(); \ |
113 (_chk)->whoTo = NULL; \ |
|
109 } \ 110 } else { \ 111 (_chk) = TAILQ_FIRST(&(_stcb)->asoc.free_chunks); \ 112 TAILQ_REMOVE(&(_stcb)->asoc.free_chunks, (_chk), sctp_next); \ 113 atomic_subtract_int(&sctppcbinfo.ipi_free_chunks, 1); \ 114 SCTP_STAT_INCR(sctps_cached_chk); \ 115 (_stcb)->asoc.free_chunk_cnt--; \ 116 } \ --- 197 unchanged lines hidden --- | 114 } \ 115 } else { \ 116 (_chk) = TAILQ_FIRST(&(_stcb)->asoc.free_chunks); \ 117 TAILQ_REMOVE(&(_stcb)->asoc.free_chunks, (_chk), sctp_next); \ 118 atomic_subtract_int(&sctppcbinfo.ipi_free_chunks, 1); \ 119 SCTP_STAT_INCR(sctps_cached_chk); \ 120 (_stcb)->asoc.free_chunk_cnt--; \ 121 } \ --- 197 unchanged lines hidden --- |