Back to home page

OSCL-LXR

 
 

    


0001 /*
0002  * Linux driver for VMware's vmxnet3 ethernet NIC.
0003  *
0004  * Copyright (C) 2008-2022, VMware, Inc. All Rights Reserved.
0005  *
0006  * This program is free software; you can redistribute it and/or modify it
0007  * under the terms of the GNU General Public License as published by the
0008  * Free Software Foundation; version 2 of the License and no later version.
0009  *
0010  * This program is distributed in the hope that it will be useful, but
0011  * WITHOUT ANY WARRANTY; without even the implied warranty of
0012  * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
0013  * NON INFRINGEMENT.  See the GNU General Public License for more
0014  * details.
0015  *
0016  * You should have received a copy of the GNU General Public License
0017  * along with this program; if not, write to the Free Software
0018  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
0019  *
0020  * The full GNU General Public License is included in this distribution in
0021  * the file called "COPYING".
0022  *
0023  * Maintained by: pv-drivers@vmware.com
0024  *
0025  */
0026 
0027 #ifndef _UPT1_DEFS_H
0028 #define _UPT1_DEFS_H
0029 
0030 struct UPT1_TxStats {
0031     u64         TSOPktsTxOK;  /* TSO pkts post-segmentation */
0032     u64         TSOBytesTxOK;
0033     u64         ucastPktsTxOK;
0034     u64         ucastBytesTxOK;
0035     u64         mcastPktsTxOK;
0036     u64         mcastBytesTxOK;
0037     u64         bcastPktsTxOK;
0038     u64         bcastBytesTxOK;
0039     u64         pktsTxError;
0040     u64         pktsTxDiscard;
0041 };
0042 
0043 struct UPT1_RxStats {
0044     u64         LROPktsRxOK;    /* LRO pkts */
0045     u64         LROBytesRxOK;   /* bytes from LRO pkts */
0046     /* the following counters are for pkts from the wire, i.e., pre-LRO */
0047     u64         ucastPktsRxOK;
0048     u64         ucastBytesRxOK;
0049     u64         mcastPktsRxOK;
0050     u64         mcastBytesRxOK;
0051     u64         bcastPktsRxOK;
0052     u64         bcastBytesRxOK;
0053     u64         pktsRxOutOfBuf;
0054     u64         pktsRxError;
0055 };
0056 
0057 /* interrupt moderation level */
0058 enum {
0059     UPT1_IML_NONE       = 0, /* no interrupt moderation */
0060     UPT1_IML_HIGHEST    = 7, /* least intr generated */
0061     UPT1_IML_ADAPTIVE   = 8, /* adpative intr moderation */
0062 };
0063 /* values for UPT1_RSSConf.hashFunc */
0064 enum {
0065     UPT1_RSS_HASH_TYPE_NONE      = 0x0,
0066     UPT1_RSS_HASH_TYPE_IPV4      = 0x01,
0067     UPT1_RSS_HASH_TYPE_TCP_IPV4  = 0x02,
0068     UPT1_RSS_HASH_TYPE_IPV6      = 0x04,
0069     UPT1_RSS_HASH_TYPE_TCP_IPV6  = 0x08,
0070 };
0071 
0072 enum {
0073     UPT1_RSS_HASH_FUNC_NONE      = 0x0,
0074     UPT1_RSS_HASH_FUNC_TOEPLITZ  = 0x01,
0075 };
0076 
0077 #define UPT1_RSS_MAX_KEY_SIZE        40
0078 #define UPT1_RSS_MAX_IND_TABLE_SIZE  128
0079 
0080 struct UPT1_RSSConf {
0081     u16         hashType;
0082     u16         hashFunc;
0083     u16         hashKeySize;
0084     u16         indTableSize;
0085     u8          hashKey[UPT1_RSS_MAX_KEY_SIZE];
0086     u8          indTable[UPT1_RSS_MAX_IND_TABLE_SIZE];
0087 };
0088 
0089 /* features */
0090 enum {
0091     UPT1_F_RXCSUM       = cpu_to_le64(0x0001),   /* rx csum verification */
0092     UPT1_F_RSS      = cpu_to_le64(0x0002),
0093     UPT1_F_RXVLAN       = cpu_to_le64(0x0004),   /* VLAN tag stripping */
0094     UPT1_F_LRO      = cpu_to_le64(0x0008),
0095     UPT1_F_RXINNEROFLD      = cpu_to_le64(0x00010),  /* Geneve/Vxlan rx csum
0096                               * offloading
0097                               */
0098 };
0099 #endif