xref: /illumos-gate/usr/src/uts/intel/io/vmxnet3s/upt1_defs.h (revision 2a6e99a0f1f7d22c0396e8b2ce9b9babbd1056cf)
1 /*
2  * Copyright (C) 2007 VMware, Inc. All rights reserved.
3  *
4  * The contents of this file are subject to the terms of the Common
5  * Development and Distribution License (the "License") version 1.0
6  * and no later version.  You may not use this file except in
7  * compliance with the License.
8  *
9  * You can obtain a copy of the License at
10  *         http://www.opensource.org/licenses/cddl1.php
11  *
12  * See the License for the specific language governing permissions
13  * and limitations under the License.
14  */
15 
16 /*
17  * upt1_defs.h
18  *
19  *      Definitions for UPTv1
20  *
21  *      Some of the defs are duplicated in vmkapi_net_upt.h, because
22  *      vmkapi_net_upt.h cannot distribute with OSS yet and vmkapi headers can
23  *      only include vmkapi headers. Make sure they are kept in sync!
24  */
25 
26 #ifndef _UPT1_DEFS_H_
27 #define	_UPT1_DEFS_H_
28 
29 #define	UPT1_MAX_TX_QUEUES	64
30 #define	UPT1_MAX_RX_QUEUES	64
31 
32 #define	UPT1_MAX_INTRS (UPT1_MAX_TX_QUEUES + UPT1_MAX_RX_QUEUES)
33 
34 #pragma pack(1)
35 typedef struct UPT1_TxStats {
36 	uint64_t	TSOPktsTxOK;  /* TSO pkts post-segmentation */
37 	uint64_t	TSOBytesTxOK;
38 	uint64_t	ucastPktsTxOK;
39 	uint64_t	ucastBytesTxOK;
40 	uint64_t	mcastPktsTxOK;
41 	uint64_t	mcastBytesTxOK;
42 	uint64_t	bcastPktsTxOK;
43 	uint64_t	bcastBytesTxOK;
44 	uint64_t	pktsTxError;
45 	uint64_t	pktsTxDiscard;
46 } UPT1_TxStats;
47 #pragma pack()
48 
49 #pragma pack(1)
50 typedef struct UPT1_RxStats {
51 	uint64_t	LROPktsRxOK;	/* LRO pkts */
52 	uint64_t	LROBytesRxOK;	/* bytes from LRO pkts */
53 	/* the following counters are for pkts from the wire, i.e., pre-LRO */
54 	uint64_t	ucastPktsRxOK;
55 	uint64_t	ucastBytesRxOK;
56 	uint64_t	mcastPktsRxOK;
57 	uint64_t	mcastBytesRxOK;
58 	uint64_t	bcastPktsRxOK;
59 	uint64_t	bcastBytesRxOK;
60 	uint64_t	pktsRxOutOfBuf;
61 	uint64_t	pktsRxError;
62 } UPT1_RxStats;
63 #pragma pack()
64 
65 /* interrupt moderation level */
66 #define	UPT1_IML_NONE		0 /* no interrupt moderation */
67 #define	UPT1_IML_HIGHEST	7 /* least intr generated */
68 #define	UPT1_IML_ADAPTIVE	8 /* adpative intr moderation */
69 
70 /* values for UPT1_RSSConf.hashFunc */
71 #define	UPT1_RSS_HASH_TYPE_NONE		0x0
72 #define	UPT1_RSS_HASH_TYPE_IPV4		0x01
73 #define	UPT1_RSS_HASH_TYPE_TCP_IPV4	0x02
74 #define	UPT1_RSS_HASH_TYPE_IPV6		0x04
75 #define	UPT1_RSS_HASH_TYPE_TCP_IPV6	0x08
76 
77 #define	UPT1_RSS_HASH_FUNC_NONE		0x0
78 #define	UPT1_RSS_HASH_FUNC_TOEPLITZ	0x01
79 
80 #define	UPT1_RSS_MAX_KEY_SIZE		40
81 #define	UPT1_RSS_MAX_IND_TABLE_SIZE	128
82 
83 #pragma pack(1)
84 typedef struct UPT1_RSSConf {
85 	uint16_t	hashType;
86 	uint16_t	hashFunc;
87 	uint16_t	hashKeySize;
88 	uint16_t	indTableSize;
89 	uint8_t		hashKey[UPT1_RSS_MAX_KEY_SIZE];
90 	uint8_t		indTable[UPT1_RSS_MAX_IND_TABLE_SIZE];
91 } UPT1_RSSConf;
92 #pragma pack()
93 
94 /* features */
95 #define	UPT1_F_RXCSUM	0x0001	/* rx csum verification */
96 #define	UPT1_F_RSS	0x0002
97 #define	UPT1_F_RXVLAN	0x0004	/* VLAN tag stripping */
98 #define	UPT1_F_LRO	0x0008
99 
100 #endif	/* _UPT1_DEFS_H_ */
101