remove trailing whitespaces
[dpdk.git] / lib / librte_pmd_vmxnet3 / vmxnet3 / upt1_defs.h
1 /*********************************************************
2  * Copyright (C) 2007 VMware, 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
6  * are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions and the following disclaimer.
10  * 2. Redistributions in binary form must reproduce the above copyright
11  *    notice, this list of conditions and the following disclaimer in the
12  *    documentation and/or other materials provided with the distribution.
13  *
14  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
15  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24  * SUCH DAMAGE.
25  *
26  *********************************************************/
27
28 /* upt1_defs.h
29  *
30  *      Definitions for UPTv1
31  *
32  *      Some of the defs are duplicated in vmkapi_net_upt.h, because
33  *      vmkapi_net_upt.h cannot distribute with OSS yet and vmkapi headers can
34  *      only include vmkapi headers. Make sure they are kept in sync!
35  */
36
37 #ifndef _UPT1_DEFS_H
38 #define _UPT1_DEFS_H
39
40 #define UPT1_MAX_TX_QUEUES  64
41 #define UPT1_MAX_RX_QUEUES  64
42
43 #define UPT1_MAX_INTRS  (UPT1_MAX_TX_QUEUES + UPT1_MAX_RX_QUEUES)
44
45 typedef
46 #include "vmware_pack_begin.h"
47 struct UPT1_TxStats {
48    uint64 TSOPktsTxOK;  /* TSO pkts post-segmentation */
49    uint64 TSOBytesTxOK;
50    uint64 ucastPktsTxOK;
51    uint64 ucastBytesTxOK;
52    uint64 mcastPktsTxOK;
53    uint64 mcastBytesTxOK;
54    uint64 bcastPktsTxOK;
55    uint64 bcastBytesTxOK;
56    uint64 pktsTxError;
57    uint64 pktsTxDiscard;
58 }
59 #include "vmware_pack_end.h"
60 UPT1_TxStats;
61
62 typedef
63 #include "vmware_pack_begin.h"
64 struct UPT1_RxStats {
65    uint64 LROPktsRxOK;    /* LRO pkts */
66    uint64 LROBytesRxOK;   /* bytes from LRO pkts */
67    /* the following counters are for pkts from the wire, i.e., pre-LRO */
68    uint64 ucastPktsRxOK;
69    uint64 ucastBytesRxOK;
70    uint64 mcastPktsRxOK;
71    uint64 mcastBytesRxOK;
72    uint64 bcastPktsRxOK;
73    uint64 bcastBytesRxOK;
74    uint64 pktsRxOutOfBuf;
75    uint64 pktsRxError;
76 }
77 #include "vmware_pack_end.h"
78 UPT1_RxStats;
79
80 /* interrupt moderation level */
81 #define UPT1_IML_NONE     0 /* no interrupt moderation */
82 #define UPT1_IML_HIGHEST  7 /* least intr generated */
83 #define UPT1_IML_ADAPTIVE 8 /* adpative intr moderation */
84
85 /* values for UPT1_RSSConf.hashFunc */
86 #define UPT1_RSS_HASH_TYPE_NONE      0x0
87 #define UPT1_RSS_HASH_TYPE_IPV4      0x01
88 #define UPT1_RSS_HASH_TYPE_TCP_IPV4  0x02
89 #define UPT1_RSS_HASH_TYPE_IPV6      0x04
90 #define UPT1_RSS_HASH_TYPE_TCP_IPV6  0x08
91
92 #define UPT1_RSS_HASH_FUNC_NONE      0x0
93 #define UPT1_RSS_HASH_FUNC_TOEPLITZ  0x01
94
95 #define UPT1_RSS_MAX_KEY_SIZE        40
96 #define UPT1_RSS_MAX_IND_TABLE_SIZE  128
97
98 typedef
99 #include "vmware_pack_begin.h"
100 struct UPT1_RSSConf {
101    uint16   hashType;
102    uint16   hashFunc;
103    uint16   hashKeySize;
104    uint16   indTableSize;
105    uint8    hashKey[UPT1_RSS_MAX_KEY_SIZE];
106    uint8    indTable[UPT1_RSS_MAX_IND_TABLE_SIZE];
107 }
108 #include "vmware_pack_end.h"
109 UPT1_RSSConf;
110
111 /* features */
112 #define UPT1_F_RXCSUM      0x0001   /* rx csum verification */
113 #define UPT1_F_RSS         0x0002
114 #define UPT1_F_RXVLAN      0x0004   /* VLAN tag stripping */
115 #define UPT1_F_LRO         0x0008
116
117 #endif