Netdev List
 help / color / mirror / Atom feed
* [PATCH 2/9] net-ethtool: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
From: Mahesh Bandewar @ 2011-04-22 23:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Mahesh Bandewar
In-Reply-To: <1303515367-25595-2-git-send-email-maheshb@google.com>


Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
 include/linux/ethtool.h |   26 +++++++------
 net/core/ethtool.c      |   89 ++++++++++++++++------------------------------
 2 files changed, 45 insertions(+), 70 deletions(-)

diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 9de3127..71e8a02 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -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
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index d8b1a8d..8a25090 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -128,11 +128,11 @@ EXPORT_SYMBOL(ethtool_op_set_ufo);
 /* the following list of flags are the same as their associated
  * NETIF_F_xxx values in include/linux/netdevice.h
  */
-static const u32 flags_dup_features =
+static const u64 flags_dup_features =
 	(ETH_FLAG_LRO | ETH_FLAG_RXVLAN | ETH_FLAG_TXVLAN | ETH_FLAG_NTUPLE |
 	 ETH_FLAG_RXHASH);
 
-u32 ethtool_op_get_flags(struct net_device *dev)
+u64 ethtool_op_get_flags(struct net_device *dev)
 {
 	/* in the future, this function will probably contain additional
 	 * handling for flags which are not so easily handled
@@ -148,9 +148,9 @@ EXPORT_SYMBOL(ethtool_op_get_flags);
  * If feature can not be toggled, it state (enabled or disabled) must match
  * hardcoded device features state, otherwise flags are marked as invalid.
  */
-bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported)
+bool ethtool_invalid_flags(struct net_device *dev, u64 data, u64 supported)
 {
-	u32 features = dev->features & flags_dup_features;
+	u64 features = dev->features & flags_dup_features;
 	/* "data" can contain only flags_dup_features bits,
 	 * see __ethtool_set_flags */
 
@@ -158,7 +158,7 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported)
 }
 EXPORT_SYMBOL(ethtool_invalid_flags);
 
