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