]> git.openfabrics.org - ~emulex/infiniband.git/commitdiff
net: change netdev->features to u32
authorMichał Mirosław <mirq-linux@rere.qmqm.pl>
Mon, 24 Jan 2011 23:32:47 +0000 (15:32 -0800)
committerDavid S. Miller <davem@davemloft.net>
Mon, 24 Jan 2011 23:32:47 +0000 (15:32 -0800)
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>
23 files changed:
drivers/net/bnx2.c
drivers/net/bonding/bond_main.c
drivers/net/myri10ge/myri10ge.c
drivers/net/sfc/ethtool.c
drivers/net/sfc/net_driver.h
drivers/net/tun.c
include/linux/netdevice.h
include/linux/skbuff.h
include/net/protocol.h
include/net/tcp.h
include/net/udp.h
net/8021q/vlan.c
net/bridge/br_if.c
net/bridge/br_private.h
net/core/dev.c
net/core/ethtool.c
net/core/net-sysfs.c
net/core/skbuff.c
net/ipv4/af_inet.c
net/ipv4/tcp.c
net/ipv4/udp.c
net/ipv6/af_inet6.c
net/ipv6/udp.c

index df99edf3464ad59e4872ea82f008c13c9ae3e942..cab96fa4cd3a506c7f62d9ae1cd4c03f4da1225a 100644 (file)
@@ -8312,7 +8312,7 @@ static const struct net_device_ops bnx2_netdev_ops = {
 #endif
 };
 
-static void inline vlan_features_add(struct net_device *dev, unsigned long flags)
+static void inline vlan_features_add(struct net_device *dev, u32 flags)
 {
        dev->vlan_features |= flags;
 }
