xref: /openbmc/linux/drivers/net/vmxnet3/upt1_defs.h (revision 4f2c0a4acffbec01079c28f839422e64ddeff004)
1d1a890faSShreyas Bhatewara /*
2d1a890faSShreyas Bhatewara  * Linux driver for VMware's vmxnet3 ethernet NIC.
3d1a890faSShreyas Bhatewara  *
4*55f0395fSRonak Doshi  * Copyright (C) 2008-2022, VMware, Inc. All Rights Reserved.
5d1a890faSShreyas Bhatewara  *
6d1a890faSShreyas Bhatewara  * This program is free software; you can redistribute it and/or modify it
7d1a890faSShreyas Bhatewara  * under the terms of the GNU General Public License as published by the
8d1a890faSShreyas Bhatewara  * Free Software Foundation; version 2 of the License and no later version.
9d1a890faSShreyas Bhatewara  *
10d1a890faSShreyas Bhatewara  * This program is distributed in the hope that it will be useful, but
11d1a890faSShreyas Bhatewara  * WITHOUT ANY WARRANTY; without even the implied warranty of
12d1a890faSShreyas Bhatewara  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
13d1a890faSShreyas Bhatewara  * NON INFRINGEMENT.  See the GNU General Public License for more
14d1a890faSShreyas Bhatewara  * details.
15d1a890faSShreyas Bhatewara  *
16d1a890faSShreyas Bhatewara  * You should have received a copy of the GNU General Public License
17d1a890faSShreyas Bhatewara  * along with this program; if not, write to the Free Software
18d1a890faSShreyas Bhatewara  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19d1a890faSShreyas Bhatewara  *
20d1a890faSShreyas Bhatewara  * The full GNU General Public License is included in this distribution in
21d1a890faSShreyas Bhatewara  * the file called "COPYING".
22d1a890faSShreyas Bhatewara  *
23190af10fSShrikrishna Khare  * Maintained by: pv-drivers@vmware.com
24d1a890faSShreyas Bhatewara  *
25d1a890faSShreyas Bhatewara  */
26d1a890faSShreyas Bhatewara 
27d1a890faSShreyas Bhatewara #ifndef _UPT1_DEFS_H
28d1a890faSShreyas Bhatewara #define _UPT1_DEFS_H
29d1a890faSShreyas Bhatewara 
30d1a890faSShreyas Bhatewara struct UPT1_TxStats {
31d1a890faSShreyas Bhatewara 	u64			TSOPktsTxOK;  /* TSO pkts post-segmentation */
32d1a890faSShreyas Bhatewara 	u64			TSOBytesTxOK;
33d1a890faSShreyas Bhatewara 	u64			ucastPktsTxOK;
34d1a890faSShreyas Bhatewara 	u64			ucastBytesTxOK;
35d1a890faSShreyas Bhatewara 	u64			mcastPktsTxOK;
36d1a890faSShreyas Bhatewara 	u64			mcastBytesTxOK;
37d1a890faSShreyas Bhatewara 	u64			bcastPktsTxOK;
38d1a890faSShreyas Bhatewara 	u64			bcastBytesTxOK;
39d1a890faSShreyas Bhatewara 	u64			pktsTxError;
40d1a890faSShreyas Bhatewara 	u64			pktsTxDiscard;
41d1a890faSShreyas Bhatewara };
42d1a890faSShreyas Bhatewara 
43d1a890faSShreyas Bhatewara struct UPT1_RxStats {
44d1a890faSShreyas Bhatewara 	u64			LROPktsRxOK;    /* LRO pkts */
45d1a890faSShreyas Bhatewara 	u64			LROBytesRxOK;   /* bytes from LRO pkts */
46d1a890faSShreyas Bhatewara 	/* the following counters are for pkts from the wire, i.e., pre-LRO */
47d1a890faSShreyas Bhatewara 	u64			ucastPktsRxOK;
48d1a890faSShreyas Bhatewara 	u64			ucastBytesRxOK;
49d1a890faSShreyas Bhatewara 	u64			mcastPktsRxOK;
50d1a890faSShreyas Bhatewara 	u64			mcastBytesRxOK;
51d1a890faSShreyas Bhatewara 	u64			bcastPktsRxOK;
52d1a890faSShreyas Bhatewara 	u64			bcastBytesRxOK;
53d1a890faSShreyas Bhatewara 	u64			pktsRxOutOfBuf;
54d1a890faSShreyas Bhatewara 	u64			pktsRxError;
55d1a890faSShreyas Bhatewara };
56d1a890faSShreyas Bhatewara 
57d1a890faSShreyas Bhatewara /* interrupt moderation level */
58d1a890faSShreyas Bhatewara enum {
59d1a890faSShreyas Bhatewara 	UPT1_IML_NONE		= 0, /* no interrupt moderation */
60d1a890faSShreyas Bhatewara 	UPT1_IML_HIGHEST	= 7, /* least intr generated */
61d1a890faSShreyas Bhatewara 	UPT1_IML_ADAPTIVE	= 8, /* adpative intr moderation */
62d1a890faSShreyas Bhatewara };
63d1a890faSShreyas Bhatewara /* values for UPT1_RSSConf.hashFunc */
64d1a890faSShreyas Bhatewara enum {
65d1a890faSShreyas Bhatewara 	UPT1_RSS_HASH_TYPE_NONE      = 0x0,
66d1a890faSShreyas Bhatewara 	UPT1_RSS_HASH_TYPE_IPV4      = 0x01,
67d1a890faSShreyas Bhatewara 	UPT1_RSS_HASH_TYPE_TCP_IPV4  = 0x02,
68d1a890faSShreyas Bhatewara 	UPT1_RSS_HASH_TYPE_IPV6      = 0x04,
69d1a890faSShreyas Bhatewara 	UPT1_RSS_HASH_TYPE_TCP_IPV6  = 0x08,
70d1a890faSShreyas Bhatewara };
71d1a890faSShreyas Bhatewara 
72d1a890faSShreyas Bhatewara enum {
73d1a890faSShreyas Bhatewara 	UPT1_RSS_HASH_FUNC_NONE      = 0x0,
74d1a890faSShreyas Bhatewara 	UPT1_RSS_HASH_FUNC_TOEPLITZ  = 0x01,
75d1a890faSShreyas Bhatewara };
76d1a890faSShreyas Bhatewara 
77d1a890faSShreyas Bhatewara #define UPT1_RSS_MAX_KEY_SIZE        40
78d1a890faSShreyas Bhatewara #define UPT1_RSS_MAX_IND_TABLE_SIZE  128
79d1a890faSShreyas Bhatewara 
80d1a890faSShreyas Bhatewara struct UPT1_RSSConf {
81d1a890faSShreyas Bhatewara 	u16			hashType;
82d1a890faSShreyas Bhatewara 	u16			hashFunc;
83d1a890faSShreyas Bhatewara 	u16			hashKeySize;
84d1a890faSShreyas Bhatewara 	u16			indTableSize;
85d1a890faSShreyas Bhatewara 	u8			hashKey[UPT1_RSS_MAX_KEY_SIZE];
86d1a890faSShreyas Bhatewara 	u8			indTable[UPT1_RSS_MAX_IND_TABLE_SIZE];
87d1a890faSShreyas Bhatewara };
88d1a890faSShreyas Bhatewara 
89d1a890faSShreyas Bhatewara /* features */
90d1a890faSShreyas Bhatewara enum {
913843e515SHarvey Harrison 	UPT1_F_RXCSUM		= cpu_to_le64(0x0001),   /* rx csum verification */
923843e515SHarvey Harrison 	UPT1_F_RSS		= cpu_to_le64(0x0002),
933843e515SHarvey Harrison 	UPT1_F_RXVLAN		= cpu_to_le64(0x0004),   /* VLAN tag stripping */
943843e515SHarvey Harrison 	UPT1_F_LRO		= cpu_to_le64(0x0008),
95dacce2beSRonak Doshi 	UPT1_F_RXINNEROFLD      = cpu_to_le64(0x00010),  /* Geneve/Vxlan rx csum
96dacce2beSRonak Doshi 							  * offloading
97dacce2beSRonak Doshi 							  */
98d1a890faSShreyas Bhatewara };
99d1a890faSShreyas Bhatewara #endif
100