aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-11-15 10:29:55 -0500
committerDavid S. Miller <davem@davemloft.net>2011-11-16 17:43:08 -0500
commita59e2ecb859f2ab03bb2e230709f8039472ad2c3 (patch)
treeb57f4a0d2f227d1eeb088377f50a02663ebcd5aa
parent02b3a5524f6253113a46ebc283cc5ec392c34d7a (diff)
net: split netdev features to separate header
Move features definitions to separate header so that linux/skbuff.h won't need to include linux/netdevice.h after netdev_features_t is introduced. Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Acked-by: Ben Hutchings <bhutchings@solarflare.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/netdev_features.h90
-rw-r--r--include/linux/netdevice.h80
2 files changed, 92 insertions, 78 deletions
diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h
new file mode 100644
index 000000000000..32640edf4d78
--- /dev/null
+++ b/include/linux/netdev_features.h
@@ -0,0 +1,90 @@
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
13/* Net device feature bits; if you change something,
14 * also update netdev_features_strings[] in ethtool.c */
15
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
34/* the GSO_MASK reserves bits 16 through 23 */
35#define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */
36#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */
37#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
38#define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */
39#define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */
40#define NETIF_F_RXCSUM (1 << 29) /* Receive checksumming offload */
41#define NETIF_F_NOCACHE_COPY (1 << 30) /* Use no-cache copyfromuser */
42#define NETIF_F_LOOPBACK (1 << 31) /* Enable loopback */
43
44/* Segmentation offload features */
45#define NETIF_F_GSO_SHIFT 16
46#define NETIF_F_GSO_MASK 0x00ff0000
47#define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
48#define NETIF_F_UFO (SKB_GSO_UDP << NETIF_F_GSO_SHIFT)
49#define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT)
50#define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT)
51#define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
52#define NETIF_F_FSO (SKB_GSO_FCOE << NETIF_F_GSO_SHIFT)
53
54/* Features valid for ethtool to change */
55/* = all defined minus driver/device-class-related */
56#define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \
57 NETIF_F_LLTX | NETIF_F_NETNS_LOCAL)
58#define NETIF_F_ETHTOOL_BITS (0xff3fffff & ~NETIF_F_NEVER_CHANGE)
59
60/* List of features with software fallbacks. */
61#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \
62 NETIF_F_TSO6 | NETIF_F_UFO)
63
64#define NETIF_F_GEN_CSUM (NETIF_F_HW_CSUM | NETIF_F_NO_CSUM)
65#define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM)
66#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
67#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
68
69#define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)
70
71#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
72 NETIF_F_FSO)
73
74/*
75 * If one device supports one of these features, then enable them
76 * for all in netdev_increment_features.
77 */
78#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \
79 NETIF_F_SG | NETIF_F_HIGHDMA | \
80 NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED)
81/*
82 * If one device doesn't support one of these features, then disable it
83 * for all in netdev_increment_features.
84 */
85#define NETIF_F_ALL_FOR_ALL (NETIF_F_NOCACHE_COPY | NETIF_F_FSO)
86
87/* changeable features with no special hardware requirements */
88#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)
89
90#endif /* _LINUX_NETDEV_FEATURES_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index e34717a792b4..9cf6e90b171d 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -51,6 +51,8 @@
51#include <net/dcbnl.h> 51#include <net/dcbnl.h>
52#endif 52#endif
53 53
54#include <linux/netdev_features.h>
55
54struct vlan_group; 56struct vlan_group;
55struct netpoll_info; 57struct netpoll_info;
56struct phy_device; 58struct phy_device;
@@ -1005,84 +1007,6 @@ struct net_device {
1005 /* mask of features inheritable by VLAN devices */ 1007 /* mask of features inheritable by VLAN devices */
1006 u32 vlan_features; 1008 u32 vlan_features;
1007 1009
1008 /* Net device feature bits; if you change something,
1009 * also update netdev_features_strings[] in ethtool.c */
1010
1011#define NETIF_F_SG 1 /* Scatter/gather IO. */
1012#define NETIF_F_IP_CSUM 2 /* Can checksum TCP/UDP over IPv4. */
1013#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
1014#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */
1015#define NETIF_F_IPV6_CSUM 16 /* Can checksum TCP/UDP over IPV6 */
1016#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */
1017#define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */
1018#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */
1019#define NETIF_F_HW_VLAN_RX 256 /* Receive VLAN hw acceleration */
1020#define NETIF_F_HW_VLAN_FILTER 512 /* Receive filtering on VLAN */
1021#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
1022#define NETIF_F_GSO 2048 /* Enable software GSO. */
1023#define NETIF_F_LLTX 4096 /* LockLess TX - deprecated. Please */
1024 /* do not use LLTX in new drivers */
1025#define NETIF_F_NETNS_LOCAL 8192 /* Does not change network namespaces */
1026#define NETIF_F_GRO 16384 /* Generic receive offload */
1027#define NETIF_F_LRO 32768 /* large receive offload */
1028
1029/* the GSO_MASK reserves bits 16 through 23 */
1030#define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */
1031#define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */
1032#define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/
1033#define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */
1034#define NETIF_F_RXHASH (1 << 28) /* Receive hashing offload */
1035#define NETIF_F_RXCSUM (1 << 29) /* Receive checksumming offload */
1036#define NETIF_F_NOCACHE_COPY (1 << 30) /* Use no-cache copyfromuser */
1037#define NETIF_F_LOOPBACK (1 << 31) /* Enable loopback */
1038
1039 /* Segmentation offload features */
1040#define NETIF_F_GSO_SHIFT 16
1041#define NETIF_F_GSO_MASK 0x00ff0000
1042#define NETIF_F_TSO (SKB_GSO_TCPV4 << NETIF_F_GSO_SHIFT)
1043#define NETIF_F_UFO (SKB_GSO_UDP << NETIF_F_GSO_SHIFT)
1044#define NETIF_F_GSO_ROBUST (SKB_GSO_DODGY << NETIF_F_GSO_SHIFT)
1045#define NETIF_F_TSO_ECN (SKB_GSO_TCP_ECN << NETIF_F_GSO_SHIFT)
1046#define NETIF_F_TSO6 (SKB_GSO_TCPV6 << NETIF_F_GSO_SHIFT)
1047#define NETIF_F_FSO (SKB_GSO_FCOE << NETIF_F_GSO_SHIFT)
1048
1049 /* Features valid for ethtool to change */
1050 /* = all defined minus driver/device-class-related */
1051#define NETIF_F_NEVER_CHANGE (NETIF_F_VLAN_CHALLENGED | \
1052 NETIF_F_LLTX | NETIF_F_NETNS_LOCAL)
1053#define NETIF_F_ETHTOOL_BITS (0xff3fffff & ~NETIF_F_NEVER_CHANGE)
1054
1055 /* List of features with software fallbacks. */
1056#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | \
1057 NETIF_F_TSO6 | NETIF_F_UFO)
1058
1059
1060#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
1061#define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM)
1062#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
1063#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
1064
1065#define NETIF_F_ALL_TSO (NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_TSO_ECN)
1066
1067#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
1068 NETIF_F_FSO)
1069
1070 /*
1071 * If one device supports one of these features, then enable them
1072 * for all in netdev_increment_features.
1073 */
1074#define NETIF_F_ONE_FOR_ALL (NETIF_F_GSO_SOFTWARE | NETIF_F_GSO_ROBUST | \
1075 NETIF_F_SG | NETIF_F_HIGHDMA | \
1076 NETIF_F_FRAGLIST | NETIF_F_VLAN_CHALLENGED)
1077 /*
1078 * If one device doesn't support one of these features, then disable it
1079 * for all in netdev_increment_features.
1080 */
1081#define NETIF_F_ALL_FOR_ALL (NETIF_F_NOCACHE_COPY | NETIF_F_FSO)
1082
1083 /* changeable features with no special hardware requirements */
1084#define NETIF_F_SOFT_FEATURES (NETIF_F_GSO | NETIF_F_GRO)
1085
1086 /* Interface index. Unique device identifier */ 1010 /* Interface index. Unique device identifier */
1087 int ifindex; 1011 int ifindex;
1088 int iflink; 1012 int iflink;