162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Linux driver for VMware's vmxnet3 ethernet NIC.
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Copyright (C) 2008-2022, VMware, Inc. All Rights Reserved.
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * This program is free software; you can redistribute it and/or modify it
762306a36Sopenharmony_ci * under the terms of the GNU General Public License as published by the
862306a36Sopenharmony_ci * Free Software Foundation; version 2 of the License and no later version.
962306a36Sopenharmony_ci *
1062306a36Sopenharmony_ci * This program is distributed in the hope that it will be useful, but
1162306a36Sopenharmony_ci * WITHOUT ANY WARRANTY; without even the implied warranty of
1262306a36Sopenharmony_ci * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
1362306a36Sopenharmony_ci * NON INFRINGEMENT.  See the GNU General Public License for more
1462306a36Sopenharmony_ci * details.
1562306a36Sopenharmony_ci *
1662306a36Sopenharmony_ci * You should have received a copy of the GNU General Public License
1762306a36Sopenharmony_ci * along with this program; if not, write to the Free Software
1862306a36Sopenharmony_ci * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1962306a36Sopenharmony_ci *
2062306a36Sopenharmony_ci * The full GNU General Public License is included in this distribution in
2162306a36Sopenharmony_ci * the file called "COPYING".
2262306a36Sopenharmony_ci *
2362306a36Sopenharmony_ci * Maintained by: pv-drivers@vmware.com
2462306a36Sopenharmony_ci *
2562306a36Sopenharmony_ci */
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci#ifndef _UPT1_DEFS_H
2862306a36Sopenharmony_ci#define _UPT1_DEFS_H
2962306a36Sopenharmony_ci
3062306a36Sopenharmony_cistruct UPT1_TxStats {
3162306a36Sopenharmony_ci	u64			TSOPktsTxOK;  /* TSO pkts post-segmentation */
3262306a36Sopenharmony_ci	u64			TSOBytesTxOK;
3362306a36Sopenharmony_ci	u64			ucastPktsTxOK;
3462306a36Sopenharmony_ci	u64			ucastBytesTxOK;
3562306a36Sopenharmony_ci	u64			mcastPktsTxOK;
3662306a36Sopenharmony_ci	u64			mcastBytesTxOK;
3762306a36Sopenharmony_ci	u64			bcastPktsTxOK;
3862306a36Sopenharmony_ci	u64			bcastBytesTxOK;
3962306a36Sopenharmony_ci	u64			pktsTxError;
4062306a36Sopenharmony_ci	u64			pktsTxDiscard;
4162306a36Sopenharmony_ci};
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_cistruct UPT1_RxStats {
4462306a36Sopenharmony_ci	u64			LROPktsRxOK;    /* LRO pkts */
4562306a36Sopenharmony_ci	u64			LROBytesRxOK;   /* bytes from LRO pkts */
4662306a36Sopenharmony_ci	/* the following counters are for pkts from the wire, i.e., pre-LRO */
4762306a36Sopenharmony_ci	u64			ucastPktsRxOK;
4862306a36Sopenharmony_ci	u64			ucastBytesRxOK;
4962306a36Sopenharmony_ci	u64			mcastPktsRxOK;
5062306a36Sopenharmony_ci	u64			mcastBytesRxOK;
5162306a36Sopenharmony_ci	u64			bcastPktsRxOK;
5262306a36Sopenharmony_ci	u64			bcastBytesRxOK;
5362306a36Sopenharmony_ci	u64			pktsRxOutOfBuf;
5462306a36Sopenharmony_ci	u64			pktsRxError;
5562306a36Sopenharmony_ci};
5662306a36Sopenharmony_ci
5762306a36Sopenharmony_ci/* interrupt moderation level */
5862306a36Sopenharmony_cienum {
5962306a36Sopenharmony_ci	UPT1_IML_NONE		= 0, /* no interrupt moderation */
6062306a36Sopenharmony_ci	UPT1_IML_HIGHEST	= 7, /* least intr generated */
6162306a36Sopenharmony_ci	UPT1_IML_ADAPTIVE	= 8, /* adpative intr moderation */
6262306a36Sopenharmony_ci};
6362306a36Sopenharmony_ci/* values for UPT1_RSSConf.hashFunc */
6462306a36Sopenharmony_cienum {
6562306a36Sopenharmony_ci	UPT1_RSS_HASH_TYPE_NONE      = 0x0,
6662306a36Sopenharmony_ci	UPT1_RSS_HASH_TYPE_IPV4      = 0x01,
6762306a36Sopenharmony_ci	UPT1_RSS_HASH_TYPE_TCP_IPV4  = 0x02,
6862306a36Sopenharmony_ci	UPT1_RSS_HASH_TYPE_IPV6      = 0x04,
6962306a36Sopenharmony_ci	UPT1_RSS_HASH_TYPE_TCP_IPV6  = 0x08,
7062306a36Sopenharmony_ci};
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_cienum {
7362306a36Sopenharmony_ci	UPT1_RSS_HASH_FUNC_NONE      = 0x0,
7462306a36Sopenharmony_ci	UPT1_RSS_HASH_FUNC_TOEPLITZ  = 0x01,
7562306a36Sopenharmony_ci};
7662306a36Sopenharmony_ci
7762306a36Sopenharmony_ci#define UPT1_RSS_MAX_KEY_SIZE        40
7862306a36Sopenharmony_ci#define UPT1_RSS_MAX_IND_TABLE_SIZE  128
7962306a36Sopenharmony_ci
8062306a36Sopenharmony_cistruct UPT1_RSSConf {
8162306a36Sopenharmony_ci	u16			hashType;
8262306a36Sopenharmony_ci	u16			hashFunc;
8362306a36Sopenharmony_ci	u16			hashKeySize;
8462306a36Sopenharmony_ci	u16			indTableSize;
8562306a36Sopenharmony_ci	u8			hashKey[UPT1_RSS_MAX_KEY_SIZE];
8662306a36Sopenharmony_ci	u8			indTable[UPT1_RSS_MAX_IND_TABLE_SIZE];
8762306a36Sopenharmony_ci};
8862306a36Sopenharmony_ci
8962306a36Sopenharmony_ci/* features */
9062306a36Sopenharmony_cienum {
9162306a36Sopenharmony_ci	UPT1_F_RXCSUM		= cpu_to_le64(0x0001),   /* rx csum verification */
9262306a36Sopenharmony_ci	UPT1_F_RSS		= cpu_to_le64(0x0002),
9362306a36Sopenharmony_ci	UPT1_F_RXVLAN		= cpu_to_le64(0x0004),   /* VLAN tag stripping */
9462306a36Sopenharmony_ci	UPT1_F_LRO		= cpu_to_le64(0x0008),
9562306a36Sopenharmony_ci	UPT1_F_RXINNEROFLD      = cpu_to_le64(0x00010),  /* Geneve/Vxlan rx csum
9662306a36Sopenharmony_ci							  * offloading
9762306a36Sopenharmony_ci							  */
9862306a36Sopenharmony_ci};
9962306a36Sopenharmony_ci#endif
100