index 163e0b06eaa5d1aba0dda6aef0765016020e2b1a..7047b406b8ba8b75fb853ab8fd0a5f40a0774113 100644 (file)
@@ -1372,8 +1372,8 @@ static int bond_compute_features(struct bonding *bond)
 {
        struct slave *slave;
        struct net_device *bond_dev = bond->dev;
-       unsigned long features = bond_dev->features;
-       unsigned long vlan_features = 0;
+       u32 features = bond_dev->features;
+       u32 vlan_features = 0;
        unsigned short max_hard_header_len = max((u16)ETH_HLEN,
                                                bond_dev->hard_header_len);
        int i;
index ea5cfe2c3a040aec2815c8020f15feb745064039..a7f2eed9a08ac390cdab1e96c477be05aaa1978c 100644 (file)
@@ -253,7 +253,7 @@ struct myri10ge_priv {
        unsigned long serial_number;
        int vendor_specific_offset;
        int fw_multicast_support;
-       unsigned long features;
+       u32 features;
        u32 max_tso6;
        u32 read_dma;
        u32 write_dma;
@@ -1776,7 +1776,7 @@ static int myri10ge_set_rx_csum(struct net_device *netdev, u32 csum_enabled)
 static int myri10ge_set_tso(struct net_device *netdev, u32 tso_enabled)
 {
        struct myri10ge_priv *mgp = netdev_priv(netdev);
-       unsigned long flags = mgp->features & (NETIF_F_TSO6 | NETIF_F_TSO);
+       u32 flags = mgp->features & (NETIF_F_TSO6 | NETIF_F_TSO);
 
        if (tso_enabled)
                netdev->features |= flags;
index 0e8bb19ed60d6f8bf78efb6b0910a8f4d94907bb..713969accdbd064dc024280a09a7808374deb946 100644 (file)
@@ -502,7 +502,7 @@ static void efx_ethtool_get_stats(struct net_device *net_dev,
 static int efx_ethtool_set_tso(struct net_device *net_dev, u32 enable)
 {
        struct efx_nic *efx __attribute__ ((unused)) = netdev_priv(net_dev);
-       unsigned long features;
+       u32 features;
 
        features = NETIF_F_TSO;
        if (efx->type->offload_features & NETIF_F_V6_CSUM)
@@ -519,7 +519,7 @@ static int efx_ethtool_set_tso(struct net_device *net_dev, u32 enable)
 static int efx_ethtool_set_tx_csum(struct net_device *net_dev, u32 enable)
 {
        struct efx_nic *efx = netdev_priv(net_dev);
-       unsigned long features = efx->type->offload_features & NETIF_F_ALL_CSUM;
+       u32 features = efx->type->offload_features & NETIF_F_ALL_CSUM;
 
        if (enable)
                net_dev->features |= features;
index 28df8665256a2167a5081fe4a69e3903ac22b1b5..c65270241d2d3d272d953e8ec5be4f516b9a413a 100644 (file)
@@ -906,7 +906,7 @@ struct efx_nic_type {
        unsigned int phys_addr_channels;
        unsigned int tx_dc_base;
        unsigned int rx_dc_base;
-       unsigned long offload_features;
+       u32 offload_features;
        u32 reset_world_flags;
 };
 
index b100bd50a0d7f27e0bda4144ffb3288a5bfc4d40..55786a0efc414ae0007e97ae2ccebb8b53c9ab9b 100644 (file)
@@ -1142,7 +1142,7 @@ static int tun_get_iff(struct net *net, struct tun_struct *tun,
  * privs required. */
 static int set_offload(struct net_device *dev, unsigned long arg)
 {
-       unsigned int old_features, features;
+       u32 old_features, features;
 
        old_features = dev->features;
        /* Unset features, set them as we chew on the arg. */
index a335f202269092885eb177295664072ba9e4d16f..0de3c59720fa1543af48645244a09250caa4df17 100644 (file)
@@ -914,7 +914,11 @@ struct net_device {
        struct list_head        unreg_list;
 
        /* Net device features */
-       unsigned long           features;
+       u32                     features;
+
+       /* VLAN feature mask */
+       u32                     vlan_features;
+
 #define NETIF_F_SG             1       /* Scatter/gather IO. */
 #define NETIF_F_IP_CSUM                2       /* Can checksum TCP/UDP over IPv4. */
 #define NETIF_F_NO_CSUM                4       /* Does not require checksum. F.e. loopack. */
@@ -1176,9 +1180,6 @@ struct net_device {
        /* rtnetlink link ops */
        const struct rtnl_link_ops *rtnl_link_ops;
 
-       /* VLAN feature mask */
-       unsigned long vlan_features;
-
        /* for setting kernel sock attribute on TCP connection setup */
 #define GSO_MAX_SIZE           65536
        unsigned int            gso_max_size;
@@ -1401,7 +1402,7 @@ struct packet_type {
                                         struct packet_type *,
                                         struct net_device *);
        struct sk_buff          *(*gso_segment)(struct sk_buff *skb,
-                                               int features);
+                                               u32 features);
        int                     (*gso_send_check)(struct sk_buff *skb);
        struct sk_buff          **(*gro_receive)(struct sk_buff **head,
                                               struct sk_buff *skb);
@@ -2370,7 +2371,7 @@ extern int                netdev_tstamp_prequeue;
 extern int             weight_p;
 extern int             netdev_set_master(struct net_device *dev, struct net_device *master);
 extern int skb_checksum_help(struct sk_buff *skb);
-extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features);
+extern struct sk_buff *skb_gso_segment(struct sk_buff *skb, u32 features);
 #ifdef CONFIG_BUG
 extern void netdev_rx_csum_fault(struct net_device *dev);
 #else
@@ -2397,22 +2398,21 @@ extern char *netdev_drivername(const struct net_device *dev, char *buffer, int l
 
 extern void linkwatch_run_queue(void);
 
-unsigned long netdev_increment_features(unsigned long all, unsigned long one,
-                                       unsigned long mask);
-unsigned long netdev_fix_features(unsigned long features, const char *name);
+u32 netdev_increment_features(u32 all, u32 one, u32 mask);
+u32 netdev_fix_features(u32 features, const char *name);
 
 void netif_stacked_transfer_operstate(const struct net_device *rootdev,
                                        struct net_device *dev);
 
-int netif_skb_features(struct sk_buff *skb);
+u32 netif_skb_features(struct sk_buff *skb);
 
-static inline int net_gso_ok(int features, int gso_type)
+static inline int net_gso_ok(u32 features, int gso_type)
 {
        int feature = gso_type << NETIF_F_GSO_SHIFT;
        return (features & feature) == feature;
 }
 
-static inline int skb_gso_ok(struct sk_buff *skb, int features)
+static inline int skb_gso_ok(struct sk_buff *skb, u32 features)
 {
        return net_gso_ok(features, skb_shinfo(skb)->gso_type) &&
               (!skb_has_frag_list(skb) || (features & NETIF_F_FRAGLIST));
index 6e946da9d1d65cbf6cd4acd25159e9a7188e85ce..31f02d0b46a7e5d508ab7fbd7670e7026e10224d 100644 (file)
@@ -1877,7 +1877,7 @@ extern void              skb_split(struct sk_buff *skb,
 extern int            skb_shift(struct sk_buff *tgt, struct sk_buff *skb,
                                 int shiftlen);
 
-extern struct sk_buff *skb_segment(struct sk_buff *skb, int features);
+extern struct sk_buff *skb_segment(struct sk_buff *skb, u32 features);
 
 static inline void *skb_header_pointer(const struct sk_buff *skb, int offset,
                                       int len, void *buffer)
index dc07495bce4cb0dc7807bdaa390d62881fc7d614..6f7eb800974af3fae4c12a7d054d8e61d9e2cf9f 100644 (file)
@@ -38,7 +38,7 @@ struct net_protocol {
        void                    (*err_handler)(struct sk_buff *skb, u32 info);
        int                     (*gso_send_check)(struct sk_buff *skb);
        struct sk_buff         *(*gso_segment)(struct sk_buff *skb,
-                                              int features);
+                                              u32 features);
        struct sk_buff        **(*gro_receive)(struct sk_buff **head,
                                               struct sk_buff *skb);
        int                     (*gro_complete)(struct sk_buff *skb);
@@ -57,7 +57,7 @@ struct inet6_protocol {
 
        int     (*gso_send_check)(struct sk_buff *skb);
        struct sk_buff *(*gso_segment)(struct sk_buff *skb,
-                                      int features);
+                                      u32 features);
        struct sk_buff **(*gro_receive)(struct sk_buff **head,
                                        struct sk_buff *skb);
        int     (*gro_complete)(struct sk_buff *skb);
index 38509f047382c35b7b5d06211f3feaa0820eacb4..917911165e3bb885cf479821971e48f8efd234df 100644 (file)
@@ -1404,7 +1404,7 @@ extern struct request_sock_ops tcp6_request_sock_ops;
 extern void tcp_v4_destroy_sock(struct sock *sk);
 
 extern int tcp_v4_gso_send_check(struct sk_buff *skb);
-extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features);
+extern struct sk_buff *tcp_tso_segment(struct sk_buff *skb, u32 features);
 extern struct sk_buff **tcp_gro_receive(struct sk_buff **head,
                                        struct sk_buff *skb);
 extern struct sk_buff **tcp4_gro_receive(struct sk_buff **head,
index bb967dd59bf74fa5abac83964486fabc4398cabd..e82f3a8c0f8f45b28134e2522ab1d57ebb73f7c7 100644 (file)
@@ -245,5 +245,5 @@ extern void udp4_proc_exit(void);
 extern void udp_init(void);
 
 extern int udp4_ufo_send_check(struct sk_buff *skb);
-extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, int features);
+extern struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, u32 features);
 #endif /* _UDP_H */
index 6e64f7c6a2e9265b2afecbe6eb8f09c30bef55d6..7850412f52b7e23f817969fea24a560bcbdda4e8 100644 (file)
@@ -327,7 +327,7 @@ static void vlan_sync_address(struct net_device *dev,
 static void vlan_transfer_features(struct net_device *dev,
                                   struct net_device *vlandev)
 {
-       unsigned long old_features = vlandev->features;
+       u32 old_features = vlandev->features;
 
        vlandev->features &= ~dev->vlan_features;
        vlandev->features |= dev->features & dev->vlan_features;
index d9d1e2bac1d6efc826ed3ef826a91cd06bba78ca..52ce4a30f8b332d1c6e860d637d0e58927a9da94 100644 (file)
@@ -365,7 +365,7 @@ int br_min_mtu(const struct net_bridge *br)
 void br_features_recompute(struct net_bridge *br)
 {
        struct net_bridge_port *p;
-       unsigned long features, mask;
+       u32 features, mask;
 
        features = mask = br->feature_mask;
        if (list_empty(&br->port_list))
index 84aac7734bfc7e2c219680dc48d8c3ba75ca6924..9f22898c53596dab86eefeb004741b07fab6e02a 100644 (file)
@@ -182,7 +182,7 @@ struct net_bridge
        struct br_cpu_netstats __percpu *stats;
        spinlock_t                      hash_lock;
        struct hlist_head               hash[BR_HASH_SIZE];
-       unsigned long                   feature_mask;
+       u32                             feature_mask;
 #ifdef CONFIG_BRIDGE_NETFILTER
        struct rtable                   fake_rtable;
        bool                            nf_call_iptables;
index ad3741898584b0024fe28a920d4360be86a2729a..7103f89fde0c9446713e384a1fc52df38673d773 100644 (file)
@@ -1858,7 +1858,7 @@ EXPORT_SYMBOL(skb_checksum_help);
  *     It may return NULL if the skb requires no segmentation.  This is
  *     only possible when GSO is used for verifying header integrity.
  */
-struct sk_buff *skb_gso_segment(struct sk_buff *skb, int features)
+struct sk_buff *skb_gso_segment(struct sk_buff *skb, u32 features)
 {
        struct sk_buff *segs = ERR_PTR(-EPROTONOSUPPORT);
        struct packet_type *ptype;
@@ -2046,7 +2046,7 @@ static bool can_checksum_protocol(unsigned long features, __be16 protocol)
                 protocol == htons(ETH_P_FCOE)));
 }
 
-static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features)
+static u32 harmonize_features(struct sk_buff *skb, __be16 protocol, u32 features)
 {
        if (!can_checksum_protocol(features, protocol)) {
                features &= ~NETIF_F_ALL_CSUM;
@@ -2058,10 +2058,10 @@ static int harmonize_features(struct sk_buff *skb, __be16 protocol, int features
        return features;
 }
 
-int netif_skb_features(struct sk_buff *skb)
+u32 netif_skb_features(struct sk_buff *skb)
 {
        __be16 protocol = skb->protocol;
-       int features = skb->dev->features;
+       u32 features = skb->dev->features;
 
        if (protocol == htons(ETH_P_8021Q)) {
                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,
        int rc = NETDEV_TX_OK;
 
        if (likely(!skb->next)) {
-               int features;
+               u32 features;
 
                /*
                 * If device doesnt need skb->dst, release it right now while
@@ -5213,7 +5213,7 @@ static void rollback_registered(struct net_device *dev)
        rollback_registered_many(&single);
 }
 
-unsigned long netdev_fix_features(unsigned long features, const char *name)
+u32 netdev_fix_features(u32 features, const char *name)
 {
        /* Fix illegal checksum combinations */
        if ((features & NETIF_F_HW_CSUM) &&
@@ -6143,8 +6143,7 @@ static int dev_cpu_callback(struct notifier_block *nfb,
  *     @one to the master device with current feature set @all.  Will not
  *     enable anything that is off in @mask. Returns the new feature set.
  */
-unsigned long netdev_increment_features(unsigned long all, unsigned long one,
-                                       unsigned long mask)
+u32 netdev_increment_features(u32 all, u32 one, u32 mask)
 {
        /* If device needs checksumming, downgrade to it. */
        if (all & NETIF_F_NO_CSUM && !(one & NETIF_F_NO_CSUM))
index 17741782a345f78328a881da5887f6e81834f5b6..bd1af99e112288065a3099344ad70d3b2afe7dc6 100644 (file)
@@ -1458,7 +1458,7 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
        void __user *useraddr = ifr->ifr_data;
        u32 ethcmd;
        int rc;
-       unsigned long old_features;
+       u32 old_features;
 
        if (!dev || !netif_device_present(dev))
                return -ENODEV;
index e23c01be5a5bdf27012ab839f05abd5a9366532f..81367ccf3306090a5f0747a64be87c03b2ef0574 100644 (file)
@@ -99,7 +99,7 @@ NETDEVICE_SHOW(addr_assign_type, fmt_dec);
 NETDEVICE_SHOW(addr_len, fmt_dec);
 NETDEVICE_SHOW(iflink, fmt_dec);
 NETDEVICE_SHOW(ifindex, fmt_dec);
-NETDEVICE_SHOW(features, fmt_long_hex);
+NETDEVICE_SHOW(features, fmt_hex);
 NETDEVICE_SHOW(type, fmt_dec);
 NETDEVICE_SHOW(link_mode, fmt_dec);
 
index d31bb36ae0dc21cfdab61b90dd2f2fbfd665ce81..436c4c439240f5cc6f01503881cda0138d71a599 100644 (file)
@@ -2497,7 +2497,7 @@ EXPORT_SYMBOL_GPL(skb_pull_rcsum);
  *     a pointer to the first in a list of new skbs for the segments.
  *     In case of error it returns ERR_PTR(err).
  */
-struct sk_buff *skb_segment(struct sk_buff *skb, int features)
+struct sk_buff *skb_segment(struct sk_buff *skb, u32 features)
 {
        struct sk_buff *segs = NULL;
        struct sk_buff *tail = NULL;
@@ -2507,7 +2507,7 @@ struct sk_buff *skb_segment(struct sk_buff *skb, int features)
        unsigned int offset = doffset;
        unsigned int headroom;
        unsigned int len;
-       int sg = features & NETIF_F_SG;
+       int sg = !!(features & NETIF_F_SG);
        int nfrags = skb_shinfo(skb)->nr_frags;
        int err = -ENOMEM;
        int i = 0;
index f2b61107df6cd8066d7e3568b1625de309966522..e5e2d9d64abbc8a3804c08e8eeacbf9c674cbb22 100644 (file)
@@ -1215,7 +1215,7 @@ out:
        return err;
 }
 
-static struct sk_buff *inet_gso_segment(struct sk_buff *skb, int features)
+static struct sk_buff *inet_gso_segment(struct sk_buff *skb, u32 features)
 {
        struct sk_buff *segs = ERR_PTR(-EINVAL);
        struct iphdr *iph;
index 6c11eece262cf77a377a9fa901f4031c46745205..f9867d2dbef43978787508fbb73bb3982dd6fdcd 100644 (file)
@@ -2653,7 +2653,7 @@ int compat_tcp_getsockopt(struct sock *sk, int level, int optname,
 EXPORT_SYMBOL(compat_tcp_getsockopt);
 #endif
 
-struct sk_buff *tcp_tso_segment(struct sk_buff *skb, int features)
+struct sk_buff *tcp_tso_segment(struct sk_buff *skb, u32 features)
 {
        struct sk_buff *segs = ERR_PTR(-EINVAL);
        struct tcphdr *th;
index 8157b17959eeb78ce317b3f0ce82668fde0a70fd..d37baaa1dbe3c0d9f0dbd69e2f3e77b5a5523d94 100644 (file)
@@ -2199,7 +2199,7 @@ int udp4_ufo_send_check(struct sk_buff *skb)
        return 0;
 }
 
-struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, int features)
+struct sk_buff *udp4_ufo_fragment(struct sk_buff *skb, u32 features)
 {
        struct sk_buff *segs = ERR_PTR(-EINVAL);
        unsigned int mss;
index 978e80e2c4a8a08e7731150d2a43a42fe9827e68..3194aa909872c2e7df0bd5cbb4e73b1e3d7ddd7c 100644 (file)
@@ -772,7 +772,7 @@ out:
        return err;
 }
 
-static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, int features)
+static struct sk_buff *ipv6_gso_segment(struct sk_buff *skb, u32 features)
 {
        struct sk_buff *segs = ERR_PTR(-EINVAL);
        struct ipv6hdr *ipv6h;
index 9a009c66c8a3dd549262aeeb392bf68ec60c5fd4..a419a787eb699d2da79ca095d0dcf49282401511 100644 (file)
@@ -1299,7 +1299,7 @@ static int udp6_ufo_send_check(struct sk_buff *skb)
        return 0;
 }
 
-static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, int features)
+static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
 {
        struct sk_buff *segs = ERR_PTR(-EINVAL);
        unsigned int mss;