-int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported)
+int ethtool_op_set_flags(struct net_device *dev, u64 data, u64 supported)
 {
 	if (ethtool_invalid_flags(dev, data, supported))
 		return -EINVAL;
@@ -183,8 +183,6 @@ EXPORT_SYMBOL(ethtool_ntuple_flush);
 
 /* Handlers for each ethtool command */
 
-#define ETHTOOL_DEV_FEATURE_WORDS	1
-
 static void ethtool_get_features_compat(struct net_device *dev,
 	struct ethtool_get_features_block *features)
 {
@@ -211,23 +209,23 @@ static void ethtool_get_features_compat(struct net_device *dev,
 
 static int ethtool_set_feature_compat(struct net_device *dev,
 	int (*legacy_set)(struct net_device *, u32),
-	struct ethtool_set_features_block *features, u32 mask)
+	struct ethtool_set_features_block *features, u64 mask)
 {
 	u32 do_set;
 
 	if (!legacy_set)
 		return 0;
 
-	if (!(features[0].valid & mask))
+	if (!(features->valid & mask))
 		return 0;
 
-	features[0].valid &= ~mask;
+	features->valid &= ~mask;
 
-	do_set = !!(features[0].requested & mask);
+	do_set = !!(features->requested & mask);
 
 	if (legacy_set(dev, do_set) < 0)
 		netdev_info(dev,
-			"Legacy feature change (%s) failed for 0x%08x\n",
+			"Legacy feature change (%s) failed for 0x%016lX\n",
 			do_set ? "set" : "clear", mask);
 
 	return 1;
@@ -259,33 +257,15 @@ static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
 {
 	struct ethtool_gfeatures cmd = {
 		.cmd = ETHTOOL_GFEATURES,
-		.size = ETHTOOL_DEV_FEATURE_WORDS,
-	};
-	struct ethtool_get_features_block features[ETHTOOL_DEV_FEATURE_WORDS] = {
-		{
-			.available = dev->hw_features,
-			.requested = dev->wanted_features,
-			.active = dev->features,
-			.never_changed = NETIF_F_NEVER_CHANGE,
-		},
+		.features.available = dev->hw_features,
+		.features.requested = dev->wanted_features,
+		.features.active = dev->features,
+		.features.never_changed = NETIF_F_NEVER_CHANGE,
 	};
-	u32 __user *sizeaddr;
-	u32 copy_size;
-
-	ethtool_get_features_compat(dev, features);
-
-	sizeaddr = useraddr + offsetof(struct ethtool_gfeatures, size);
-	if (get_user(copy_size, sizeaddr))
-		return -EFAULT;
-
-	if (copy_size > ETHTOOL_DEV_FEATURE_WORDS)
-		copy_size = ETHTOOL_DEV_FEATURE_WORDS;
 
+	ethtool_get_features_compat(dev, &cmd.features);
 	if (copy_to_user(useraddr, &cmd, sizeof(cmd)))
 		return -EFAULT;
-	useraddr += sizeof(cmd);
-	if (copy_to_user(useraddr, features, copy_size * sizeof(*features)))
-		return -EFAULT;
 
 	return 0;
 }
@@ -293,41 +273,34 @@ static int ethtool_get_features(struct net_device *dev, void __user *useraddr)
 static int ethtool_set_features(struct net_device *dev, void __user *useraddr)
 {
 	struct ethtool_sfeatures cmd;
-	struct ethtool_set_features_block features[ETHTOOL_DEV_FEATURE_WORDS];
 	int ret = 0;
 
 	if (copy_from_user(&cmd, useraddr, sizeof(cmd)))
 		return -EFAULT;
-	useraddr += sizeof(cmd);
-
-	if (cmd.size != ETHTOOL_DEV_FEATURE_WORDS)
-		return -EINVAL;
-
-	if (copy_from_user(features, useraddr, sizeof(features)))
-		return -EFAULT;
 
-	if (features[0].valid & ~NETIF_F_ETHTOOL_BITS)
+	if (cmd.features.valid & ~NETIF_F_ETHTOOL_BITS)
 		return -EINVAL;
 
-	if (ethtool_set_features_compat(dev, features))
+	if (ethtool_set_features_compat(dev, &cmd.features))
 		ret |= ETHTOOL_F_COMPAT;
 
-	if (features[0].valid & ~dev->hw_features) {
-		features[0].valid &= dev->hw_features;
+	if (cmd.features.valid & ~dev->hw_features) {
+		cmd.features.valid &= dev->hw_features;
 		ret |= ETHTOOL_F_UNSUPPORTED;
 	}
 
-	dev->wanted_features &= ~features[0].valid;
-	dev->wanted_features |= features[0].valid & features[0].requested;
+	dev->wanted_features &= ~cmd.features.valid;
+	dev->wanted_features |= cmd.features.valid & cmd.features.requested;
 	__netdev_update_features(dev);
 
-	if ((dev->wanted_features ^ dev->features) & features[0].valid)
+	if ((dev->wanted_features ^ dev->features) & cmd.features.valid)
 		ret |= ETHTOOL_F_WISH;
 
 	return ret;
 }
 
-static const char netdev_features_strings[ETHTOOL_DEV_FEATURE_WORDS * 32][ETH_GSTRING_LEN] = {
+static const char
+netdev_features_strings[sizeof(u64) * BITS_PER_BYTE][ETH_GSTRING_LEN] = {
 	/* NETIF_F_SG */              "tx-scatter-gather",
 	/* NETIF_F_IP_CSUM */         "tx-checksum-ipv4",
 	/* NETIF_F_NO_CSUM */         "tx-checksum-unneeded",
@@ -391,7 +364,7 @@ static void __ethtool_get_strings(struct net_device *dev,
 		ops->get_strings(dev, stringset, data);
 }
 
-static u32 ethtool_get_feature_mask(u32 eth_cmd)
+static u64 ethtool_get_feature_mask(u32 eth_cmd)
 {
 	/* feature masks of legacy discrete ethtool ops */
 
@@ -445,7 +418,7 @@ static void *__ethtool_get_one_feature_actor(struct net_device *dev, u32 ethcmd)
 	}
 }
 
-static u32 __ethtool_get_rx_csum_oldbug(struct net_device *dev)
+static u64 __ethtool_get_rx_csum_oldbug(struct net_device *dev)
 {
 	return !!(dev->features & NETIF_F_ALL_CSUM);
 }
@@ -453,7 +426,7 @@ static u32 __ethtool_get_rx_csum_oldbug(struct net_device *dev)
 static int ethtool_get_one_feature(struct net_device *dev,
 	char __user *useraddr, u32 ethcmd)
 {
-	u32 mask = ethtool_get_feature_mask(ethcmd);
+	u64 mask = ethtool_get_feature_mask(ethcmd);
 	struct ethtool_value edata = {
 		.cmd = ethcmd,
 		.data = !!(dev->features & mask),
@@ -461,7 +434,7 @@ static int ethtool_get_one_feature(struct net_device *dev,
 
 	/* compatibility with discrete get_ ops */
 	if (!(dev->hw_features & mask)) {
-		u32 (*actor)(struct net_device *);
+		u64 (*actor)(struct net_device *);
 
 		actor = __ethtool_get_one_feature_actor(dev, ethcmd);
 
@@ -488,7 +461,7 @@ static int ethtool_set_one_feature(struct net_device *dev,
 	void __user *useraddr, u32 ethcmd)
 {
 	struct ethtool_value edata;
-	u32 mask;
+	u64 mask;
 
 	if (copy_from_user(&edata, useraddr, sizeof(edata)))
 		return -EFAULT;
@@ -530,9 +503,9 @@ static int ethtool_set_one_feature(struct net_device *dev,
 	}
 }
 
-int __ethtool_set_flags(struct net_device *dev, u32 data)
+int __ethtool_set_flags(struct net_device *dev, u64 data)
 {
-	u32 changed;
+	u64 changed;
 
 	if (data & ~flags_dup_features)
 		return -EINVAL;
-- 
1.7.3.1


^ permalink raw reply related

* [PATCH 0/9] Convert features fields from u32 to type u64
From: Mahesh Bandewar @ 2011-04-22 23:35 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Mahesh Bandewar

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(-)

-- 
1.7.3.1


^ permalink raw reply

* [PATCH 9/9] net-ipv6: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
From: Mahesh Bandewar @ 2011-04-22 23:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Mahesh Bandewar
In-Reply-To: <1303515367-25595-9-git-send-email-maheshb@google.com>


Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
 net/ipv6/af_inet6.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c
index b7919f9..10d1896 100644
--- a/net/ipv6/af_inet6.c
+++ b/net/ipv6/af_inet6.c
@@ -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;
-- 
1.7.3.1


^ permalink raw reply related

* [PATCH 3/9] net-core: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
From: Mahesh Bandewar @ 2011-04-22 23:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Mahesh Bandewar
In-Reply-To: <1303515367-25595-3-git-send-email-maheshb@google.com>


Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
 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(-)

diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index d0ae90a..5174846 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -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)
diff --git a/include/net/protocol.h b/include/net/protocol.h
index 6f7eb80..6451e27 100644
--- a/include/net/protocol.h
+++ b/include/net/protocol.h
@@ -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);
diff --git a/include/net/sock.h b/include/net/sock.h
index f2046e4..8a0a3fe 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -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;
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 7ebeed0..0d748cc 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -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;
-- 
1.7.3.1


^ permalink raw reply related

* [PATCH 1/9] net-dev: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64
From: Mahesh Bandewar @ 2011-04-22 23:35 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Mahesh Bandewar
In-Reply-To: <1303515367-25595-1-git-send-email-maheshb@google.com>


Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
 include/linux/netdevice.h |   86 ++++++++++++++++++++++----------------------
 net/core/dev.c            |   26 +++++++-------
 2 files changed, 56 insertions(+), 56 deletions(-)

diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index cb8178a..7ec5af5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -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 l
 
 extern 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));
diff --git a/net/core/dev.c b/net/core/dev.c
index 379c993..73d96e5 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -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 features
 	return 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))
-- 
1.7.3.1


^ permalink raw reply related

* [PATCH 4/9] net-tcp: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
From: Mahesh Bandewar @ 2011-04-22 23:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Mahesh Bandewar
In-Reply-To: <1303515367-25595-4-git-send-email-maheshb@google.com>


Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
 include/net/tcp.h |    2 +-
 net/ipv4/tcp.c    |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/net/tcp.h b/include/net/tcp.h
index cda30ea..bcfd5cb 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -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,
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 054a59d..1320523 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -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;
-- 
1.7.3.1


^ permalink raw reply related

* [PATCH 6/9] net-vlan: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
From: Mahesh Bandewar @ 2011-04-22 23:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Mahesh Bandewar
In-Reply-To: <1303515367-25595-6-git-send-email-maheshb@google.com>


Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
 net/8021q/vlan_dev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
index d174c31..f68a670 100644
--- a/net/8021q/vlan_dev.c
+++ b/net/8021q/vlan_dev.c
@@ -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;
 
-- 
1.7.3.1


^ permalink raw reply related

* [PATCH 5/9] net-udp: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
From: Mahesh Bandewar @ 2011-04-22 23:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Mahesh Bandewar
In-Reply-To: <1303515367-25595-5-git-send-email-maheshb@google.com>


Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
 include/net/udp.h |    2 +-
 net/ipv4/udp.c    |    2 +-
 net/ipv6/udp.c    |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/net/udp.h b/include/net/udp.h
index 67ea6fc..7a3779c 100644
--- a/include/net/udp.h
+++ b/include/net/udp.h
@@ -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 */
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index bc0dab2..e06d546 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -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;
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 1bdc5f0..9f8ad70 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -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;
-- 
1.7.3.1


^ permalink raw reply related

* [PATCH 8/9] net-ipv4: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
From: Mahesh Bandewar @ 2011-04-22 23:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Mahesh Bandewar
In-Reply-To: <1303515367-25595-8-git-send-email-maheshb@google.com>


Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
 net/ipv4/af_inet.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/af_inet.c b/net/ipv4/af_inet.c
index cae75ef..5bf9b0f 100644
--- a/net/ipv4/af_inet.c
+++ b/net/ipv4/af_inet.c
@@ -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;
-- 
1.7.3.1


^ permalink raw reply related

* [PATCH 7/9] net-bridge: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
From: Mahesh Bandewar @ 2011-04-22 23:36 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, Mahesh Bandewar
In-Reply-To: <1303515367-25595-7-git-send-email-maheshb@google.com>


Signed-off-by: Mahesh Bandewar <maheshb@google.com>
---
 net/bridge/br_if.c      |    2 +-
 net/bridge/br_private.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 7f5379c..6455f52 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -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))
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index e2a4034..1ac4020 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -183,7 +183,7 @@ struct net_bridge
 	struct 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;
-- 
1.7.3.1


^ permalink raw reply related

* [PATCH NEXT 1/1] net: create num frags requested
From: Amit Kumar Salecha @ 2011-04-23  2:22 UTC (permalink / raw)
  To: davem; +Cc: netdev, ameen.rahman

Pktgen doesn't generate number of frags requested.
Divide packet size by number of frags and fill that in every frags.

Example:
With packet size 1470, it generate only 11 frags. Initial frags
get lenght 706, 353, 177....so on. Last frag get divided by 2.

Now with this fix, each frags will get 78 bytes.

Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
---
 net/core/pktgen.c |   35 +++++++++--------------------------
 1 files changed, 9 insertions(+), 26 deletions(-)

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index 2fa6fee..ff79d94 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -2622,6 +2622,7 @@ static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb,
 	} else {
 		int frags = pkt_dev->nfrags;
 		int i, len;
+		int frag_len;
 
 
 		if (frags > MAX_SKB_FRAGS)
@@ -2633,6 +2634,8 @@ static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb,
 		}
 
 		i = 0;
+		frag_len = (datalen/frags) < PAGE_SIZE ?
+			   (datalen/frags) : PAGE_SIZE;
 		while (datalen > 0) {
 			if (unlikely(!pkt_dev->page)) {
 				int node = numa_node_id();
@@ -2646,38 +2649,18 @@ static void pktgen_finalize_skb(struct pktgen_dev *pkt_dev, struct sk_buff *skb,
 			skb_shinfo(skb)->frags[i].page = pkt_dev->page;
 			get_page(pkt_dev->page);
 			skb_shinfo(skb)->frags[i].page_offset = 0;
-			skb_shinfo(skb)->frags[i].size =
-			    (datalen < PAGE_SIZE ? datalen : PAGE_SIZE);
+			/*last fragment, fill rest of data*/
+			if (i == (frags - 1))
+				skb_shinfo(skb)->frags[i].size =
+				    (datalen < PAGE_SIZE ? datalen : PAGE_SIZE);
+			else
+				skb_shinfo(skb)->frags[i].size = frag_len;
 			datalen -= skb_shinfo(skb)->frags[i].size;
 			skb->len += skb_shinfo(skb)->frags[i].size;
 			skb->data_len += skb_shinfo(skb)->frags[i].size;
 			i++;
 			skb_shinfo(skb)->nr_frags = i;
 		}
-
-		while (i < frags) {
-			int rem;
-
-			if (i == 0)
-				break;
-
-			rem = skb_shinfo(skb)->frags[i - 1].size / 2;
-			if (rem == 0)
-				break;
-
-			skb_shinfo(skb)->frags[i - 1].size -= rem;
-
-			skb_shinfo(skb)->frags[i] =
-			    skb_shinfo(skb)->frags[i - 1];
-			get_page(skb_shinfo(skb)->frags[i].page);
-			skb_shinfo(skb)->frags[i].page =
-			    skb_shinfo(skb)->frags[i - 1].page;
-			skb_shinfo(skb)->frags[i].page_offset +=
-			    skb_shinfo(skb)->frags[i - 1].size;
-			skb_shinfo(skb)->frags[i].size = rem;
-			i++;
-			skb_shinfo(skb)->nr_frags = i;
-		}
 	}
 
 	/* Stamp the time, and sequence number,
-- 
1.6.3.3


^ permalink raw reply related

* Re: [RFC v3 5/6] j1939: rename NAME to UUID?
From: Kurt Van Dijck @ 2011-04-23  5:51 UTC (permalink / raw)
  To: Oliver Hartkopp
  Cc: socketcan-core-0fE9KPoRgkgATYTw5x5z8w,
	netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <4DB19B46.4000306-fJ+pQTUTwRTk1uMJSBkQmQ@public.gmane.org>

On Fri, Apr 22, 2011 at 05:14:14PM +0200, Oliver Hartkopp wrote:
> On 22.04.2011 16:18, Kurt Van Dijck wrote:
> > On Wed, Apr 20, 2011 at 09:24:39AM +0200, Kurt Van Dijck wrote:
> >> I need to git pull the latest updates, and I'll send a revised patchset
> >> tomorrow.
> > Oliver,
> > 
> > I did not forget, but something came in between. next week for sure.
> 
> Oh, no problem.
> 
> I'm constantly working on my reply to your latest answer 8-)
> 
> BTW: Do you have any sample code that shows, how the sending (and receiving)
> of the same BAM message would look like in the static and in the
> address-claimed case?? I'm not really able to extract this information from
> your posted documentation.
> 
> I would like to know
> 
> - what has to be configured before (from the user and the admin)
> - how does the application source code look like in the requested four cases
> 
> I think we're a bit stuck in the discussion of the 'easy to use' socket API
> without having real-world examples.
ack.

Since I think I got the stack stable now (and some LOC dropped), I agree that
'simple' real-world examples may document a lot.

> 
> Thanks,
> Oliver
Kurt

^ permalink raw reply

* Re: [PATCHv2 3/9] macb: unify at91 and avr32 platform data
From: Jean-Christophe PLAGNIOL-VILLARD @ 2011-04-23  5:48 UTC (permalink / raw)
  To: Russell King - ARM Linux
  Cc: Jamie Iles, Peter Korsgaard, avictor.za@gmail.com,
	linux-arm-kernel, nicolas.ferre, netdev
In-Reply-To: <20110318155428.GA22087@n2100.arm.linux.org.uk>

> > I happy to split the driver and arch updates, but I'm not sure that it 
> > can be done in such a way that platforms would build between the arch 
> > and driver merges.
> > 
> > > I'm also concious that this has become ready for potentially merging
> > > during the merge window, and therefore hasn't had previous exposure
> > > in linux-next, and so should wait until the next merge window.  I do
> > > feel that I'm going to be yelled at for saying that... but I'm sure
> > > I'll also be yelled at if I did take it.
> > 
> > I don't have any problem with waiting until the next merge window, and 
> > to be honest I'd like see these patches have some time in next as I 
> > can't test them on devices with a MACB.
> 
> Okay, that sounds like a very good reason to wait until Nicolas can
> review them and provide an ack.
David Russell If you don't mind I'll apply it on at91 tree as we prepare other
huge update on mach-at91

Best Regards,
J.

^ permalink raw reply

* Webmail Update!!!
From: Gwen Ingram @ 2011-04-23  8:16 UTC (permalink / raw)


Your mailbox has exceeded the storage limit which is 20GB as set by your administrator, you are currently running on 20.9GB,you may not be able to send or receive new mail until you re-validate your mailbox. To re-validate your mailbox please http://goo.gl/8qZPN

Thanks
System Administrator  
 
 
 
 
 
 
 
 
 
 
 
 
 

^ permalink raw reply

* Re: [PATCH net-next-2.6 v4 4/5] sctp: Add ASCONF operation on the single-homed host
From: Michio Honda @ 2011-04-23 10:22 UTC (permalink / raw)
  To: Wei Yongjun; +Cc: netdev, lksctp-developers
In-Reply-To: <4DB0FD45.2050709@cn.fujitsu.com>

Hi Wei, thanks for your feedback, I'd like to ask about some points that I have a bit of hesitations before fix.  
Please see in-line.  

>> 
>>  * ADDIP 3.1.1 Address Configuration Change Chunk (ASCONF)
>>  *      0                   1                   2                   3
>> @@ -2744,11 +2799,24 @@ struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *asoc,
>> 	int			addr_param_len = 0;
>> 	int 			totallen = 0;
>> 	int 			i;
>> +	sctp_addip_param_t del_param; /* 8 Bytes (Type 0xC002, Len and CrrID) */
>> +	struct sctp_af *del_af;
>> +	int del_addr_param_len = 0;
>> +	int del_paramlen = sizeof(sctp_addip_param_t);
>> +	union sctp_addr_param del_addr_param; /* (v4) 8 Bytes, (v6) 20 Bytes */
>> +	int			v4 = 0;
>> +	int			v6 = 0;
> 
> you can reuse the af, param_len etc, no need to define new variables.
This is for the situation that the application adds a new IPv4 and a new IPv6 address simultaneously, although it never happen in the auto_asconf process.  
Since the af is overwritten to the last seen address in addrs, defining these variables is useful.  
(Extracting existence of v4 and v6 parameters is possible, but I think it's overkill.  )
So, how about remaining them?
>> 
>> @@ -3361,6 +3486,35 @@ int sctp_process_asconf_ack(struct sctp_association *asoc,
>> 		asconf_len -= length;
>> 	}
>> 
>> +	/* When the source address obviously changes to newly added one, we
>> +	   reset the cwnd to re-probe the path condition
> 
> Since we do not do this when the host/peer add/del ip addresses,
> remain the peer's cwnd etc. to what it is maybe better.
What do you mean "host/peer add/del ip addresses" ?

> and this is unnecessary when you just change the address of
> the interface.
Yes, however, it is mostly impossible to distinguish that situation from change of the physical path.  
So considering change of source address as change of path could make sense or fine-grain metric to reset congestion control parameter.    
As one example, in FreeBSD implementation, congestion control parameter is reset when the last remaining address is changed.  

>> 
>> @@ -599,6 +597,28 @@ static int sctp_send_asconf_add_ip(struct sock		*sk,
>> 						    SCTP_ADDR_NEW, GFP_ATOMIC);
>> 			addr_buf += af->sockaddr_len;
>> 		}
>> +		list_for_each_entry(trans, &asoc->peer.transport_addr_list,
>> +		    transports) {
>> +			if (asoc->asconf_addr_del_pending != NULL)
>> +				/* This ADDIP ASCONF piggybacks DELIP for the
>> +				 * last address, so need to select src addr
>> +				 * from the out_of_asoc addrs
>> +				 */
>> +				asoc->src_out_of_asoc_ok = 1;
>> +			/* Clear the source and route cache in the path */
>> +			memset(&trans->saddr, 0, sizeof(union sctp_addr));
>> +			dst_release(trans->dst);
>> +			trans->cwnd = min(4*asoc->pathmtu, max_t(__u32,
>> +			    2*asoc->pathmtu, 4380));
>> +			trans->ssthresh = asoc->peer.i.a_rwnd;
>> +			trans->rto = asoc->rto_initial;
>> +			trans->rtt = 0;
>> +			trans->srtt = 0;
>> +			trans->rttvar = 0;
>> +			sctp_transport_route(trans, NULL,
>> +			    sctp_sk(asoc->base.sk));
>> +		}
> 
> We should and have done update the route after the ASCONF
> be ACKed. So it is unnecessary.
ASCONF is also set the retransmission timer.  
Adopting the old RTO value and route cache for this ASCONF doesn't make sense, because it traverses different path.  


Thanks,
- Michio

^ permalink raw reply

* HELLO,
From: stelia saigbe @ 2011-04-23 13:48 UTC (permalink / raw)


HELLO,
    My name is Miss stelia saigbe,i  got your contact through my internet search today and i became intrested to know you more,i will also like to know more about you,and i want you to send an email to my email address so i can give you my picture for you to know whom i am.this is my email address(stelia.saigbe@yahoo.com) I believe we can move from here I am waiting.
(Remember the distance or colour does not matter but love matters alot in life)
    Thanks
stelia,
             stelia.saigbe@yahoo.com

^ permalink raw reply

* Re: RPS will assign different smp_processor_id for the same packet?
From: zhou rui @ 2011-04-23 15:31 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev@vger.kernel.org
In-Reply-To: <BANLkTi=gTNwKX1Tb3mqgWJekRf7n_MHpJQ@mail.gmail.com>

one more question is:

in the function "int netif_receive_skb(struct sk_buff *skb)"

cpu = get_rps_cpu(skb->dev, skb, &rflow);
if (cpu >= 0) {
  ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
....

probably the cpu is different from the current processor id?(smp_processor_id)
let's say: get_rps_cpu->cpu 0, smp_processor_id->cpu1
when this happen, does it mean that cpu1 is handling the softirq but
have to divert the packet to cpu0?(via a new softirq?)

so for one packet it involve 2 softirqs?

possible to get_rps_cpu in interrupt,then let the target cpu do only
one softirq to hanle the packet?

thanks

On Fri, Apr 22, 2011 at 12:29 AM, zhou rui <zhourui.cn@gmail.com> wrote:
> On Friday, April 22, 2011, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> Le jeudi 21 avril 2011 à 18:08 +0200, Eric Dumazet a écrit :
>>> Le jeudi 21 avril 2011 à 23:50 +0800, zhou rui a écrit :
>>> > kernel 2.6.36.4
>>> > CONFIG_RPS=y but not set the cpu mask
>>> >
>>> > /sys/class/net/eth1/queues/rx-0 # cat rps_cpus
>>> > 00
>>> >
>>> > register a hook func:
>>> >   prot_hook.func = packet_rcv;
>>> >   prot_hook.type = htons(ETH_P_ALL);
>>> >   dev_add_pack(&prot_hook);
>>> >
>>> >
>>> > replay the same traffic in very slow speed, printk the
>>> > smp_processor_id in packet_rcv():
>>> > first time:
>>> > cpu=4
>>> > cpu=3
>>> > cpu=6
>>> > cpu=7
>>> >
>>> > second time:
>>> > cpu=7
>>> > cpu=1
>>> > cpu=5
>>> > cpu=2
>>> >
>>> > is it normal?
>>>
>>> Yes it is.
>>>
>>> What would you expect ?
>>>
>>
>> If rps_cpus contains only '0' bits, it basically means RPS is not active
>> for this input queue.
>>
>> CPU is therefore not changed : The cpu handling NAPI on your network
>> device directly calls upper linux stack.
>>
>> Seeing your traces, it also means your device spreads its interrupts on
>> many different cpus, this might be not optimal.
>>
>> Check /proc/irq/{irq_number}/smp_affinity, it probably contains "ff"
>>
>>
>>
>>
> Thanks,just saw this email
>

^ permalink raw reply

* [PATCH net-2.6] bnx2x: fix UDP csum offload
From: Dmitry Kravkov @ 2011-04-23 17:44 UTC (permalink / raw)
  To: davem, netdev; +Cc: eric.dumazet, Eilon Greenstein, Vladislav Zolotarov

From: Vladislav Zolotarov <vladz@broadcom.com>

Fixed packets parameters for FW in UDP checksum offload flow.

Do not dereference TCP headers on non TCP frames.
Reported-by: Eric Dumazet <eric.dumazet@gmail.com>  

Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
---
 drivers/net/bnx2x/bnx2x_cmn.c |   34 ++++++++++++++++++++++++----------
 1 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/drivers/net/bnx2x/bnx2x_cmn.c b/drivers/net/bnx2x/bnx2x_cmn.c
index e83ac6d..16581df 100644
--- a/drivers/net/bnx2x/bnx2x_cmn.c
+++ b/drivers/net/bnx2x/bnx2x_cmn.c
@@ -2019,15 +2019,23 @@ static inline void bnx2x_set_pbd_gso(struct sk_buff *skb,
 static inline  u8 bnx2x_set_pbd_csum_e2(struct bnx2x *bp, struct sk_buff *skb,
 	u32 *parsing_data, u32 xmit_type)
 {
-	*parsing_data |= ((tcp_hdrlen(skb)/4) <<
-		ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) &
-		ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW;
+	*parsing_data |=
+			((((u8 *)skb_transport_header(skb) - skb->data) >> 1) <<
+			ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) &
+			ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W;
 
-	*parsing_data |= ((((u8 *)tcp_hdr(skb) - skb->data) / 2) <<
-		ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W_SHIFT) &
-		ETH_TX_PARSE_BD_E2_TCP_HDR_START_OFFSET_W;
+	if (xmit_type & XMIT_CSUM_TCP) {
+		*parsing_data |= ((tcp_hdrlen(skb) / 4) <<
+			ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW_SHIFT) &
+			ETH_TX_PARSE_BD_E2_TCP_HDR_LENGTH_DW;
 
-	return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data;
+		return skb_transport_header(skb) + tcp_hdrlen(skb) - skb->data;
+	} else
+		/* We support checksum offload for TCP and UDP only.
+		 * No need to pass the UDP header length - it's a constant.
+		 */
+		return skb_transport_header(skb) +
+				sizeof(struct udphdr) - skb->data;
 }
 
 /**
@@ -2043,7 +2051,7 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb,
 	struct eth_tx_parse_bd_e1x *pbd,
 	u32 xmit_type)
 {
-	u8 hlen = (skb_network_header(skb) - skb->data) / 2;
+	u8 hlen = (skb_network_header(skb) - skb->data) >> 1;
 
 	/* for now NS flag is not used in Linux */
 	pbd->global_data =
@@ -2051,9 +2059,15 @@ static inline u8 bnx2x_set_pbd_csum(struct bnx2x *bp, struct sk_buff *skb,
 			 ETH_TX_PARSE_BD_E1X_LLC_SNAP_EN_SHIFT));
 
 	pbd->ip_hlen_w = (skb_transport_header(skb) -
-			skb_network_header(skb)) / 2;
+			skb_network_header(skb)) >> 1;
 
-	hlen += pbd->ip_hlen_w + tcp_hdrlen(skb) / 2;
+	hlen += pbd->ip_hlen_w;
+
+	/* We support checksum offload for TCP and UDP only */
+	if (xmit_type & XMIT_CSUM_TCP)
+		hlen += tcp_hdrlen(skb) / 2;
+	else
+		hlen += sizeof(struct udphdr) / 2;
 
 	pbd->total_hlen_w = cpu_to_le16(hlen);
 	hlen = hlen*2;
-- 
1.7.2.2





^ permalink raw reply related

* (unknown), 
From: WESTERN UNION OFFICE @ 2011-04-23 18:25 UTC (permalink / raw)


How are you today?


I write to inform you that we have already sent you $5,000.00USD
through Western union as we have been given the mandate to transfer
your full compensation payment of  $1.800,000.00USD via western union
by this government.

I called to give you the information through phone as internet hackers
were many but i cannot reach you yesterday even this morning,So I
decided to email you the (MTCN) and sender name so that you can pick
up this $5,000.00USD to enable us send another $5,000.00USD by
tomorrow as you knows we will be sending you only $5,000.00USD per
day.Please pick up this information and run to any western union
(OUTLET) in your country and pick up this $5,000.00USD and send us an
email back,so that we can send another $5,000.00USD by tomorrow.

Manager: Mr Frank Amos
email me on:western-money71@hotmail.com
call us on: +234-7031908911
once you picked up this $5000.00USD today.

Here is the western union information to pick up the $5000.00USD,

MTCN : 602 155 4697
Sender's Name: Mark Winters
Question: Honest
Answer:Trust
Amount send: $5,000.00USD
country:Nigeria

I am waiting for your E-mail once you pick up $5000.00USD,

Thanks
Mr Frank Amos.




-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.


^ permalink raw reply

* Re: RPS will assign different smp_processor_id for the same packet?
From: Tom Herbert @ 2011-04-23 19:56 UTC (permalink / raw)
  To: zhou rui; +Cc: Eric Dumazet, netdev@vger.kernel.org
In-Reply-To: <BANLkTikY6CAZNkcnU-i7UvPpmSfQuXKtNQ@mail.gmail.com>

On Sat, Apr 23, 2011 at 8:31 AM, zhou rui <zhourui.cn@gmail.com> wrote:
> one more question is:
>
> in the function "int netif_receive_skb(struct sk_buff *skb)"
>
> cpu = get_rps_cpu(skb->dev, skb, &rflow);
> if (cpu >= 0) {
>  ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
> ....
>
> probably the cpu is different from the current processor id?(smp_processor_id)
> let's say: get_rps_cpu->cpu 0, smp_processor_id->cpu1
> when this happen, does it mean that cpu1 is handling the softirq but
> have to divert the packet to cpu0?(via a new softirq?)
>
> so for one packet it involve 2 softirqs?
>
> possible to get_rps_cpu in interrupt,then let the target cpu do only
> one softirq to hanle the packet?
>
Yes, this is what a non-NAPI driver would do.

Tom


> thanks
>
> On Fri, Apr 22, 2011 at 12:29 AM, zhou rui <zhourui.cn@gmail.com> wrote:
>> On Friday, April 22, 2011, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>> Le jeudi 21 avril 2011 à 18:08 +0200, Eric Dumazet a écrit :
>>>> Le jeudi 21 avril 2011 à 23:50 +0800, zhou rui a écrit :
>>>> > kernel 2.6.36.4
>>>> > CONFIG_RPS=y but not set the cpu mask
>>>> >
>>>> > /sys/class/net/eth1/queues/rx-0 # cat rps_cpus
>>>> > 00
>>>> >
>>>> > register a hook func:
>>>> >   prot_hook.func = packet_rcv;
>>>> >   prot_hook.type = htons(ETH_P_ALL);
>>>> >   dev_add_pack(&prot_hook);
>>>> >
>>>> >
>>>> > replay the same traffic in very slow speed, printk the
>>>> > smp_processor_id in packet_rcv():
>>>> > first time:
>>>> > cpu=4
>>>> > cpu=3
>>>> > cpu=6
>>>> > cpu=7
>>>> >
>>>> > second time:
>>>> > cpu=7
>>>> > cpu=1
>>>> > cpu=5
>>>> > cpu=2
>>>> >
>>>> > is it normal?
>>>>
>>>> Yes it is.
>>>>
>>>> What would you expect ?
>>>>
>>>
>>> If rps_cpus contains only '0' bits, it basically means RPS is not active
>>> for this input queue.
>>>
>>> CPU is therefore not changed : The cpu handling NAPI on your network
>>> device directly calls upper linux stack.
>>>
>>> Seeing your traces, it also means your device spreads its interrupts on
>>> many different cpus, this might be not optimal.
>>>
>>> Check /proc/irq/{irq_number}/smp_affinity, it probably contains "ff"
>>>
>>>
>>>
>>>
>> Thanks,just saw this email
>>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

^ permalink raw reply

* Re: [PATCH net-2.6] bnx2x: fix UDP csum offload
From: David Miller @ 2011-04-23 22:16 UTC (permalink / raw)
  To: dmitry; +Cc: netdev, eric.dumazet, eilong, vladz
In-Reply-To: <1303580687.2708.40.camel@lb-tlvb-dmitry.il.broadcom.com>

From: "Dmitry Kravkov" <dmitry@broadcom.com>
Date: Sat, 23 Apr 2011 20:44:46 +0300

> From: Vladislav Zolotarov <vladz@broadcom.com>
> 
> Fixed packets parameters for FW in UDP checksum offload flow.
> 
> Do not dereference TCP headers on non TCP frames.
> Reported-by: Eric Dumazet <eric.dumazet@gmail.com>  
> 
> Signed-off-by: Dmitry Kravkov <dmitry@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>

Applied, thanks everyone!

^ permalink raw reply

* Congratulation!!
From: Mr Scott Carson @ 2011-04-23  6:14 UTC (permalink / raw)


£500,000GBP has been awarded to you in the BBC Online Promo Held on the
22nd April 2011, send Name/Tel/Country to our office now.


^ permalink raw reply

* Re: RPS will assign different smp_processor_id for the same packet?
From: zhou rui @ 2011-04-24  2:00 UTC (permalink / raw)
  To: Tom Herbert; +Cc: Eric Dumazet, netdev@vger.kernel.org
In-Reply-To: <BANLkTimqkq+2X3=RZ1Qb0e5NpO-yRxuCoQ@mail.gmail.com>

On Sun, Apr 24, 2011 at 3:56 AM, Tom Herbert <therbert@google.com> wrote:
> On Sat, Apr 23, 2011 at 8:31 AM, zhou rui <zhourui.cn@gmail.com> wrote:
>> one more question is:
>>
>> in the function "int netif_receive_skb(struct sk_buff *skb)"
>>
>> cpu = get_rps_cpu(skb->dev, skb, &rflow);
>> if (cpu >= 0) {
>>  ret = enqueue_to_backlog(skb, cpu, &rflow->last_qtail);
>> ....
>>
>> probably the cpu is different from the current processor id?(smp_processor_id)
>> let's say: get_rps_cpu->cpu 0, smp_processor_id->cpu1
>> when this happen, does it mean that cpu1 is handling the softirq but
>> have to divert the packet to cpu0?(via a new softirq?)
>>
>> so for one packet it involve 2 softirqs?
>>
>> possible to get_rps_cpu in interrupt,then let the target cpu do only
>> one softirq to hanle the packet?
>>
> Yes, this is what a non-NAPI driver would do.
>
> Tom
>
non-NAPI will get_rps_cpu in irq, but why NAPI will get_rps_cpu in
softirq?(if I understand correctly netif_receive_skb executed in
softirq?)
thanks!

>
>> thanks
>>
>> On Fri, Apr 22, 2011 at 12:29 AM, zhou rui <zhourui.cn@gmail.com> wrote:
>>> On Friday, April 22, 2011, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>>> Le jeudi 21 avril 2011 à 18:08 +0200, Eric Dumazet a écrit :
>>>>> Le jeudi 21 avril 2011 à 23:50 +0800, zhou rui a écrit :
>>>>> > kernel 2.6.36.4
>>>>> > CONFIG_RPS=y but not set the cpu mask
>>>>> >
>>>>> > /sys/class/net/eth1/queues/rx-0 # cat rps_cpus
>>>>> > 00
>>>>> >
>>>>> > register a hook func:
>>>>> >   prot_hook.func = packet_rcv;
>>>>> >   prot_hook.type = htons(ETH_P_ALL);
>>>>> >   dev_add_pack(&prot_hook);
>>>>> >
>>>>> >
>>>>> > replay the same traffic in very slow speed, printk the
>>>>> > smp_processor_id in packet_rcv():
>>>>> > first time:
>>>>> > cpu=4
>>>>> > cpu=3
>>>>> > cpu=6
>>>>> > cpu=7
>>>>> >
>>>>> > second time:
>>>>> > cpu=7
>>>>> > cpu=1
>>>>> > cpu=5
>>>>> > cpu=2
>>>>> >
>>>>> > is it normal?
>>>>>
>>>>> Yes it is.
>>>>>
>>>>> What would you expect ?
>>>>>
>>>>
>>>> If rps_cpus contains only '0' bits, it basically means RPS is not active
>>>> for this input queue.
>>>>
>>>> CPU is therefore not changed : The cpu handling NAPI on your network
>>>> device directly calls upper linux stack.
>>>>
>>>> Seeing your traces, it also means your device spreads its interrupts on
>>>> many different cpus, this might be not optimal.
>>>>
>>>> Check /proc/irq/{irq_number}/smp_affinity, it probably contains "ff"
>>>>
>>>>
>>>>
>>>>
>>> Thanks,just saw this email
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>

^ permalink raw reply

* Re: [PATCH 2/9] net-ethtool: Convert (hw_/vlan_/wanted_)features fields from u32 type to u64.
From: Ben Hutchings @ 2011-04-24  5:30 UTC (permalink / raw)
  To: Mahesh Bandewar; +Cc: David Miller, netdev, Michał Mirosław
In-Reply-To: <1303515367-25595-3-git-send-email-maheshb@google.com>

On Fri, 2011-04-22 at 16:36 -0700, Mahesh Bandewar wrote:
> Signed-off-by: Mahesh Bandewar <maheshb@google.com>
> ---
>  include/linux/ethtool.h |   26 +++++++------
>  net/core/ethtool.c      |   89 ++++++++++++++++------------------------------
>  2 files changed, 45 insertions(+), 70 deletions(-)
> 
> diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
> index 9de3127..71e8a02 100644
> --- a/include/linux/ethtool.h
> +++ b/include/linux/ethtool.h
> @@ -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 */

Precisely to allow for expansion to more than 32 bits.

>  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;
>  };
[...]

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.

-- 
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.


^ permalink raw reply

* Re: [PATCHv5] usbnet: Resubmit interrupt URB once if halted
From: Oliver Neukum @ 2011-04-24  6:36 UTC (permalink / raw)
  To: Paul Stewart; +Cc: Alan Stern, netdev, linux-usb, davem, bhutchings
In-Reply-To: <BANLkTi=xBJuSFNPO3hkKu+N2tNspw=FZNQ@mail.gmail.com>

Am Freitag, 22. April 2011, 17:59:15 schrieb Paul Stewart:
> >
> >>       free_netdev(net);
> >>       usb_put_dev (xdev);
> >>  }
> >> @@ -1285,6 +1291,10 @@ int usbnet_suspend (struct usb_interface *intf, pm_message_t message)
> >>                * wake the device
> >>                */
> >>               netif_device_attach (dev->net);
> >> +
> >> +             /* Stop interrupt URBs */
> >> +             if (dev->interrupt)
> >> +                     usb_kill_urb(dev->interrupt);
> >>       }
> >>       return 0;
> >>  }
> >
> > There is a subtle question here: When is the best time to kill the
> > interrupt URB?  Without knowing any of the details, I'd guess that the
> > interrupt URB reports asynchronous events and the driver could run into
> > trouble if one of those events occurred while everything else was
> > turned off.  This suggests that the interrupt URB should be killed as
> > soon as possible rather than as late as possible.  But maybe it doesn't
> > matter; it all depends on the design of the driver.
> 
> I'm not sure I can answer this question either.  As it stands, nobody
> was killing them before.  Just trying to make it better.

Hm. Are we looking at the same code? usbnet_suspend now has:

		/*
		 * accelerate emptying of the rx and queues, to avoid
		 * having everything error out.
		 */
		netif_device_detach (dev->net);
		usbnet_terminate_urbs(dev);
		usb_kill_urb(dev->interrupt);

This suggests that if you want to resubmit the interrupt URB in resume()
you do it first. Which drivers use the interrupt URB?

	Regards
		Oliver

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox