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