xref: /titanic_50/usr/src/uts/common/io/hxge/hxge_classify.h (revision 3dec9fcdd56adf1b4a563137b4915c8f2d83b881)
1*3dec9fcdSqs148142 /*
2*3dec9fcdSqs148142  * CDDL HEADER START
3*3dec9fcdSqs148142  *
4*3dec9fcdSqs148142  * The contents of this file are subject to the terms of the
5*3dec9fcdSqs148142  * Common Development and Distribution License (the "License").
6*3dec9fcdSqs148142  * You may not use this file except in compliance with the License.
7*3dec9fcdSqs148142  *
8*3dec9fcdSqs148142  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9*3dec9fcdSqs148142  * or http://www.opensolaris.org/os/licensing.
10*3dec9fcdSqs148142  * See the License for the specific language governing permissions
11*3dec9fcdSqs148142  * and limitations under the License.
12*3dec9fcdSqs148142  *
13*3dec9fcdSqs148142  * When distributing Covered Code, include this CDDL HEADER in each
14*3dec9fcdSqs148142  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15*3dec9fcdSqs148142  * If applicable, add the following below this CDDL HEADER, with the
16*3dec9fcdSqs148142  * fields enclosed by brackets "[]" replaced with your own identifying
17*3dec9fcdSqs148142  * information: Portions Copyright [yyyy] [name of copyright owner]
18*3dec9fcdSqs148142  *
19*3dec9fcdSqs148142  * CDDL HEADER END
20*3dec9fcdSqs148142  */
21*3dec9fcdSqs148142 
22*3dec9fcdSqs148142 /*
23*3dec9fcdSqs148142  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
24*3dec9fcdSqs148142  * Use is subject to license terms.
25*3dec9fcdSqs148142  */
26*3dec9fcdSqs148142 
27*3dec9fcdSqs148142 #ifndef _HXGE_CLASSIFY_H
28*3dec9fcdSqs148142 #define	_HXGE_CLASSIFY_H
29*3dec9fcdSqs148142 
30*3dec9fcdSqs148142 #pragma ident	"%Z%%M%	%I%	%E% SMI"
31*3dec9fcdSqs148142 
32*3dec9fcdSqs148142 #ifdef __cplusplus
33*3dec9fcdSqs148142 extern "C" {
34*3dec9fcdSqs148142 #endif
35*3dec9fcdSqs148142 
36*3dec9fcdSqs148142 #include <hxge_pfc.h>
37*3dec9fcdSqs148142 #include <hxge_pfc_hw.h>
38*3dec9fcdSqs148142 #include <hpi_pfc.h>
39*3dec9fcdSqs148142 
40*3dec9fcdSqs148142 
41*3dec9fcdSqs148142 /*
42*3dec9fcdSqs148142  * The following are the user configurable ether types. Refer to
43*3dec9fcdSqs148142  * /usr/include/sys/ethernet.h
44*3dec9fcdSqs148142  *
45*3dec9fcdSqs148142  * ETHERTYPE_PUP	(0x0200)
46*3dec9fcdSqs148142  * ETHERTYPE_802_MIN	(0x0600)
47*3dec9fcdSqs148142  * ETHERTYPE_IP		(0x0800)
48*3dec9fcdSqs148142  * ETHERTYPE_ARP	(0x0806)
49*3dec9fcdSqs148142  * ETHERTYPE_REVARP	(0x8035)
50*3dec9fcdSqs148142  * ETHERTYPE_AT		(0x809b)
51*3dec9fcdSqs148142  * ETHERTYPE_AARP	(0x80f3)
52*3dec9fcdSqs148142  * ETHERTYPE_IPV6	(0x86dd)
53*3dec9fcdSqs148142  * ETHERTYPE_SLOW	(0x8809)
54*3dec9fcdSqs148142  * ETHERTYPE_PPPOED	(0x8863)
55*3dec9fcdSqs148142  * ETHERTYPE_PPPOES	(0x8864)
56*3dec9fcdSqs148142  * ETHERTYPE_MAX	(0xffff)
57*3dec9fcdSqs148142  */
58*3dec9fcdSqs148142 
59*3dec9fcdSqs148142 /*
60*3dec9fcdSqs148142  * Used for ip class tcam key config
61*3dec9fcdSqs148142  */
62*3dec9fcdSqs148142 #define	HXGE_CLASS_TCAM_LOOKUP		0x10000
63*3dec9fcdSqs148142 #define	HXGE_CLASS_DISCARD		0x20000
64*3dec9fcdSqs148142 #define	HXGE_CLASS_VALID		0x40000
65*3dec9fcdSqs148142 #define	HXGE_CLASS_ETHER_TYPE_MASK	0x0FFFF
66*3dec9fcdSqs148142 
67*3dec9fcdSqs148142 typedef struct _tcam_flow_spec {
68*3dec9fcdSqs148142 	hxge_tcam_entry_t tce;
69*3dec9fcdSqs148142 	uint64_t flags;
70*3dec9fcdSqs148142 	uint64_t user_info;
71*3dec9fcdSqs148142 } tcam_flow_spec_t, *p_tcam_flow_spec_t;
72*3dec9fcdSqs148142 
73*3dec9fcdSqs148142 typedef struct {
74*3dec9fcdSqs148142 	uint16_t	ether_type;
75*3dec9fcdSqs148142 	int		count;	/* How many TCAM entries using this class. */
76*3dec9fcdSqs148142 } hxge_class_usage_t;
77*3dec9fcdSqs148142 
78*3dec9fcdSqs148142 #define	HXGE_PFC_HW_RESET	0x1
79*3dec9fcdSqs148142 #define	HXGE_PFC_HW_INIT	0x2
80*3dec9fcdSqs148142 #define	HXGE_PFC_SW_INIT	0x4
81*3dec9fcdSqs148142 
82*3dec9fcdSqs148142 typedef struct _hxge_classify {
83*3dec9fcdSqs148142 	uint32_t 		tcam_size;
84*3dec9fcdSqs148142 	uint32_t		n_used;
85*3dec9fcdSqs148142 	uint32_t 		state;
86*3dec9fcdSqs148142 	p_hxge_pfc_stats_t	pfc_stats;
87*3dec9fcdSqs148142 
88*3dec9fcdSqs148142 	tcam_flow_spec_t	*tcam_entries;
89*3dec9fcdSqs148142 	uint8_t			tcam_location;
90*3dec9fcdSqs148142 	hxge_class_usage_t	class_usage[TCAM_CLASS_MAX];
91*3dec9fcdSqs148142 } hxge_classify_t, *p_hxge_classify_t;
92*3dec9fcdSqs148142 
93*3dec9fcdSqs148142 #ifdef	__cplusplus
94*3dec9fcdSqs148142 }
95*3dec9fcdSqs148142 #endif
96*3dec9fcdSqs148142 
97*3dec9fcdSqs148142 #endif	/* _HXGE_CLASSIFY_H */
98