xref: /trueos/sys/dev/hatm/if_hatmconf.h (revision 4b319958e7f00cc908274c4518b7a9c5ed821812)
1 /*-
2  * Copyright (c) 2001-2003
3  *	Fraunhofer Institute for Open Communication Systems (FhG Fokus).
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:
9  * 1. Redistributions of source code must retain the above copyright
10  *    notice, this list of conditions and the following disclaimer.
11  * 2. Redistributions in binary form must reproduce the above copyright
12  *    notice, this list of conditions and the following disclaimer in the
13  *    documentation and/or other materials provided with the distribution.
14  *
15  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25  * SUCH DAMAGE.
26  *
27  * Author: Hartmut Brandt <harti@freebsd.org>
28  *
29  * $FreeBSD$
30  *
31  * Default configuration
32  */
33 
34 /* configuration */
35 #define HE_CONFIG_VPI_BITS	2
36 #define HE_CONFIG_VCI_BITS	10
37 
38 /* interrupt group 0 only */
39 /* the size must be 1 <= size <= 1023 */
40 #define HE_CONFIG_IRQ0_SIZE	256
41 #define HE_CONFIG_IRQ0_THRESH	224		/* retrigger interrupt */
42 #define HE_CONFIG_IRQ0_LINE	HE_REGM_IRQ_A	/* routing */
43 
44 /* don't change these */
45 #define HE_CONFIG_TXMEM		(128 * 1024)	/* words */
46 #define HE_CONFIG_RXMEM		(64 * 1024)	/* words */
47 #define HE_CONFIG_LCMEM		(512 * 1024)	/* words */
48 
49 /* group 0 - all AALs except AAL.raw */
50 /* receive group 0 buffer pools (mbufs and mbufs+cluster) */
51 /* the size must be a power of 2: 4 <= size <= 8192 */
52 #define HE_CONFIG_RBPS0_SIZE	2048	/* entries per queue */
53 #define HE_CONFIG_RBPS0_THRESH	256	/* interrupt threshold */
54 #define HE_CONFIG_RBPL0_SIZE	512	/* entries per queue */
55 #define HE_CONFIG_RBPL0_THRESH	32	/* interrupt threshold */
56 
57 /* receive group 0 buffer return queue */
58 /* the size must be a power of 2: 1 <= size <= 16384 */
59 #define HE_CONFIG_RBRQ0_SIZE	512	/* entries in queue */
60 #define HE_CONFIG_RBRQ0_THRESH	256	/* interrupt threshold */
61 #define HE_CONFIG_RBRQ0_TOUT	10	/* interrupt timeout */
62 #define HE_CONFIG_RBRQ0_PCNT	5	/* packet count threshold */
63 
64 /* group 1 - raw cells */
65 /* receive group 1 small buffer pool */
66 /* the size must be a power of 2: 4 <= size <= 8192 */
67 #define HE_CONFIG_RBPS1_SIZE	1024	/* entries in queue */
68 #define HE_CONFIG_RBPS1_THRESH	512	/* interrupt threshold */
69 
70 /* receive group 1 buffer return queue */
71 /* the size must be a power of 2: 1 <= size <= 16384 */
72 #define HE_CONFIG_RBRQ1_SIZE	512	/* entries in queue */
73 #define HE_CONFIG_RBRQ1_THRESH	256	/* interrupt threshold */
74 #define HE_CONFIG_RBRQ1_TOUT	100	/* interrupt timeout */
75 #define HE_CONFIG_RBRQ1_PCNT	25	/* packet count threshold */
76 
77 /* there is only one TPD queue */
78 /* the size must be a power of 2: 1 <= size <= 4096 */
79 #define HE_CONFIG_TPDRQ_SIZE	2048	/* entries in queue */
80 
81 /* transmit group 0 */
82 /* the size must be a power of 2: 1 <= size <= 16384 */
83 #define HE_CONFIG_TBRQ_SIZE	512	/* entries in queue */
84 #define HE_CONFIG_TBRQ_THRESH	400	/* interrupt threshold */
85 
86 /* Maximum number of TPDs to allocate to a single VCC. This
87  * number should depend on the cell rate and the maximum allowed cell delay */
88 #define HE_CONFIG_TPD_MAXCC	2048
89 
90 /* Maximum number of external mbuf pages */
91 #define HE_CONFIG_MAX_MBUF_PAGES	256
92 
93 /* Maximum number of TPDs used for one packet */
94 #define HE_CONFIG_MAX_TPD_PER_PACKET			\
95 	((((HE_MAX_PDU + MCLBYTES - 1) / MCLBYTES + 2) / 3) + 2)
96 
97 /* Number of TPDs to reserve for close operations */
98 #define HE_CONFIG_TPD_RESERVE	32
99 
100 /* Number of TPDs per VCC when to re-enable flow control */
101 #define HE_CONFIG_TPD_FLOW_ENB	80
102 
103 /* MCR for flushing CBR and ABR connections at close */
104 #define HE_CONFIG_FLUSH_RATE	200000
105