aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>2011-01-24 18:32:47 -0500
committerDavid S. Miller <davem@davemloft.net>2011-01-24 18:32:47 -0500
commit04ed3e741d0f133e02bed7fa5c98edba128f90e7 (patch)
tree3dde4ca8306e98536faa69bccf0e47a2549c088f /net/core
parent57422dc530115e427dff464cc0a32bcd0efb5008 (diff)
net: change netdev->features to u32
Quoting Ben Hutchings: we presumably won't be defining features that can only be enabled on 64-bit architectures. Occurences found by `grep -r` on net/, drivers/net, include/ [ Move features and vlan_features next to each other in struct netdev, as per Eric Dumazet's suggestion -DaveM ] Signed-off-by: Michał Mirosław <mirq-linux@rere.qmqm.pl> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/dev.c15
-rw-r--r--net/core/ethtool.c2
-rw-r--r--net/core/net-sysfs.c2
-rw-r--r--net/core/skbuff.c4
4 files changed, 11 insertions, 12 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index ad374189858..7103f89fde0 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1858,7 +1858,7 @@ EXPORT_SYMBOL(skb_checksum_help);
1858 * It may return NULL if the skb requires no segmentation. This is 1858 * It may return NULL if the skb requires no segmentation. This is
1859 * only possible when GSO is used for verifying header integrity. 1859 * only possible when GSO is used for verifying header integrity.
1860 */ 1860 */
1861struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features) 1861struct sk_buff *skb_gso_segment(struct sk_buff *skb, u32 features)
1862{ 1862{
1863 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT); 1863 struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT);
1864 struct packet_type *ptype; 1864 struct packet_type *ptype;
@@ -2046,7 +2046,7 @@ static bool can_checksum_protocol(unsigned long features, __be16 protocol)
2046 protocol == htons(ETH_P_FCOE))); 2046 protocol == htons(ETH_P_FCOE)));
2047} 2047}
2048 2048
2049static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features) 2049static u32 harmonize_features(struct sk_buff *skb, __be16 protocol, u32 features)
2050{ 2050{
2051 if (!can_checksum_protocol(features, protocol)) { 2051 if (!can_checksum_protocol(features, protocol)) {
2052 features &= ~NETIF_F_ALL_CSUM; 2052 features &= ~NETIF_F_ALL_CSUM;
@@ -2058,10 +2058,10 @@ static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features
2058 return features; 2058 return features;
2059} 2059}
2060 2060
2061int netif_skb_features(struct sk_buff *skb) 2061u32 netif_skb_features(struct sk_buff *skb)
2062{ 2062{
2063 __be16 protocol = skb->protocol; 2063 __be16 protocol = skb->protocol;
2064 int features = skb->dev->features; 2064 u32 features = skb->dev->features;
2065 2065
2066 if (protocol == htons(ETH_P_8021Q)) { 2066 if (protocol == htons(ETH_P_8021Q)) {
2067 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data; 2067 struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
@@ -2106,7 +2106,7 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,
2106 int rc = NETDEV_TX_OK; 2106 int rc = NETDEV_TX_OK;
2107 2107
2108 if (likely(!skb->next)) { 2108 if (likely(!skb->next)) {
2109 int features; 2109 u32 features;
2110 2110
2111 /* 2111 /*
2112 * If device doesnt need skb->dst, release it right now while 2112 * If device doesnt need skb->dst, release it right now while
@@ -5213,7 +5213,7 @@ static void rollback_registered(struct net_device *dev)
5213 rollback_registered_many(&single); 5213 rollback_registered_many(&single);
5214} 5214}
5215 5215
5216unsigned long netdev_fix_features(unsigned long features, const char *name) 5216u32 netdev_fix_features(u32 features, const char *name)
5217{ 5217{
5218 /* Fix illegal checksum combinations */ 5218 /* Fix illegal checksum combinations */
5219 if ((features & NETIF_F_HW_CSUM) && 5219 if ((features & NETIF_F_HW_CSUM) &&
@@ -6143,8 +6143,7 @@ static int dev_cpu_callback(struct notifier_block *nfb,
6143 * @one to the master device with current feature set @all. Will not 6143 * @one to the master device with current feature set @all. Will not
6144 * enable anything that is off in @mask. Returns the new feature set. 6144 * enable anything that is off in @mask. Returns the new feature set.
6145 */ 6145 */
6146unsigned long netdev_increment_features(unsigned long all, unsigned long one, 6146u32 netdev_increment_features(u32 all, u32 one, u32 mask)
6147 unsigned long mask)
6148{ 6147{
6149 /* If device needs checksumming, downgrade to it. */ 6148 /* If device needs checksumming, downgrade to it. */
6150 if (all & NETIF_F_NO_CSUM && !(one & NETIF_F_NO_CSUM)) 6149 if (all & NETIF_F_NO_CSUM && !(one & NETIF_F_NO_CSUM))
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index 17741782a34..bd1af99e112 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1458,7 +1458,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
1458 void __user *useraddr = ifr->ifr_data; 1458 void __user *useraddr = ifr->ifr_data;
1459 u32 ethcmd; 1459 u32 ethcmd;
1460 int rc; 1460 int rc;
1461 unsigned long old_features; 1461 u32 old_features;
1462 1462
1463 if (!dev || !netif_device_present(dev)) 1463 if (!dev || !netif_device_present(dev))
1464 return -ENODEV; 1464 return -ENODEV;
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
index e23c01be5a5..81367ccf330 100644
--- a/net/core/net-sysfs.c
+++ b/net/core/net-sysfs.c
@@ -99,7 +99,7 @@ NETDEVICE_SHOW(addr_assign_type, fmt_dec);
99NETDEVICE_SHOW(addr_len, fmt_dec); 99NETDEVICE_SHOW(addr_len, fmt_dec);
100NETDEVICE_SHOW(iflink, fmt_dec); 100NETDEVICE_SHOW(iflink, fmt_dec);
101NETDEVICE_SHOW(ifindex, fmt_dec); 101NETDEVICE_SHOW(ifindex, fmt_dec);
102NETDEVICE_SHOW(features, fmt_long_hex); 102NETDEVICE_SHOW(features, fmt_hex);
103NETDEVICE_SHOW(type, fmt_dec); 103NETDEVICE_SHOW(type, fmt_dec);
104NETDEVICE_SHOW(link_mode, fmt_dec); 104NETDEVICE_SHOW(link_mode, fmt_dec);
105 105
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index d31bb36ae0d..436c4c43924 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -2497,7 +2497,7 @@ EXPORT_SYMBOL_GPL(skb_pull_rcsum);
2497 * a pointer to the first in a list of new skbs for the segments. 2497 * a pointer to the first in a list of new skbs for the segments.
2498 * In case of error it returns ERR_PTR(err). 2498 * In case of error it returns ERR_PTR(err).
2499 */ 2499 */
2500struct sk_buff *skb_segment(struct sk_buff *skb, int features) 2500struct sk_buff *skb_segment(struct sk_buff *skb, u32 features)
2501{ 2501{
2502 struct sk_buff *segs = NULL; 2502 struct sk_buff *segs = NULL;
2503 struct sk_buff *tail = NULL; 2503 struct sk_buff *tail = NULL;
@@ -2507,7 +2507,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
2507 unsigned int offset = doffset; 2507 unsigned int offset = doffset;
2508 unsigned int headroom; 2508 unsigned int headroom;
2509 unsigned int len; 2509 unsigned int len;
2510 int sg = features & NETIF_F_SG; 2510 int sg = !!(features & NETIF_F_SG);
2511 int nfrags = skb_shinfo(skb)->nr_frags; 2511 int nfrags = skb_shinfo(skb)->nr_frags;
2512 int err = -ENOMEM; 2512 int err = -ENOMEM;
2513 int i = 0; 2513 int i = 0;