New upstream version 18.02
[deb_dpdk.git] / drivers / net / vmxnet3 / base / upt1_defs.h
1 /*********************************************************
2  * Copyright (C) 2007 VMware, Inc. All rights reserved.
3  *
4  * SPDX-License-Identifier:    BSD-3-Clause
5  *
6  *********************************************************/
7
8 /* upt1_defs.h
9  *
10  *      Definitions for UPTv1
11  *
12  *      Some of the defs are duplicated in vmkapi_net_upt.h, because
13  *      vmkapi_net_upt.h cannot distribute with OSS yet and vmkapi headers can
14  *      only include vmkapi headers. Make sure they are kept in sync!
15  */
16
17 #ifndef _UPT1_DEFS_H
18 #define _UPT1_DEFS_H
19
20 #define UPT1_MAX_TX_QUEUES  64
21 #define UPT1_MAX_RX_QUEUES  64
22
23 #define UPT1_MAX_INTRS  (UPT1_MAX_TX_QUEUES + UPT1_MAX_RX_QUEUES)
24
25 typedef
26 #include "vmware_pack_begin.h"
27 struct UPT1_TxStats {
28    uint64 TSOPktsTxOK;  /* TSO pkts post-segmentation */
29    uint64 TSOBytesTxOK;
30    uint64 ucastPktsTxOK;
31    uint64 ucastBytesTxOK;
32    uint64 mcastPktsTxOK;
33    uint64 mcastBytesTxOK;
34    uint64 bcastPktsTxOK;
35    uint64 bcastBytesTxOK;
36    uint64 pktsTxError;
37    uint64 pktsTxDiscard;
38 }
39 #include "vmware_pack_end.h"
40 UPT1_TxStats;
41
42 typedef
43 #include "vmware_pack_begin.h"
44 struct UPT1_RxStats {
45    uint64 LROPktsRxOK;    /* LRO pkts */
46    uint64 LROBytesRxOK;   /* bytes from LRO pkts */
47    /* the following counters are for pkts from the wire, i.e., pre-LRO */
48    uint64 ucastPktsRxOK;
49    uint64 ucastBytesRxOK;
50    uint64 mcastPktsRxOK;
51    uint64 mcastBytesRxOK;
52    uint64 bcastPktsRxOK;
53    uint64 bcastBytesRxOK;
54    uint64 pktsRxOutOfBuf;
55    uint64 pktsRxError;
56 }
57 #include "vmware_pack_end.h"
58 UPT1_RxStats;
59
60 /* interrupt moderation level */
61 #define UPT1_IML_NONE     0 /* no interrupt moderation */
62 #define UPT1_IML_HIGHEST  7 /* least intr generated */
63 #define UPT1_IML_ADAPTIVE 8 /* adpative intr moderation */
64
65 /* values for UPT1_RSSConf.hashFunc */
66 #define UPT1_RSS_HASH_TYPE_NONE      0x0
67 #define UPT1_RSS_HASH_TYPE_IPV4      0x01
68 #define UPT1_RSS_HASH_TYPE_TCP_IPV4  0x02
69 #define UPT1_RSS_HASH_TYPE_IPV6      0x04
70 #define UPT1_RSS_HASH_TYPE_TCP_IPV6  0x08
71
72 #define UPT1_RSS_HASH_FUNC_NONE      0x0
73 #define UPT1_RSS_HASH_FUNC_TOEPLITZ  0x01
74
75 #define UPT1_RSS_MAX_KEY_SIZE        40
76 #define UPT1_RSS_MAX_IND_TABLE_SIZE  128
77
78 typedef
79 #include "vmware_pack_begin.h"
80 struct UPT1_RSSConf {
81    uint16   hashType;
82    uint16   hashFunc;
83    uint16   hashKeySize;
84    uint16   indTableSize;
85    uint8    hashKey[UPT1_RSS_MAX_KEY_SIZE];
86    uint8    indTable[UPT1_RSS_MAX_IND_TABLE_SIZE];
87 }
88 #include "vmware_pack_end.h"
89 UPT1_RSSConf;
90
91 /* features */
92 #define UPT1_F_RXCSUM      0x0001   /* rx csum verification */
93 #define UPT1_F_RSS         0x0002
94 #define UPT1_F_RXVLAN      0x0004   /* VLAN tag stripping */
95 #define UPT1_F_LRO         0x0008
96
97 #endif