Convert features fields from u32 to type u64
Subsystems (7)
cover Convert features fields from u32 to type u64
Mahesh Bandewar (9):
net-dev: Convert (hw_/vlan_/wanted_)features fields from u32 type to
u64
net-ethtool: Convert (hw_/vlan_/wanted_)features fields from u32 type
to u64.
net-core: Convert (hw_/vlan_/wanted_)features fields from u32 type to
u64.
net-tcp: Convert (hw_/vlan_/wanted_)features fields from u32 type to
u64.
net-udp: Convert (hw_/vlan_/wanted_)features fields from u32 type to
u64.
net-vlan: Convert (hw_/vlan_/wanted_)features fields from u32 type to
u64.
net-bridge: Convert (hw_/vlan_/wanted_)features fields from u32 type
to u64.
net-ipv4: Convert (hw_/vlan_/wanted_)features fields from u32 type to
u64.
net-ipv6: Convert (hw_/vlan_/wanted_)features fields from u32 type to
u64.include/linux/ethtool.h | 26 +++++++------ include/linux/netdevice.h | 86 ++++++++++++++++++++++---------------------- include/linux/skbuff.h | 2 +- include/net/protocol.h | 4 +- include/net/sock.h | 8 ++-- include/net/tcp.h | 2 +- include/net/udp.h | 2 +- net/8021q/vlan_dev.c | 2 +- net/bridge/br_if.c | 2 +- net/bridge/br_private.h | 2 +- net/core/dev.c | 26 +++++++------- net/core/ethtool.c | 89 ++++++++++++++++----------------------------- net/core/skbuff.c | 2 +- net/ipv4/af_inet.c | 2 +- net/ipv4/tcp.c | 2 +- net/ipv4/udp.c | 2 +- net/ipv6/af_inet6.c | 2 +- net/ipv6/udp.c | 2 +- 18 files changed, 119 insertions(+), 144 deletions(-)
Signature · 1 line
1.7.3.1
PATCH 1/9 net-dev: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64
--- include/linux/netdevice.h | 86 ++++++++++++++++++++++---------------------- net/core/dev.c | 26 +++++++------- 2 files changed, 56 insertions(+), 56 deletions(-)
include/linux/netdevice.h +43 -43
@@ -877,12 +877,12 @@ struct netdev_tc_txq {* Called to release previously enslaved netdev. * * Feature/offload setting functions. -* u32 (*ndo_fix_features)(struct net_device *dev, u32 features); +* u64 (*ndo_fix_features)(struct net_device *dev, u64 features); * Adjusts the requested feature flags according to device-specific * constraints, and returns the resulting flags. Must not modify * the device state. * -* int (*ndo_set_features)(struct net_device *dev, u32 features); +* int (*ndo_set_features)(struct net_device *dev, u64 features); * Called to update device configuration to new features. Passed * feature set might be less than what was returned by ndo_fix_features()). * Must return >0 or -errno if it changed dev->features itself.
@@ -974,10 +974,10 @@ struct net_device_ops { struct net_device *slave_dev);int (*ndo_del_slave)(struct net_device *dev,struct net_device *slave_dev); -u32 (*ndo_fix_features)(struct net_device *dev, -u32 features); +u64 (*ndo_fix_features)(struct net_device *dev, +u64 features);int (*ndo_set_features)(struct net_device *dev, -u32 features); +u64 features); };/*
@@ -1030,43 +1030,43 @@ struct net_device {struct list_head unreg_list;/* currently active device features */ -u32 features; +u64 features;/* user-changeable features */ -u32 hw_features; +u64 hw_features;/* user-requested features */ -u32 wanted_features; +u64 wanted_features;/* mask of features inheritable by VLAN devices */ -u32 vlan_features; +u64 vlan_features;/* Net device feature bits; if you change something, * also update netdev_features_strings[] in ethtool.c */ -#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. */ -#define NETIF_F_HW_CSUM 8/* Can checksum all the packets. */ -#define NETIF_F_IPV6_CSUM 16/* Can checksum TCP/UDP over IPV6 */ -#define NETIF_F_HIGHDMA 32/* Can DMA to high memory. */ -#define NETIF_F_FRAGLIST 64/* Scatter/gather IO. */ -#define NETIF_F_HW_VLAN_TX 128/* Transmit VLAN hw acceleration */ -#define NETIF_F_HW_VLAN_RX 256/* Receive VLAN hw acceleration */ -#define NETIF_F_HW_VLAN_FILTER 512/* Receive filtering on VLAN */ -#define NETIF_F_VLAN_CHALLENGED 1024/* Device cannot handle VLAN packets */ -#define NETIF_F_GSO 2048/* Enable software GSO. */ -#define NETIF_F_LLTX 4096/* LockLess TX - deprecated. Please */ -/* do not use LLTX in new drivers */ -#define NETIF_F_NETNS_LOCAL 8192/* Does not change network namespaces */ -#define NETIF_F_GRO 16384/* Generic receive offload */ -#define NETIF_F_LRO 32768/* large receive offload */ +#define NETIF_F_SG ((u64)1 << 0)/* Scatter/gather IO. */ +#define NETIF_F_IP_CSUM ((u64)1 << 1)/* Can checksum TCP/UDP over IPv4. */ +#define NETIF_F_NO_CSUM ((u64)1 << 2)/* Does not require checksum. F.e. loopack. */ +#define NETIF_F_HW_CSUM ((u64)1 << 3)/* Can checksum all the packets. */ +#define NETIF_F_IPV6_CSUM ((u64)1 << 4)/* Can checksum TCP/UDP over IPV6 */ +#define NETIF_F_HIGHDMA ((u64)1 << 5)/* Can DMA to high memory. */ +#define NETIF_F_FRAGLIST ((u64)1 << 6)/* Scatter/gather IO. */ +#define NETIF_F_HW_VLAN_TX ((u64)1 << 7)/* Transmit VLAN hw acceleration */ +#define NETIF_F_HW_VLAN_RX ((u64)1 << 8)/* Receive VLAN hw acceleration */ +#define NETIF_F_HW_VLAN_FILTER ((u64)1 << 9)/* Receive filtering on VLAN */ +#define NETIF_F_VLAN_CHALLENGED ((u64)1 << 10)/* Device cannot handle VLAN packets */ +#define NETIF_F_GSO ((u64)1 << 11)/* Enable software GSO. */ +#define NETIF_F_LLTX ((u64)1 << 12)/* LockLess TX - deprecated. Please */ +/* do not use LLTX in new drivers */ +#define NETIF_F_NETNS_LOCAL ((u64)1 << 13)/* Does not change network namespaces */ +#define NETIF_F_GRO ((u64)1 << 14)/* Generic receive offload */ +#define NETIF_F_LRO ((u64)1 << 15)/* large receive offload */ /* the GSO_MASK reserves bits 16 through 23 */ -#define NETIF_F_FCOE_CRC (1 << 24)/* FCoE CRC32 */ -#define NETIF_F_SCTP_CSUM (1 << 25)/* SCTP checksum offload */ -#define NETIF_F_FCOE_MTU (1 << 26)/* Supports max FCoE MTU, 2158 bytes*/ -#define NETIF_F_NTUPLE (1 << 27)/* N-tuple filters supported */ -#define NETIF_F_RXHASH (1 << 28)/* Receive hashing offload */ -#define NETIF_F_RXCSUM (1 << 29)/* Receive checksumming offload */ -#define NETIF_F_NOCACHE_COPY (1 << 30)/* Use no-cache copyfromuser */ +#define NETIF_F_FCOE_CRC ((u64)1 << 24)/* FCoE CRC32 */ +#define NETIF_F_SCTP_CSUM ((u64)1 << 25)/* SCTP checksum offload */ +#define NETIF_F_FCOE_MTU ((u64)1 << 26)/* Supports max FCoE MTU, 2158 bytes*/ +#define NETIF_F_NTUPLE ((u64)1 << 27)/* N-tuple filters supported */ +#define NETIF_F_RXHASH ((u64)1 << 28)/* Receive hashing offload */ +#define NETIF_F_RXCSUM ((u64)1 << 29)/* Receive checksumming offload */ +#define NETIF_F_NOCACHE_COPY ((u64)1 << 30)/* Use no-cache copyfromuser */ /* Segmentation offload features */ #define NETIF_F_GSO_SHIFT 16
@@ -1541,7 +1541,7 @@ struct packet_type { struct packet_type *, struct net_device *);struct sk_buff *(*gso_segment)(struct sk_buff *skb, -u32 features); +u64 features);int (*gso_send_check)(struct sk_buff *skb);struct sk_buff **(*gro_receive)(struct sk_buff **head,struct sk_buff *skb);
@@ -2518,7 +2518,7 @@ extern int netdev_set_master(struct net_device *dev, struct net_device *master)extern int netdev_set_bond_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,u32 features); +extern struct sk_buff *skb_gso_segment (struct sk_buff *skb,u64 features);#ifdef CONFIG_BUG extern void netdev_rx_csum_fault (struct net_device *dev);#else
@@ -2545,33 +2545,33 @@ extern char *netdev_drivername(const struct net_device *dev, char *buffer, int lextern void linkwatch_run_queue (void ); -static inline u32 netdev_get_wanted_features (struct net_device *dev) +static inline u64 netdev_get_wanted_features (struct net_device *dev) {return (dev->features & ~dev->hw_features) | dev->wanted_features; } -u32 netdev_increment_features (u32 all,u32 one,u32 mask); -u32 netdev_fix_features (struct net_device *dev,u32 features); +u64 netdev_increment_features (u64 all,u64 one,u64 mask); +u64 netdev_fix_features (struct net_device *dev,u64 features);int __netdev_update_features (struct net_device *dev);void netdev_update_features (struct net_device *dev);void netif_stacked_transfer_operstate (const struct net_device *rootdev,struct net_device *dev); -u32 netif_skb_features (struct sk_buff *skb); +u64 netif_skb_features (struct sk_buff *skb); -static inline int net_gso_ok (u32 features,int gso_type) +static inline u64 net_gso_ok (u64 features,int gso_type) { -int feature = gso_type <<NETIF_F_GSO_SHIFT ; +u64 feature = (u64 )gso_type <<NETIF_F_GSO_SHIFT ;return (features & feature) == feature; } -static inline int skb_gso_ok (struct sk_buff *skb,u32 features) +static inline int skb_gso_ok (struct sk_buff *skb,u64 features) {return net_gso_ok (features,skb_shinfo (skb)->gso_type) && (!skb_has_frag_list (skb) || (features &NETIF_F_FRAGLIST )); } -static inline int netif_needs_gso (struct sk_buff *skb,int features) +static inline int netif_needs_gso (struct sk_buff *skb,u64 features) {return skb_is_gso (skb) && (!skb_gso_ok (skb, features) ||unlikely (skb->ip_summed !=CHECKSUM_PARTIAL ));
net/core/dev.c +13 -13
@@ -1840,7 +1840,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,u32 features) +struct sk_buff *skb_gso_segment (struct sk_buff *skb,u64 features) {struct sk_buff *segs =ERR_PTR (-EPROTONOSUPPORT );struct packet_type *ptype;
@@ -1978,7 +1978,7 @@ static void dev_gso_skb_destructor(struct sk_buff *skb)* This function segments the given skb and stores the list of segments * in skb->next. */ -static int dev_gso_segment (struct sk_buff *skb,int features) +static int dev_gso_segment (struct sk_buff *skb,u64 features) {struct sk_buff *segs;
@@ -2017,7 +2017,7 @@ static inline void skb_orphan_try(struct sk_buff *skb) } } -static bool can_checksum_protocol (unsigned long features,__be16 protocol) +static bool can_checksum_protocol (u64 features,__be16 protocol) { return ((features & NETIF_F_GEN_CSUM) || ((features & NETIF_F_V4_CSUM) &&
@@ -2028,7 +2028,7 @@ static bool can_checksum_protocol(unsigned long features, __be16 protocol) protocol == htons(ETH_P_FCOE))); } -static u32 harmonize_features (struct sk_buff *skb,__be16 protocol,u32 features) +static u64 harmonize_features (struct sk_buff *skb,__be16 protocol,u64 features) {if (!can_checksum_protocol (features, protocol)) { features &= ~NETIF_F_ALL_CSUM ;
@@ -2040,10 +2040,10 @@ static u32 harmonize_features(struct sk_buff *skb, __be16 protocol, u32 featuresreturn features; } -u32 netif_skb_features (struct sk_buff *skb) +u64 netif_skb_features (struct sk_buff *skb) {__be16 protocol = skb->protocol; -u32 features = skb->dev->features; +u64 features = skb->dev->features;if (protocol ==htons (ETH_P_8021Q )) {struct vlan_ethhdr *veh = (struct vlan_ethhdr *)skb->data;
@@ -2072,7 +2072,7 @@ EXPORT_SYMBOL(netif_skb_features);* support DMA from it. */ static inline int skb_needs_linearize (struct sk_buff *skb, -int features) +u64 features) { return skb_is_nonlinear(skb) && ((skb_has_frag_list(skb) &&
@@ -2088,7 +2088,7 @@ int dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev,int rc =NETDEV_TX_OK ;if (likely (!skb->next)) { -u32 features; +u64 features;/* * If device doesn't need skb->dst, release it right now while
@@ -5185,7 +5185,7 @@ static void rollback_registered(struct net_device *dev)list_del (&single); } -u32 netdev_fix_features (struct net_device *dev,u32 features) +u64 netdev_fix_features (struct net_device *dev,u64 features) {/* Fix illegal checksum combinations */ if ((features & NETIF_F_HW_CSUM) &&
@@ -5248,7 +5248,7 @@ EXPORT_SYMBOL(netdev_fix_features);int __netdev_update_features (struct net_device *dev) { -u32 features; +u64 features;int err =0 ;ASSERT_RTNL ();
@@ -5264,7 +5264,7 @@ int __netdev_update_features(struct net_device *dev)if (dev->features == features)return 0 ; -netdev_info (dev,"Features changed: 0x%08x -> 0x%08x\n" , +netdev_info (dev,"Features changed: 0x%016x -> 0x%016x\n" , dev->features, features);if (dev->netdev_ops->ndo_set_features)
@@ -5272,7 +5272,7 @@ int __netdev_update_features(struct net_device *dev)if (unlikely (err <0 )) {netdev_err (dev, -"set_features() failed (%d); wanted 0x%08x, left 0x%08x\n" , +"set_features() failed (%d); wanted 0x%016x, left 0x%016x\n" , err, features, dev->features);return -1 ; }
@@ -6182,7 +6182,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. */ -u32 netdev_increment_features (u32 all,u32 one,u32 mask) +u64 netdev_increment_features (u64 all,u64 one,u64 mask) {/* If device needs checksumming, downgrade to it. */ if (all &NETIF_F_NO_CSUM && !(one &NETIF_F_NO_CSUM ))
Signature · 1 line
1.7.3.1
PATCH 2/9 net-ethtool: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
--- include/linux/ethtool.h | 26 +++++++------ net/core/ethtool.c | 89 ++++++++++++++++------------------------------ 2 files changed, 45 insertions(+), 70 deletions(-)
include/linux/ethtool.h +14 -12
@@ -605,10 +605,10 @@ struct ethtool_flash {* @never_changed: mask of features not changeable for any device */ struct ethtool_get_features_block { -__u32 available; -__u32 requested; -__u32 active; -__u32 never_changed; +__u64 available; +__u64 requested; +__u64 active; +__u64 never_changed; };/**
@@ -618,10 +618,11 @@ struct ethtool_get_features_block {* out: number of elements in features[] needed to hold all features * @features: state of features */ +/* TODO Why is this needed XXX */ struct ethtool_gfeatures {__u32 cmd;__u32 size; -struct ethtool_get_features_block features[0 ]; +struct ethtool_get_features_block features; };/**
@@ -630,8 +631,8 @@ struct ethtool_gfeatures {* @requested: values of features to be changed */ struct ethtool_set_features_block { -__u32 valid; -__u32 requested; +__u64 valid; +__u64 requested; };/**
@@ -640,10 +641,11 @@ struct ethtool_set_features_block {* @size: array size of the features[] array * @features: feature change masks */ +/* TODO Why is this needed XXX */ struct ethtool_sfeatures {__u32 cmd;__u32 size; -struct ethtool_set_features_block features[0 ]; +struct ethtool_set_features_block features; };/*
@@ -686,7 +688,7 @@ enum ethtool_sfeatures_retval_bits {#include <linux/rculist.h> /* needed by dev_disable_lro() */ -extern int __ethtool_set_flags (struct net_device *dev,u32 flags); +extern int __ethtool_set_flags (struct net_device *dev,u64 flags);struct ethtool_rx_ntuple_flow_spec_container {struct ethtool_rx_ntuple_flow_spec fs;
@@ -730,10 +732,10 @@ u32 ethtool_op_get_tso(struct net_device *dev);int ethtool_op_set_tso (struct net_device *dev,u32 data);u32 ethtool_op_get_ufo (struct net_device *dev);int ethtool_op_set_ufo (struct net_device *dev,u32 data); -u32 ethtool_op_get_flags (struct net_device *dev); -int ethtool_op_set_flags (struct net_device *dev,u32 data,u32 supported); +u64 ethtool_op_get_flags (struct net_device *dev); +int ethtool_op_set_flags (struct net_device *dev,u64 data,u64 supported);void ethtool_ntuple_flush (struct net_device *dev); -bool ethtool_invalid_flags (struct net_device *dev,u32 data,u32 supported); +bool ethtool_invalid_flags (struct net_device *dev,u64 data,u64 supported);/** * struct ethtool_ops - optional netdev operations
net/core/ethtool.c +31 -58
207 lines not on this page · raw message
Signature · 1 line
1.7.3.1
PATCH 3/9 net-core: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
--- include/linux/skbuff.h | 2 +- include/net/protocol.h | 4 ++-- include/net/sock.h | 8 ++++---- net/core/skbuff.c | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-)
include/linux/skbuff.h +1 -1
@@ -1880,7 +1880,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,u32 features); +extern struct sk_buff *skb_segment (struct sk_buff *skb,u64 features);static inline void *skb_header_pointer (const struct sk_buff *skb,int offset,int len,void *buffer)
include/net/protocol.h +2 -2
@@ -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, -u32 features); +u64 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, -u32 features); +u64 features);struct sk_buff **(*gro_receive)(struct sk_buff **head,struct sk_buff *skb);int (*gro_complete)(struct sk_buff *skb);
include/net/sock.h +4 -4
@@ -307,8 +307,8 @@ struct sock {kmemcheck_bitfield_end (flags);int sk_wmem_queued;gfp_t sk_allocation; -int sk_route_caps; -int sk_route_nocaps; +u64 sk_route_caps; +u64 sk_route_nocaps;int sk_gso_type;unsigned int sk_gso_max_size;int sk_rcvlowat;
@@ -1377,14 +1377,14 @@ extern struct dst_entry *__sk_dst_check(struct sock *sk, u32 cookie);extern struct dst_entry *sk_dst_check (struct sock *sk,u32 cookie); -static inline int sk_can_gso (const struct sock *sk) +static inline u64 sk_can_gso (const struct sock *sk) {return net_gso_ok (sk->sk_route_caps, sk->sk_gso_type); }extern void sk_setup_caps (struct sock *sk,struct dst_entry *dst); -static inline void sk_nocaps_add (struct sock *sk,int flags) +static inline void sk_nocaps_add (struct sock *sk,u64 flags) { sk->sk_route_nocaps |= flags; sk->sk_route_caps &= ~flags;
net/core/skbuff.c +1 -1
@@ -2494,7 +2494,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,u32 features) +struct sk_buff *skb_segment (struct sk_buff *skb,u64 features) {struct sk_buff *segs =NULL ;struct sk_buff *tail =NULL ;
Signature · 1 line
1.7.3.1
PATCH 9/9 net-ipv6: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
In reply to Mahesh Bandewar--- net/ipv6/af_inet6.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv6/af_inet6.c +1 -1
@@ -765,7 +765,7 @@ out:return err; } -static struct sk_buff *ipv6_gso_segment (struct sk_buff *skb,u32 features) +static struct sk_buff *ipv6_gso_segment (struct sk_buff *skb,u64 features) {struct sk_buff *segs =ERR_PTR (-EINVAL );struct ipv6hdr *ipv6h;
Signature · 1 line
1.7.3.1
PATCH 4/9 net-tcp: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
In reply to Mahesh Bandewar--- include/net/tcp.h | 2 +- net/ipv4/tcp.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/net/tcp.h +1 -1
@@ -1396,7 +1396,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,u32 features); +extern struct sk_buff *tcp_tso_segment (struct sk_buff *skb,u64 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,
net/ipv4/tcp.c +1 -1
@@ -2654,7 +2654,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,u32 features) +struct sk_buff *tcp_tso_segment (struct sk_buff *skb,u64 features) {struct sk_buff *segs =ERR_PTR (-EINVAL );struct tcphdr *th;
Signature · 1 line
1.7.3.1
PATCH 5/9 net-udp: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
--- include/net/udp.h | 2 +- net/ipv4/udp.c | 2 +- net/ipv6/udp.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
include/net/udp.h +1 -1
@@ -256,5 +256,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,u32 features); +extern struct sk_buff *udp4_ufo_fragment (struct sk_buff *skb,u64 features);#endif /* _UDP_H */
net/ipv4/udp.c +1 -1
@@ -2230,7 +2230,7 @@ int udp4_ufo_send_check(struct sk_buff *skb)return 0 ; } -struct sk_buff *udp4_ufo_fragment (struct sk_buff *skb,u32 features) +struct sk_buff *udp4_ufo_fragment (struct sk_buff *skb,u64 features) {struct sk_buff *segs =ERR_PTR (-EINVAL );unsigned int mss;
net/ipv6/udp.c +1 -1
@@ -1295,7 +1295,7 @@ static int udp6_ufo_send_check(struct sk_buff *skb)return 0 ; } -static struct sk_buff *udp6_ufo_fragment (struct sk_buff *skb,u32 features) +static struct sk_buff *udp6_ufo_fragment (struct sk_buff *skb,u64 features) {struct sk_buff *segs =ERR_PTR (-EINVAL );unsigned int mss;
Signature · 1 line
1.7.3.1
PATCH 6/9 net-vlan: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
--- net/8021q/vlan_dev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/8021q/vlan_dev.c +1 -1
@@ -586,7 +586,7 @@ static void vlan_dev_uninit(struct net_device *dev) } } -static u32 vlan_dev_fix_features (struct net_device *dev,u32 features) +static u64 vlan_dev_fix_features (struct net_device *dev,u64 features) {struct net_device *real_dev =vlan_dev_info (dev)->real_dev;
Signature · 1 line
1.7.3.1
PATCH 8/9 net-ipv4: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
In reply to Mahesh Bandewar--- net/ipv4/af_inet.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
net/ipv4/af_inet.c +1 -1
@@ -1219,7 +1219,7 @@ out:return err; } -static struct sk_buff *inet_gso_segment (struct sk_buff *skb,u32 features) +static struct sk_buff *inet_gso_segment (struct sk_buff *skb,u64 features) {struct sk_buff *segs =ERR_PTR (-EINVAL );struct iphdr *iph;
Signature · 1 line
1.7.3.1
PATCH 7/9 net-bridge: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
In reply to Mahesh Bandewar--- net/bridge/br_if.c | 2 +- net/bridge/br_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
net/bridge/br_if.c +1 -1
@@ -294,7 +294,7 @@ int br_min_mtu(const struct net_bridge *br)void br_features_recompute (struct net_bridge *br) {struct net_bridge_port *p; -u32 features, mask; +u64 features, mask; features = mask = br->feature_mask;if (list_empty (&br->port_list))
net/bridge/br_private.h +1 -1
@@ -183,7 +183,7 @@ struct net_bridgestruct br_cpu_netstats __percpu *stats;spinlock_t hash_lock;struct hlist_head hash[BR_HASH_SIZE ]; -u32 feature_mask; +u64 feature_mask;#ifdef CONFIG_BRIDGE_NETFILTER struct rtable fake_rtable;bool nf_call_iptables;
Signature · 1 line
1.7.3.1
Re: [PATCH 2/9] net-ethtool: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
In reply to Mahesh BandewarQuoted 26 lines · Mahesh Bandewar
Signed-off-by Mahesh Bandewar <[email protected]>--- include/linux/ethtool.h | 26 +++++++------ net/core/ethtool.c | 89 ++++++++++++++++------------------------------ 2 files changed, 45 insertions(+), 70 deletions(-)include/linux/ethtool.h +4
-4@@ -605,10 +605,10 @@ struct ethtool_flash {* @never_changed: mask of features not changeable for any device */ struct ethtool_get_features_block { -__u32 available; -__u32 requested; -__u32 active; -__u32 never_changed; +__u64 available; +__u64 requested; +__u64 active; +__u64 never_changed; };/**
include/linux/ethtool.h struct ethtool_get_features_block { · line 621
Quoted 4 lines
include/linux/ethtool.h +1
-0@@ -618,10 +618,11 @@ struct ethtool_get_features_block {* out: number of elements in features[] needed to hold all features * @features: state of features */ +/* TODO Why is this needed XXX */
Precisely to allow for expansion to more than 32 bits.
Quoted 20 lines
include/linux/ethtool.h +3
-3struct ethtool_gfeatures {__u32 cmd;__u32 size; -struct ethtool_get_features_block features[0 ]; +struct ethtool_get_features_block features; };/** @@ -630,8 +631,8 @@ struct ethtool_gfeatures {* @requested: values of features to be changed */ struct ethtool_set_features_block { -__u32 valid; -__u32 requested; +__u64 valid; +__u64 requested; };/**
include/linux/ethtool.h struct ethtool_set_features_block { · line 649
Quoted 10 lines
include/linux/ethtool.h +2
-1@@ -640,10 +641,11 @@ struct ethtool_set_features_block {* @size: array size of the features[] array * @features: feature change masks */ +/* TODO Why is this needed XXX */ struct ethtool_sfeatures {__u32 cmd;__u32 size; -struct ethtool_set_features_block features[0 ]; +struct ethtool_set_features_block features; };
[...]
These structures are part of the userland API, but they are new in 2.6.39. So they can still be changed up until 2.6.39 is released, but not afterwards.
If we think 64 bits will be enough for the next 10 years, then let's just go with a single 64-bit feature word. If we're not so sure then then the ethtool API should continue to allow for multiple words (whether 32-bit or 64-bit).
Ben.
Signature · 3 lines
Ben Hutchings, Senior Software Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
David Miller
maintainerRe: [PATCH 2/9] net-ethtool: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
From: Ben Hutchings <[email protected]>
Date: Sun, 24 Apr 2011 06:30:40 +0100
Quoted 4 lines
If we think 64 bits will be enough for the next 10 years, then let's just go with a single 64-bit feature word. If we're not so sure then then the ethtool API should continue to allow for multiple words (whether 32-bit or 64-bit).
I think the ethtool facing stuff should stay as is.
Having total flexibility internally is important.
I know some people had reservations about using the bitmap interfaces, but that's what they exist for. The approach for the conversion just wasn't right.
My humble suggestion is:
1) Abstract away every access to these feature sets, like this.
void netdev_set_feature(struct net_device *netdev, int feature); void netdev_clear_feature(struct net_device *netdev, int feature); bool netdev_test_feature(struct net_device *netdev, int feature);
Then you can use whatever representation you want, without having to edit hundreds of files every time we want to change how these feature sets are stored.
Thus, after this, future changes will be painless.
This is a multi-commit change. First you add the interfaces, then you change the access sites in logical groups.
2) Write translators between the internal representation and the ethtool user-visible data structures we have for this stuff.
3) Pick an extensible set implementation and use it.
We may need to have a type that gets used to pass feature sets around, and if that's absolutely needed, then fine. But it has to be a typedef or similar, so that it can be changed without having to change every function signature every time we want to change the representation.
Re: [PATCH 2/9] net-ethtool: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
In reply to Mahesh Bandewar2011/4/23 Mahesh Bandewar <[email protected]>:
Quoted 14 lines
Signed-off-by Mahesh Bandewar <[email protected]>---
include/linux/ethtool.h | 26 +++++++------
net/core/ethtool.c | 89 ++++++++++++++++------------------------------2 files changed, 45 insertions(+), 70 deletions(-)include/linux/ethtool.h +0
-0@@ -605,10 +605,10 @@ struct ethtool_flash {* @never_changed: mask of features not changeable for any device */
include/linux/ethtool.h struct ethtool_flash { · line 612
Quoted 10 lines
include/linux/ethtool.h +4
-4struct ethtool_get_features_block { - __u32 available; - __u32 requested; - __u32 active; - __u32 never_changed; + __u64 available; + __u64 requested; + __u64 active; + __u64 never_changed; };
[...]
Please don't do it like this. G/SFEATURES were prepared to handle multiple words when needed. This means that it's enough to just split the u64 into two u32 sets represented in ethtool_get/set_features.
Best Regards,
Michał Mirosław
Re: [PATCH 2/9] net-ethtool: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
In reply to Ben HutchingsQuoted 25 lines · Ben Hutchings
Quoted 24 lines · Mahesh Bandewar
Signed-off-by Mahesh Bandewar <[email protected]>---
include/linux/ethtool.h | 26 +++++++------
net/core/ethtool.c | 89 ++++++++++++++++------------------------------2 files changed, 45 insertions(+), 70 deletions(-)include/linux/ethtool.h +4
-4@@ -605,10 +605,10 @@ struct ethtool_flash {* @never_changed: mask of features not changeable for any device */ struct ethtool_get_features_block { - __u32 available; - __u32 requested; - __u32 active; - __u32 never_changed; + __u64 available; + __u64 requested; + __u64 active; + __u64 never_changed; };
Quoted 9 lines
include/linux/ethtool.h struct ethtool_get_features_block { · line 621
Quoted 6 lines
include/linux/ethtool.h +1
-0/**@@ -618,10 +618,11 @@ struct ethtool_get_features_block {* out: number of elements in features[] needed to hold all features * @features: state of features */ +/* TODO Why is this needed XXX */ Precisely to allow for expansion to more than 32 bits.
:) That comment was not supposed to be part of the patch and was just to aid my thinking while we were discussing about the approach to extend features. (I thought) if we have decided not to use use arrays, then why to complicate this interface, so was attempting to simplify the interface.
Quoted 32 lines
Quoted 30 lines
include/linux/ethtool.h +5
-4struct ethtool_gfeatures { __u32 cmd; __u32 size; - struct ethtool_get_features_block features[0]; + struct ethtool_get_features_block features; }; /**@@ -630,8 +631,8 @@ struct ethtool_gfeatures {* @requested: values of features to be changed */ struct ethtool_set_features_block { - __u32 valid; - __u32 requested; + __u64 valid; + __u64 requested; }; /**@@ -640,10 +641,11 @@ struct ethtool_set_features_block {* @size: array size of the features[] array * @features: feature change masks */ +/* TODO Why is this needed XXX */ struct ethtool_sfeatures { __u32 cmd; __u32 size; - struct ethtool_set_features_block features[0]; + struct ethtool_set_features_block features; };[...]
Quoted 4 lines
These structures are part of the userland API, but they are new in 2.6.39. So they can still be changed up until 2.6.39 is released, but not afterwards.
got it!
Quoted 5 lines
If we think 64 bits will be enough for the next 10 years, then let's just go with a single 64-bit feature word. If we're not so sure then then the ethtool API should continue to allow for multiple words (whether 32-bit or 64-bit).
I think even 64 bits may not be enough, so in the earlier thread I had mentioned that, this would (probably) give us next two years! I didn't know this constraint though.
--mahesh..
Quoted 8 lines
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.