netdev_features.h 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /*
  2. * Network device features.
  3. *
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version
  8. * 2 of the License, or (at your option) any later version.
  9. */
  10. #ifndef _LINUX_NETDEV_FEATURES_H
  11. #define _LINUX_NETDEV_FEATURES_H
  12. #include <linux/types.h>
  13. typedef u32 netdev_features_t;
  14. /* Net device feature bits; if you change something,
  15. * also update netdev_features_strings[] in ethtool.c */
  16. #define NETIF_F_SG 1 /* Scatter/gather IO. */
  17. #define NETIF_F_IP_CSUM 2 /* Can checksum TCP/UDP over IPv4. */
  18. #define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
  19. #define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */
  20. #define NETIF_F_IPV6_CSUM 16 /* Can checksum TCP/UDP over IPV6 */
  21. #define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */
  22. #define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */
  23. #define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */
  24. #define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
  25. #define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
  26. #define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
  27. #define NETIF_F_GSO 2048 /* Enable software GSO. */
  28. #define NETIF_F_LLTX 4096 /* LockLess TX - deprecated. Please */
  29. /* do not use LLTX in new drivers */
  30. #define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */
  31. #define NETIF_F_GRO 16384 /* Generic receive offload */
  32. #define NETIF_F_LRO 32768 /* large receive offload */
  33. /* the GSO_MASK reserves bits 16 through 23 */
  34. #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */
  35. #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */
  36. #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
  37. #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */
  38. #define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */
  39. #define NETIF_F_RXCSUM (1 << 29) /* Receive checksumming offload */
  40. #define NETIF_F_NOCACHE_COPY (1 << 30) /* Use no-cache copyfromuser */
  41. #define NETIF_F_LOOPBACK (1 << 31) /* Enable loopback */
  42. /* Segmentation offload features */
  43. #define NETIF_F_GSO_SHIFT 16
  44. #define NETIF_F_GSO_MASK 0x00ff0000
  45. #define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
  46. #define NETIF_F_UFO (SKB_GSO_UDP << NETIF_F_GSO_SHIFT)
  47. #define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT)
  48. #define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT)
  49. #define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
  50. #define NETIF_F_FSO (SKB_GSO_FCOE << NETIF_F_GSO_SHIFT)
  51. /* Features valid for ethtool to change */
  52. /* = all defined minus driver/device-class-related */
  53. #define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \
  54. NETIF_F_LLTX | NETIF_F_NETNS_LOCAL)
  55. #define NETIF_F_ETHTOOL_BITS (0xff3fffff & ~NETIF_F_NEVER_CHANGE)
  56. /* List of features with software fallbacks. */
  57. #define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \
  58. NETIF_F_TSO6 | NETIF_F_UFO)
  59. #define NETIF_F_GEN_CSUM (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)
  60. #define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM)
  61. #define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
  62. #define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
  63. #define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)
  64. #define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
  65. NETIF_F_FSO)
  66. /*
  67. * If one device supports one of these features, then enable them
  68. * for all in netdev_increment_features.
  69. */
  70. #define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \
  71. NETIF_F_SG | NETIF_F_HIGHDMA | \
  72. NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED)
  73. /*
  74. * If one device doesn't support one of these features, then disable it
  75. * for all in netdev_increment_features.
  76. */
  77. #define NETIF_F_ALL_FOR_ALL (NETIF_F_NOCACHE_COPY | NETIF_F_FSO)
  78. /* changeable features with no special hardware requirements */
  79. #define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)
  80. #endif /* _LINUX_NETDEV_FEATURES_H */