* 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: [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
* 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
* [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
* [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 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 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 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 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 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 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 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 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 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
* RE: rtnetlink and many VFs
From: Rose, Gregory V @ 2011-04-22 22:49 UTC (permalink / raw)
To: David Miller
Cc: bhutchings@solarflare.com, netdev@vger.kernel.org,
linux-net-drivers@solarflare.com
In-Reply-To: <20110422.153145.183062300.davem@davemloft.net>
> -----Original Message-----
> From: David Miller [mailto:davem@davemloft.net]
> Sent: Friday, April 22, 2011 3:32 PM
> To: Rose, Gregory V
> Cc: bhutchings@solarflare.com; netdev@vger.kernel.org; linux-net-
> drivers@solarflare.com
> Subject: Re: rtnetlink and many VFs
>
> From: "Rose, Gregory V" <gregory.v.rose@intel.com>
> Date: Fri, 22 Apr 2011 15:29:41 -0700
>
> > If someone who knew (or knows) a bit more about netlink could point
> > out where this limitation is set in the code I'd really appreciate
> > it. I've been poking around for a few hours and still can't find
> > it.
>
> NLMSG_GOODSIZE
Thank you sir!
- Greg
^ permalink raw reply
* Re: rtnetlink and many VFs
From: David Miller @ 2011-04-22 22:31 UTC (permalink / raw)
To: gregory.v.rose; +Cc: bhutchings, netdev, linux-net-drivers
In-Reply-To: <43F901BD926A4E43B106BF17856F0755014603C6BE@orsmsx508.amr.corp.intel.com>
From: "Rose, Gregory V" <gregory.v.rose@intel.com>
Date: Fri, 22 Apr 2011 15:29:41 -0700
> If someone who knew (or knows) a bit more about netlink could point
> out where this limitation is set in the code I'd really appreciate
> it. I've been poking around for a few hours and still can't find
> it.
NLMSG_GOODSIZE
^ permalink raw reply
* RE: rtnetlink and many VFs
From: Rose, Gregory V @ 2011-04-22 22:29 UTC (permalink / raw)
To: Ben Hutchings; +Cc: David Miller, netdev, sf-linux-drivers
In-Reply-To: <1303409517.3165.39.camel@bwh-desktop>
> -----Original Message-----
> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org]
> On Behalf Of Ben Hutchings
> Sent: Thursday, April 21, 2011 11:12 AM
> To: Rose, Gregory V
> Cc: David Miller; netdev; sf-linux-drivers
> Subject: RE: rtnetlink and many VFs
>
> > > I think that what 'ip link show' is doing now seems to be perfectly
> > > valid. It allocates a 16K buffer which would be enough if netlink
> > > didn't apply this PAGE_SIZE limit to single messages.
> >
If someone who knew (or knows) a bit more about netlink could point out where this limitation is set in the code I'd really appreciate it. I've been poking around for a few hours and still can't find it. I found the spot in the iproute2 code where the 16k is allocated and traced it down to the netlink socket call but from the kernel side I just can't find this PAGE_SIZE limit invocation.
- Greg
^ permalink raw reply
* Re: [PATCH] netconsole: fix deadlock when removing net driver that netconsole is using (v2)
From: David Miller @ 2011-04-22 21:34 UTC (permalink / raw)
To: nhorman; +Cc: netdev
In-Reply-To: <20110422213145.GA2332@neilslaptop.think-freely.org>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Fri, 22 Apr 2011 17:31:45 -0400
> I understand what you're saying here, but I think we're ok in this particular
> case. I say that because all other callers of __netpoll_cleanup, call it via
> netpoll_cleanup, which does the dev_put under protection of the rtnl_lock. This
> call is also under the rtnl_lock protection, its just taken when the event
> notification is made (thats why we call __netpoll_cleanup instead of
> netpoll_cleanup). The target_list_lock just protects the integrity of the
> netconsole_target list. If someone disables a netconsole via configfs, they'll
> block on the rtnl_lock. Since no path through configfs takes the
> target_list_lock and rtnl (via netpoll_cleanup) in any nested fashion, we're
> safe from deadlock.
That's right, rtnl saves us.
Thanks for explaining, applied, thanks!
^ permalink raw reply
* Re: [PATCH] netconsole: fix deadlock when removing net driver that netconsole is using (v2)
From: Neil Horman @ 2011-04-22 21:31 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20110422.114033.104072820.davem@davemloft.net>
On Fri, Apr 22, 2011 at 11:40:33AM -0700, David Miller wrote:
> From: Neil Horman <nhorman@tuxdriver.com>
> Date: Fri, 22 Apr 2011 14:10:59 -0400
>
> > @@ -683,9 +684,16 @@ static int netconsole_netdev_event(struct notifier_block *this,
> > * rtnl_lock already held
> > */
> > if (nt->np.dev) {
> > + spin_unlock_irqrestore(
> > + &target_list_lock,
> > + flags);
> > __netpoll_cleanup(&nt->np);
> > + spin_lock_irqsave(&target_list_lock,
> > + flags);
> > dev_put(nt->np.dev);
> > nt->np.dev = NULL;
> > + netconsole_target_put(nt);
> > + goto restart;
>
> If you drop the lock here, another cpu can put the device and set it
> to NULL.
>
> In which case you'll double release when you regrab the lock here.
>
> Too bad you can't NULL out the device before dropping the lock,
> because that way would be able to ensure you'd be the only releaser.
>
> But that won't work because __netpoll_cleanup() wants the device
> pointer to be set.
>
> Hmmm...
>
I understand what you're saying here, but I think we're ok in this particular
case. I say that because all other callers of __netpoll_cleanup, call it via
netpoll_cleanup, which does the dev_put under protection of the rtnl_lock. This
call is also under the rtnl_lock protection, its just taken when the event
notification is made (thats why we call __netpoll_cleanup instead of
netpoll_cleanup). The target_list_lock just protects the integrity of the
netconsole_target list. If someone disables a netconsole via configfs, they'll
block on the rtnl_lock. Since no path through configfs takes the
target_list_lock and rtnl (via netpoll_cleanup) in any nested fashion, we're
safe from deadlock.
Best
Neil
^ permalink raw reply
* Congratulation!!!
From: Mr Scott Carson @ 2011-04-21 12:07 UTC (permalink / raw)
£500,000GBP has been awarded to you in the BBC Online Promo Held on the 12 April
2011, send Name/Tel/Country to our office now.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
^ permalink raw reply
* Re: pull request: wireless-2.6 2011-04-22
From: David Miller @ 2011-04-22 20:21 UTC (permalink / raw)
To: linville; +Cc: linux-wireless, netdev, linux-kernel
In-Reply-To: <20110422201142.GA27119@tuxdriver.com>
From: "John W. Linville" <linville@tuxdriver.com>
Date: Fri, 22 Apr 2011 16:11:43 -0400
> Here are some fixes intended for 2.6.39...
>
> This includes a Bluetooth pull, described thusly by Gustavo:
>
> Four small fixes for 2.6.39. An incorrect refcnt balance for
> hci connection by Ville Tervo, a warning fix in the command
> timer by Vinicius Gomes, an ERTM fix by Ruiyi Zhang, and SCO
> synchronization fix by Luiz Augusto von Dentz.
>
> On top of those, there are some use-after-free fixes from Stansilaw for
> iwlegacy and iwlwifi, a mac80211 debugfs locking fix from Johannes, and
> a small logic fix for the return code of ath9k's ah_stoprecv from Felix,
> and an iwlwifi fix for frame injection from Daniel Halperin.
>
> Please let me know if there are problems!
Pulled, thanks John.
^ permalink raw reply
* Congratulation!!!
From: Mr Scott Carson @ 2011-04-21 12:07 UTC (permalink / raw)
£500,000GBP has been awarded to you in the BBC Online Promo Held on the 12 April
2011, send Name/Tel/Country to our office now.
----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.
^ permalink raw reply
* pull request: wireless-2.6 2011-04-22
From: John W. Linville @ 2011-04-22 20:11 UTC (permalink / raw)
To: davem; +Cc: linux-wireless, netdev, linux-kernel
Dave,
Here are some fixes intended for 2.6.39...
This includes a Bluetooth pull, described thusly by Gustavo:
Four small fixes for 2.6.39. An incorrect refcnt balance for
hci connection by Ville Tervo, a warning fix in the command
timer by Vinicius Gomes, an ERTM fix by Ruiyi Zhang, and SCO
synchronization fix by Luiz Augusto von Dentz.
On top of those, there are some use-after-free fixes from Stansilaw for
iwlegacy and iwlwifi, a mac80211 debugfs locking fix from Johannes, and
a small logic fix for the return code of ath9k's ah_stoprecv from Felix,
and an iwlwifi fix for frame injection from Daniel Halperin.
Please let me know if there are problems!
John
---
The following changes since commit f01cb5fbea1c1613621f9f32f385e12c1a29dde0:
Revert "bridge: Forward reserved group addresses if !STP" (2011-04-21 21:17:25 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git master
Daniel Halperin (1):
iwlwifi: fix frame injection for HT channels
Felix Fietkau (1):
ath9k: fix the return value of ath_stoprecv
Johannes Berg (1):
mac80211: fix SMPS debugfs locking
John W. Linville (1):
Merge branch 'master' of git://git.kernel.org/.../padovan/bluetooth-2.6
Luiz Augusto von Dentz (1):
Bluetooth: fix shutdown on SCO sockets
Ruiyi Zhang (1):
Bluetooth: Only keeping SAR bits when retransmitting one frame.
Stanislaw Gruszka (2):
iwlwifi: fix skb usage after free
iwl4965: fix skb usage after free
Ville Tervo (1):
Bluetooth: Fix refcount balance for hci connection
Vinicius Costa Gomes (1):
Bluetooth: Fix keeping the command timer running
drivers/net/wireless/ath/ath9k/recv.c | 2 +-
drivers/net/wireless/iwlegacy/iwl-4965-tx.c | 10 +++++++---
drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 7 +------
drivers/net/wireless/iwlwifi/iwl-agn-tx.c | 10 +++++++---
net/bluetooth/hci_core.c | 5 ++---
net/bluetooth/hci_event.c | 2 --
net/bluetooth/l2cap_core.c | 1 +
net/bluetooth/sco.c | 9 +++++++++
net/mac80211/cfg.c | 2 ++
net/mac80211/debugfs_netdev.c | 4 ++--
10 files changed, 32 insertions(+), 20 deletions(-)
diff --git a/drivers/net/wireless/ath/ath9k/recv.c b/drivers/net/wireless/ath/ath9k/recv.c
index dcd19bc..b29c80d 100644
--- a/drivers/net/wireless/ath/ath9k/recv.c
+++ b/drivers/net/wireless/ath/ath9k/recv.c
@@ -506,7 +506,7 @@ bool ath_stoprecv(struct ath_softc *sc)
"confusing the DMA engine when we start RX up\n");
ATH_DBG_WARN_ON_ONCE(!stopped);
}
- return stopped || reset;
+ return stopped && !reset;
}
void ath_flushrecv(struct ath_softc *sc)
diff --git a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
index 5c40502..fbec88d 100644
--- a/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
+++ b/drivers/net/wireless/iwlegacy/iwl-4965-tx.c
@@ -1127,12 +1127,16 @@ int iwl4965_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
q->read_ptr = iwl_legacy_queue_inc_wrap(q->read_ptr, q->n_bd)) {
tx_info = &txq->txb[txq->q.read_ptr];
- iwl4965_tx_status(priv, tx_info,
- txq_id >= IWL4965_FIRST_AMPDU_QUEUE);
+
+ if (WARN_ON_ONCE(tx_info->skb == NULL))
+ continue;
hdr = (struct ieee80211_hdr *)tx_info->skb->data;
- if (hdr && ieee80211_is_data_qos(hdr->frame_control))
+ if (ieee80211_is_data_qos(hdr->frame_control))
nfreed++;
+
+ iwl4965_tx_status(priv, tx_info,
+ txq_id >= IWL4965_FIRST_AMPDU_QUEUE);
tx_info->skb = NULL;
priv->cfg->ops->lib->txq_free_tfd(priv, txq);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index dfdbea6..fbbde07 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -335,7 +335,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
struct ieee80211_channel *channel = conf->channel;
const struct iwl_channel_info *ch_info;
int ret = 0;
- bool ht_changed[NUM_IWL_RXON_CTX] = {};
IWL_DEBUG_MAC80211(priv, "changed %#x", changed);
@@ -383,10 +382,8 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
for_each_context(priv, ctx) {
/* Configure HT40 channels */
- if (ctx->ht.enabled != conf_is_ht(conf)) {
+ if (ctx->ht.enabled != conf_is_ht(conf))
ctx->ht.enabled = conf_is_ht(conf);
- ht_changed[ctx->ctxid] = true;
- }
if (ctx->ht.enabled) {
if (conf_is_ht40_minus(conf)) {
@@ -455,8 +452,6 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
if (!memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
continue;
iwlagn_commit_rxon(priv, ctx);
- if (ht_changed[ctx->ctxid])
- iwlagn_update_qos(priv, ctx);
}
out:
mutex_unlock(&priv->mutex);
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
index a709d05..2dd7d54 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-tx.c
@@ -1224,12 +1224,16 @@ int iwlagn_tx_queue_reclaim(struct iwl_priv *priv, int txq_id, int index)
q->read_ptr = iwl_queue_inc_wrap(q->read_ptr, q->n_bd)) {
tx_info = &txq->txb[txq->q.read_ptr];
- iwlagn_tx_status(priv, tx_info,
- txq_id >= IWLAGN_FIRST_AMPDU_QUEUE);
+
+ if (WARN_ON_ONCE(tx_info->skb == NULL))
+ continue;
hdr = (struct ieee80211_hdr *)tx_info->skb->data;
- if (hdr && ieee80211_is_data_qos(hdr->frame_control))
+ if (ieee80211_is_data_qos(hdr->frame_control))
nfreed++;
+
+ iwlagn_tx_status(priv, tx_info,
+ txq_id >= IWLAGN_FIRST_AMPDU_QUEUE);
tx_info->skb = NULL;
if (priv->cfg->ops->lib->txq_inval_byte_cnt_tbl)
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c
index 2216620..e7dced9 100644
--- a/net/bluetooth/hci_core.c
+++ b/net/bluetooth/hci_core.c
@@ -587,10 +587,8 @@ static int hci_dev_do_close(struct hci_dev *hdev)
hci_req_cancel(hdev, ENODEV);
hci_req_lock(hdev);
- /* Stop timer, it might be running */
- del_timer_sync(&hdev->cmd_timer);
-
if (!test_and_clear_bit(HCI_UP, &hdev->flags)) {
+ del_timer_sync(&hdev->cmd_timer);
hci_req_unlock(hdev);
return 0;
}
@@ -629,6 +627,7 @@ static int hci_dev_do_close(struct hci_dev *hdev)
/* Drop last sent command */
if (hdev->sent_cmd) {
+ del_timer_sync(&hdev->cmd_timer);
kfree_skb(hdev->sent_cmd);
hdev->sent_cmd = NULL;
}
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c
index cebe7588..b257015 100644
--- a/net/bluetooth/hci_event.c
+++ b/net/bluetooth/hci_event.c
@@ -2387,8 +2387,6 @@ static inline void hci_io_capa_reply_evt(struct hci_dev *hdev, struct sk_buff *s
if (!conn)
goto unlock;
- hci_conn_hold(conn);
-
conn->remote_cap = ev->capability;
conn->remote_oob = ev->oob_data;
conn->remote_auth = ev->authentication;
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
index ca27f3a..2c8dd44 100644
--- a/net/bluetooth/l2cap_core.c
+++ b/net/bluetooth/l2cap_core.c
@@ -1051,6 +1051,7 @@ static void l2cap_retransmit_one_frame(struct sock *sk, u8 tx_seq)
tx_skb = skb_clone(skb, GFP_ATOMIC);
bt_cb(skb)->retries++;
control = get_unaligned_le16(tx_skb->data + L2CAP_HDR_SIZE);
+ control &= L2CAP_CTRL_SAR;
if (pi->conn_state & L2CAP_CONN_SEND_FBIT) {
control |= L2CAP_CTRL_FINAL;
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index 42fdffd..94954c7 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -369,6 +369,15 @@ static void __sco_sock_close(struct sock *sk)
case BT_CONNECTED:
case BT_CONFIG:
+ if (sco_pi(sk)->conn) {
+ sk->sk_state = BT_DISCONN;
+ sco_sock_set_timer(sk, SCO_DISCONN_TIMEOUT);
+ hci_conn_put(sco_pi(sk)->conn->hcon);
+ sco_pi(sk)->conn = NULL;
+ } else
+ sco_chan_del(sk, ECONNRESET);
+ break;
+
case BT_CONNECT:
case BT_DISCONN:
sco_chan_del(sk, ECONNRESET);
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 3342135..4404973 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -1504,6 +1504,8 @@ int __ieee80211_request_smps(struct ieee80211_sub_if_data *sdata,
enum ieee80211_smps_mode old_req;
int err;
+ lockdep_assert_held(&sdata->u.mgd.mtx);
+
old_req = sdata->u.mgd.req_smps;
sdata->u.mgd.req_smps = smps_mode;
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index dacace6..9ea7c0d 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -177,9 +177,9 @@ static int ieee80211_set_smps(struct ieee80211_sub_if_data *sdata,
if (sdata->vif.type != NL80211_IFTYPE_STATION)
return -EOPNOTSUPP;
- mutex_lock(&local->iflist_mtx);
+ mutex_lock(&sdata->u.mgd.mtx);
err = __ieee80211_request_smps(sdata, smps_mode);
- mutex_unlock(&local->iflist_mtx);
+ mutex_unlock(&sdata->u.mgd.mtx);
return err;
}
--
John W. Linville Someday the world will need a hero, and you
linville@tuxdriver.com might be all we have. Be ready.
^ permalink raw reply related
* (unknown),
From: Dr. Clarke Harrison @ 2011-04-22 19:23 UTC (permalink / raw)
British National Lottery
United Kingdom.
P.O Box 789 Harrogate,HG1 2YR
International powerball Online Lotto Program.
WINNING NUMBER 04-23-39-49-50 (39)
NOTIFICATION OF WINNING
Attn:
You won the sum of £2.4 Million pounds! GBP in our monthly sweepstakes,
just concluded April 21th, you are hereby advice to get back to us, to claimed
your prize.
Requirements:
1.First Name
2 Last Name :
3.Home Address:
4.Age:
5.Sex:
6.Occupation:
7.Phone Number:
8.Country Of Residence.
Contact Agent: Dr. Clarke Harrison
E-mail: powerball_winonline@hotmail.com
Regards,
Mrs. Fisher schmitz
British Powerball Lottery
United Kingdom
^ permalink raw reply
* Re: [PATCH] netconsole: fix deadlock when removing net driver that netconsole is using (v2)
From: David Miller @ 2011-04-22 18:40 UTC (permalink / raw)
To: nhorman; +Cc: netdev
In-Reply-To: <1303495859-12279-1-git-send-email-nhorman@tuxdriver.com>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Fri, 22 Apr 2011 14:10:59 -0400
> @@ -683,9 +684,16 @@ static int netconsole_netdev_event(struct notifier_block *this,
> * rtnl_lock already held
> */
> if (nt->np.dev) {
> + spin_unlock_irqrestore(
> + &target_list_lock,
> + flags);
> __netpoll_cleanup(&nt->np);
> + spin_lock_irqsave(&target_list_lock,
> + flags);
> dev_put(nt->np.dev);
> nt->np.dev = NULL;
> + netconsole_target_put(nt);
> + goto restart;
If you drop the lock here, another cpu can put the device and set it
to NULL.
In which case you'll double release when you regrab the lock here.
Too bad you can't NULL out the device before dropping the lock,
because that way would be able to ensure you'd be the only releaser.
But that won't work because __netpoll_cleanup() wants the device
pointer to be set.
Hmmm...
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox