1*f0fdd515SHemant Agrawal /* SPDX-License-Identifier: BSD-3-Clause 209452c07SBruce Richardson * Copyright (C) 2007 VMware, Inc. All rights reserved. 3*f0fdd515SHemant Agrawal */ 409452c07SBruce Richardson 509452c07SBruce Richardson /* upt1_defs.h 609452c07SBruce Richardson * 709452c07SBruce Richardson * Definitions for UPTv1 809452c07SBruce Richardson * 909452c07SBruce Richardson * Some of the defs are duplicated in vmkapi_net_upt.h, because 1009452c07SBruce Richardson * vmkapi_net_upt.h cannot distribute with OSS yet and vmkapi headers can 1109452c07SBruce Richardson * only include vmkapi headers. Make sure they are kept in sync! 1209452c07SBruce Richardson */ 1309452c07SBruce Richardson 1409452c07SBruce Richardson #ifndef _UPT1_DEFS_H 1509452c07SBruce Richardson #define _UPT1_DEFS_H 1609452c07SBruce Richardson 1709452c07SBruce Richardson #define UPT1_MAX_TX_QUEUES 64 1809452c07SBruce Richardson #define UPT1_MAX_RX_QUEUES 64 1909452c07SBruce Richardson 2009452c07SBruce Richardson #define UPT1_MAX_INTRS (UPT1_MAX_TX_QUEUES + UPT1_MAX_RX_QUEUES) 2109452c07SBruce Richardson 2209452c07SBruce Richardson typedef 2309452c07SBruce Richardson #include "vmware_pack_begin.h" 2409452c07SBruce Richardson struct UPT1_TxStats { 2509452c07SBruce Richardson uint64 TSOPktsTxOK; /* TSO pkts post-segmentation */ 2609452c07SBruce Richardson uint64 TSOBytesTxOK; 2709452c07SBruce Richardson uint64 ucastPktsTxOK; 2809452c07SBruce Richardson uint64 ucastBytesTxOK; 2909452c07SBruce Richardson uint64 mcastPktsTxOK; 3009452c07SBruce Richardson uint64 mcastBytesTxOK; 3109452c07SBruce Richardson uint64 bcastPktsTxOK; 3209452c07SBruce Richardson uint64 bcastBytesTxOK; 3309452c07SBruce Richardson uint64 pktsTxError; 3409452c07SBruce Richardson uint64 pktsTxDiscard; 3509452c07SBruce Richardson } 3609452c07SBruce Richardson #include "vmware_pack_end.h" 3709452c07SBruce Richardson UPT1_TxStats; 3809452c07SBruce Richardson 3909452c07SBruce Richardson typedef 4009452c07SBruce Richardson #include "vmware_pack_begin.h" 4109452c07SBruce Richardson struct UPT1_RxStats { 4209452c07SBruce Richardson uint64 LROPktsRxOK; /* LRO pkts */ 4309452c07SBruce Richardson uint64 LROBytesRxOK; /* bytes from LRO pkts */ 4409452c07SBruce Richardson /* the following counters are for pkts from the wire, i.e., pre-LRO */ 4509452c07SBruce Richardson uint64 ucastPktsRxOK; 4609452c07SBruce Richardson uint64 ucastBytesRxOK; 4709452c07SBruce Richardson uint64 mcastPktsRxOK; 4809452c07SBruce Richardson uint64 mcastBytesRxOK; 4909452c07SBruce Richardson uint64 bcastPktsRxOK; 5009452c07SBruce Richardson uint64 bcastBytesRxOK; 5109452c07SBruce Richardson uint64 pktsRxOutOfBuf; 5209452c07SBruce Richardson uint64 pktsRxError; 5309452c07SBruce Richardson } 5409452c07SBruce Richardson #include "vmware_pack_end.h" 5509452c07SBruce Richardson UPT1_RxStats; 5609452c07SBruce Richardson 5709452c07SBruce Richardson /* interrupt moderation level */ 5809452c07SBruce Richardson #define UPT1_IML_NONE 0 /* no interrupt moderation */ 5909452c07SBruce Richardson #define UPT1_IML_HIGHEST 7 /* least intr generated */ 6009452c07SBruce Richardson #define UPT1_IML_ADAPTIVE 8 /* adpative intr moderation */ 6109452c07SBruce Richardson 6209452c07SBruce Richardson /* values for UPT1_RSSConf.hashFunc */ 6309452c07SBruce Richardson #define UPT1_RSS_HASH_TYPE_NONE 0x0 6409452c07SBruce Richardson #define UPT1_RSS_HASH_TYPE_IPV4 0x01 6509452c07SBruce Richardson #define UPT1_RSS_HASH_TYPE_TCP_IPV4 0x02 6609452c07SBruce Richardson #define UPT1_RSS_HASH_TYPE_IPV6 0x04 6709452c07SBruce Richardson #define UPT1_RSS_HASH_TYPE_TCP_IPV6 0x08 6809452c07SBruce Richardson 6909452c07SBruce Richardson #define UPT1_RSS_HASH_FUNC_NONE 0x0 7009452c07SBruce Richardson #define UPT1_RSS_HASH_FUNC_TOEPLITZ 0x01 7109452c07SBruce Richardson 7209452c07SBruce Richardson #define UPT1_RSS_MAX_KEY_SIZE 40 7309452c07SBruce Richardson #define UPT1_RSS_MAX_IND_TABLE_SIZE 128 7409452c07SBruce Richardson 7509452c07SBruce Richardson typedef 7609452c07SBruce Richardson #include "vmware_pack_begin.h" 7709452c07SBruce Richardson struct UPT1_RSSConf { 7809452c07SBruce Richardson uint16 hashType; 7909452c07SBruce Richardson uint16 hashFunc; 8009452c07SBruce Richardson uint16 hashKeySize; 8109452c07SBruce Richardson uint16 indTableSize; 8209452c07SBruce Richardson uint8 hashKey[UPT1_RSS_MAX_KEY_SIZE]; 8309452c07SBruce Richardson uint8 indTable[UPT1_RSS_MAX_IND_TABLE_SIZE]; 8409452c07SBruce Richardson } 8509452c07SBruce Richardson #include "vmware_pack_end.h" 8609452c07SBruce Richardson UPT1_RSSConf; 8709452c07SBruce Richardson 8809452c07SBruce Richardson /* features */ 8909452c07SBruce Richardson #define UPT1_F_RXCSUM 0x0001 /* rx csum verification */ 9009452c07SBruce Richardson #define UPT1_F_RSS 0x0002 9109452c07SBruce Richardson #define UPT1_F_RXVLAN 0x0004 /* VLAN tag stripping */ 9209452c07SBruce Richardson #define UPT1_F_LRO 0x0008 9309452c07SBruce Richardson 9409452c07SBruce Richardson #endif 95