upt1_defs.h 2.6 KB

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