* Re: PATCH: veth: Zero timestamp in xmit path.
From: Ben Greear @ 2009-07-21 20:02 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20090721.125155.168882282.davem@davemloft.net>
On 07/21/2009 12:51 PM, David Miller wrote:
> From: Ben Greear<greearb@candelatech.com>
> Date: Tue, 21 Jul 2009 12:46:55 -0700
>
>> This patch zero's the timestamp before handing the packet to
>> the peer interface. This lets the peer recalculate the rx timestamp
>> if it cares about timestamps.
>>
>> The patch is against net-next, compile tested there. Similar patch
>> was
>> functionally tested against 2.6.31-rc3.
>>
>>
>> Signed-Off-By: Ben Greear<greearb@candelatech.com>
>
> Oh, where to begin... sigh...
>
> The "off" and "by" in "Signed-off-by" is not capitalized.
>
> There should not be two spaces after the Signed-off-by colon, there
> should be only one.
>
> There should be a space between your name and your<> enclosed email
> address.
I had no idea that was so important.
>
>> @@ -171,6 +171,7 @@ static int veth_xmit(struct sk_buff *skb, struct
>> net_device *dev)
>
> Your email client corrupted the patch by splitting up this line.
>
> This is all just being sloppy, and it shows a lack of care put
> into your submission.
I sent as attachment as well to help mitigate this. If sending only
an attachment is better, I will do so next time.
> Nevertheless I'm a sucker and I fixed this all up and applied your
> patch.
As always, your forbearance is appreciated!
Thanks,
Ben
--
Ben Greear <greearb@candelatech.com>
Candela Technologies Inc http://www.candelatech.com
^ permalink raw reply
* Re: PATCH: veth: Zero timestamp in xmit path.
From: David Miller @ 2009-07-21 20:05 UTC (permalink / raw)
To: greearb; +Cc: netdev
In-Reply-To: <4A661EBA.7040206@candelatech.com>
From: Ben Greear <greearb@candelatech.com>
Date: Tue, 21 Jul 2009 13:02:02 -0700
> On 07/21/2009 12:51 PM, David Miller wrote:
>> From: Ben Greear<greearb@candelatech.com>
>> Date: Tue, 21 Jul 2009 12:46:55 -0700
>>
>>> Signed-Off-By: Ben Greear<greearb@candelatech.com>
>>
>> Oh, where to begin... sigh...
>>
>> The "off" and "by" in "Signed-off-by" is not capitalized.
>>
>> There should not be two spaces after the Signed-off-by colon, there
>> should be only one.
>>
>> There should be a space between your name and your<> enclosed email
>> address.
>
> I had no idea that was so important.
If you aren't even going to check over such easy and trivial visual
matters such as this, one can only imagine how much care has been put
into the change itself.
It shows how much you care about how your work and submissions look to
other people.
It's as much an issue of what it shows about the submitter's overall
mentality as it is an issue of "does it matter" or how important it is
to get the signoff syntax correct.
^ permalink raw reply
* [PATCH net-next-2.6] net: relax dst refcnt in input path
From: Eric Dumazet @ 2009-07-21 20:07 UTC (permalink / raw)
To: David S. Miller; +Cc: Linux Netdev List, Mark McLoughlin
David
Please find followup work based on previous discussion and on your idea
(sometime back in Dec 2008, but I lost my 2008 mails, thanks to a stupid
antivirus...)
Thank you
[PATCH net-next-2.6] net: relax dst refcnt in input path
One serious point of contention in network stack is the IP route cache
refcounts in input path, on SMP setups.
On stress situation, one cpu (say A) handles network softirq RX processing.
When a packet is received, we need to find a dst_entry, take
a reference on this dst_entry and associate skb to this dst_entry.
skb is queued on a socket receive queue.
When application (running from another CPU B) dequeues this packet,
it has to release the dst_entry, which refcount is hot and dirty on
another CPU A cache, involving an expensive cache line ping-pong.
Back in November 2008, we tried to keep this cache line only
in CPU A (commit 70355602879229c6f8bd694ec9c0814222bc4936)
(net: release skb->dst in sock_queue_rcv_skb()), but we had
to revert this commit because it broke IP_PKTINFO handling,
as noticed by Mark McLoughlin
Then David suggested not taking the reference at the first place,
which this patch does when possible.
We prepared this work with commit adf30907 (net: skb->dst accessors),
introducing accessors to work on skb->dst
We now can use the low order bit of skb->_skb_dst to tell
if a reference was taken on dst for this skb
Then we add a new 'noref' parameter to ip_route_input(), to tell
this function to take or not a reference count on found dst.
We make ip_rcv_finish() calls ip_route_input() with noref=1.
When queueing a skb to socket receive queue, we drop dst
unless IP_CMSG_PKTINFO is set.
This is done in ip_queue_rcv_skb(), a new wrapper around
sock_queue_rcv_skb(), for UDP (IPV4/IPV6) and RAW (IPV4)
In sock_queue_rcv_skb(), we check if skb has still a dst,
because we must take a reference on it unless already done.
(The dequeuing might be done long time after queueing, and
RCU wont protect dst that long)
skb_dst_drop() is called from tcp_data_queue() for TCP,
regardless of IP_CMSG_PKTINFO (not meaningfull for tcp)
Net effect of this patch is avoiding two atomic ops per
incoming packet, on possibly contented cache lines.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
include/linux/skbuff.h | 35 +++++++++++++++++++++++++++-
include/net/dst.h | 45 ++++++++++++++++++++++++++++++++----
include/net/ip.h | 1
include/net/route.h | 3 +-
net/bridge/br_netfilter.c | 2 -
net/core/skbuff.c | 2 -
net/core/sock.c | 4 +++
net/ipv4/arp.c | 2 -
net/ipv4/icmp.c | 8 +++---
net/ipv4/ip_input.c | 2 -
net/ipv4/ip_options.c | 11 ++++----
net/ipv4/ip_sockglue.c | 16 ++++++++++++
net/ipv4/netfilter.c | 8 +++---
net/ipv4/raw.c | 2 -
net/ipv4/route.c | 15 ++++++++----
net/ipv4/tcp_input.c | 1
net/ipv4/udp.c | 2 -
net/ipv4/xfrm4_input.c | 2 -
net/ipv6/ip6_tunnel.c | 2 -
net/ipv6/udp.c | 2 -
20 files changed, 132 insertions(+), 33 deletions(-)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index f2c69a2..9d14368 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -426,13 +426,46 @@ extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb,
enum dma_data_direction dir);
#endif
+/*
+ * skb might have a dst pointer attached, refcounted or not
+ * _skb_dst low order bit is set if refcount was taken
+ */
+#define SKB_DST_REFTAKEN 1UL
+#define SKB_DST_PTRMASK ~1UL
+/**
+ * skb_dst - returns skb dst
+ * @skb: buffer
+ *
+ * Returns skb dst, regardless of reference taken or not.
+ */
static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
{
- return (struct dst_entry *)skb->_skb_dst;
+ return (struct dst_entry *)(skb->_skb_dst & SKB_DST_PTRMASK);
}
+/**
+ * skb_dst_set - sets skb dst
+ * @skb: buffer
+ * @dst: dst entry
+ *
+ * Sets skb dst, assuming a reference was taken on dst and should
+ * be released by skb_dst_drop()
+ */
static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
{
+ skb->_skb_dst = (unsigned long)dst | SKB_DST_REFTAKEN;
+}
+
+/**
+ * skb_dst_set_noref - sets skb dst, without a reference
+ * @skb: buffer
+ * @dst: dst entry
+ *
+ * Sets skb dst, assuming a reference was not taken on dst
+ * skb_dst_drop() should not dst_release() this dst
+ */
+static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst)
+{
skb->_skb_dst = (unsigned long)dst;
}
diff --git a/include/net/dst.h b/include/net/dst.h
index 7fc409c..9c3f0fc 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -179,13 +179,18 @@ static inline void dst_hold(struct dst_entry * dst)
atomic_inc(&dst->__refcnt);
}
-static inline void dst_use(struct dst_entry *dst, unsigned long time)
+static inline void dst_use_noref(struct dst_entry *dst, unsigned long time)
{
- dst_hold(dst);
dst->__use++;
dst->lastuse = time;
}
+static inline void dst_use(struct dst_entry *dst, unsigned long time)
+{
+ dst_hold(dst);
+ dst_use_noref(dst, time);
+}
+
static inline
struct dst_entry * dst_clone(struct dst_entry * dst)
{
@@ -195,13 +200,45 @@ struct dst_entry * dst_clone(struct dst_entry * dst)
}
extern void dst_release(struct dst_entry *dst);
+
+static inline void __skb_dst_drop(unsigned long _skb_dst)
+{
+ if (_skb_dst & SKB_DST_REFTAKEN)
+ dst_release((struct dst_entry *)(_skb_dst & SKB_DST_PTRMASK));
+}
+/**
+ * skb_dst_drop - drops skb dst
+ * @skb: buffer
+ *
+ * Drops dst reference count if low order bit is set.
+ */
static inline void skb_dst_drop(struct sk_buff *skb)
{
- if (skb->_skb_dst)
- dst_release(skb_dst(skb));
+ __skb_dst_drop(skb->_skb_dst);
skb->_skb_dst = 0UL;
}
+static inline void skb_dst_copy(struct sk_buff *nskb, const struct sk_buff *oskb)
+{
+ nskb->_skb_dst = oskb->_skb_dst;
+ if (nskb->_skb_dst & SKB_DST_REFTAKEN)
+ dst_clone(skb_dst(nskb));
+}
+
+/**
+ * skb_dst_force - makes sure skb dst is refcounted
+ * @skb: buffer
+ *
+ * If dst is not yet refcounted, let's do it
+ */
+static inline void skb_dst_force(struct sk_buff *skb)
+{
+ if (!(skb->_skb_dst & SKB_DST_REFTAKEN)) {
+ dst_clone(skb_dst(skb));
+ skb->_skb_dst |= SKB_DST_REFTAKEN;
+ }
+}
+
/* Children define the path of the packet through the
* Linux networking. Thus, destinations are stackable.
*/
diff --git a/include/net/ip.h b/include/net/ip.h
index 72c3692..ec94680 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -378,6 +378,7 @@ extern int ip_options_rcv_srr(struct sk_buff *skb);
* Functions provided by ip_sockglue.c
*/
+extern int ip_queue_rcv_skb(struct sock *sk, struct sk_buff *skb);
extern void ip_cmsg_recv(struct msghdr *msg, struct sk_buff *skb);
extern int ip_cmsg_send(struct net *net,
struct msghdr *msg, struct ipcm_cookie *ipc);
diff --git a/include/net/route.h b/include/net/route.h
index 40f6346..726df35 100644
--- a/include/net/route.h
+++ b/include/net/route.h
@@ -115,7 +115,8 @@ extern void rt_cache_flush(struct net *net, int how);
extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp);
extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp);
extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags);
-extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos, struct net_device *devin);
+extern int ip_route_input(struct sk_buff*, __be32 dst, __be32 src, u8 tos,
+ struct net_device *devin, int noref);
extern unsigned short ip_rt_frag_needed(struct net *net, struct iphdr *iph, unsigned short new_mtu, struct net_device *dev);
extern void ip_rt_send_redirect(struct sk_buff *skb);
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
index 4fde742..5c88c83 100644
--- a/net/bridge/br_netfilter.c
+++ b/net/bridge/br_netfilter.c
@@ -349,7 +349,7 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb)
}
nf_bridge->mask ^= BRNF_NF_BRIDGE_PREROUTING;
if (dnat_took_place(skb)) {
- if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev))) {
+ if ((err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos, dev, 1))) {
struct flowi fl = {
.nl_u = {
.ip4_u = {
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 9e0597d..37b1fc0 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -530,7 +530,7 @@ static void __copy_skb_header(struct sk_buff *new, const struct sk_buff *old)
new->transport_header = old->transport_header;
new->network_header = old->network_header;
new->mac_header = old->mac_header;
- skb_dst_set(new, dst_clone(skb_dst(old)));
+ skb_dst_copy(new, old);
#ifdef CONFIG_XFRM
new->sp = secpath_get(old->sp);
#endif
diff --git a/net/core/sock.c b/net/core/sock.c
index d9eec15..2d1cf4c 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -304,6 +304,10 @@ int sock_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
* from the queue.
*/
skb_len = skb->len;
+ /*
+ * If we still have a dst entry linked, make sure we refcounted it
+ */
+ skb_dst_force(skb);
skb_queue_tail(&sk->sk_receive_queue, skb);
diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
index c29d75d..ff436be 100644
--- a/net/ipv4/arp.c
+++ b/net/ipv4/arp.c
@@ -812,7 +812,7 @@ static int arp_process(struct sk_buff *skb)
}
if (arp->ar_op == htons(ARPOP_REQUEST) &&
- ip_route_input(skb, tip, sip, 0, dev) == 0) {
+ ip_route_input(skb, tip, sip, 0, dev, 0) == 0) {
rt = skb_rtable(skb);
addr_type = rt->rt_type;
diff --git a/net/ipv4/icmp.c b/net/ipv4/icmp.c
index 97c410e..08e68d0 100644
--- a/net/ipv4/icmp.c
+++ b/net/ipv4/icmp.c
@@ -584,20 +584,20 @@ void icmp_send(struct sk_buff *skb_in, int type, int code, __be32 info)
err = __ip_route_output_key(net, &rt2, &fl);
else {
struct flowi fl2 = {};
- struct dst_entry *odst;
+ unsigned long odst;
fl2.fl4_dst = fl.fl4_src;
if (ip_route_output_key(net, &rt2, &fl2))
goto relookup_failed;
/* Ugh! */
- odst = skb_dst(skb_in);
+ odst = skb_in->_skb_dst; /* save old dst */
err = ip_route_input(skb_in, fl.fl4_dst, fl.fl4_src,
- RT_TOS(tos), rt2->u.dst.dev);
+ RT_TOS(tos), rt2->u.dst.dev, 0);
dst_release(&rt2->u.dst);
rt2 = skb_rtable(skb_in);
- skb_dst_set(skb_in, odst);
+ skb_in->_skb_dst = odst; /* restore old dst */
}
if (err)
diff --git a/net/ipv4/ip_input.c b/net/ipv4/ip_input.c
index db46b4b..23e974b 100644
--- a/net/ipv4/ip_input.c
+++ b/net/ipv4/ip_input.c
@@ -331,7 +331,7 @@ static int ip_rcv_finish(struct sk_buff *skb)
*/
if (skb_dst(skb) == NULL) {
int err = ip_route_input(skb, iph->daddr, iph->saddr, iph->tos,
- skb->dev);
+ skb->dev, 1);
if (unlikely(err)) {
if (err == -EHOSTUNREACH)
IP_INC_STATS_BH(dev_net(skb->dev),
diff --git a/net/ipv4/ip_options.c b/net/ipv4/ip_options.c
index 94bf105..e45abbd 100644
--- a/net/ipv4/ip_options.c
+++ b/net/ipv4/ip_options.c
@@ -600,6 +600,7 @@ int ip_options_rcv_srr(struct sk_buff *skb)
unsigned char *optptr = skb_network_header(skb) + opt->srr;
struct rtable *rt = skb_rtable(skb);
struct rtable *rt2;
+ unsigned long odst;
int err;
if (!opt->srr)
@@ -623,16 +624,16 @@ int ip_options_rcv_srr(struct sk_buff *skb)
}
memcpy(&nexthop, &optptr[srrptr-1], 4);
- rt = skb_rtable(skb);
+ odst = skb->_skb_dst;
skb_dst_set(skb, NULL);
- err = ip_route_input(skb, nexthop, iph->saddr, iph->tos, skb->dev);
+ err = ip_route_input(skb, nexthop, iph->saddr, iph->tos, skb->dev, 0);
rt2 = skb_rtable(skb);
if (err || (rt2->rt_type != RTN_UNICAST && rt2->rt_type != RTN_LOCAL)) {
- ip_rt_put(rt2);
- skb_dst_set(skb, &rt->u.dst);
+ skb_dst_drop(skb);
+ skb->_skb_dst = odst;
return -EINVAL;
}
- ip_rt_put(rt);
+ __skb_dst_drop(odst);
if (rt2->rt_type != RTN_LOCAL)
break;
/* Superfast 8) loopback forward */
diff --git a/net/ipv4/ip_sockglue.c b/net/ipv4/ip_sockglue.c
index fc7993e..7349554 100644
--- a/net/ipv4/ip_sockglue.c
+++ b/net/ipv4/ip_sockglue.c
@@ -946,6 +946,22 @@ e_inval:
return -EINVAL;
}
+/**
+ * ip_queue_rcv_skb - Queue an skb into sock receive queue
+ * @sk: socket
+ * @skb: buffer
+ *
+ * Queues an skb into socket receive queue. If IP_CMSG_PKTINFO option
+ * is not set, we drop skb dst entry now.
+ */
+int ip_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
+{
+ if (!(inet_sk(sk)->cmsg_flags & IP_CMSG_PKTINFO))
+ skb_dst_drop(skb);
+ return sock_queue_rcv_skb(sk, skb);
+}
+EXPORT_SYMBOL(ip_queue_rcv_skb);
+
int ip_setsockopt(struct sock *sk, int level,
int optname, char __user *optval, int optlen)
{
diff --git a/net/ipv4/netfilter.c b/net/ipv4/netfilter.c
index 1725dc0..7eb2a20 100644
--- a/net/ipv4/netfilter.c
+++ b/net/ipv4/netfilter.c
@@ -16,7 +16,7 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
const struct iphdr *iph = ip_hdr(skb);
struct rtable *rt;
struct flowi fl = {};
- struct dst_entry *odst;
+ unsigned long odst;
unsigned int hh_len;
unsigned int type;
@@ -50,14 +50,14 @@ int ip_route_me_harder(struct sk_buff *skb, unsigned addr_type)
if (ip_route_output_key(net, &rt, &fl) != 0)
return -1;
- odst = skb_dst(skb);
+ odst = skb->_skb_dst;
if (ip_route_input(skb, iph->daddr, iph->saddr,
- RT_TOS(iph->tos), rt->u.dst.dev) != 0) {
+ RT_TOS(iph->tos), rt->u.dst.dev, 0) != 0) {
dst_release(&rt->u.dst);
return -1;
}
dst_release(&rt->u.dst);
- dst_release(odst);
+ __skb_dst_drop(odst);
}
if (skb_dst(skb)->error)
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 2979f14..ccccd91 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -291,7 +291,7 @@ static int raw_rcv_skb(struct sock * sk, struct sk_buff * skb)
{
/* Charge it to the socket. */
- if (sock_queue_rcv_skb(sk, skb) < 0) {
+ if (ip_queue_rcv_skb(sk, skb) < 0) {
atomic_inc(&sk->sk_drops);
kfree_skb(skb);
return NET_RX_DROP;
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 278f46f..e66d85d 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2255,7 +2255,7 @@ martian_source:
}
int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr,
- u8 tos, struct net_device *dev)
+ u8 tos, struct net_device *dev, int noref)
{
struct rtable * rth;
unsigned hash;
@@ -2281,10 +2281,15 @@ int ip_route_input(struct sk_buff *skb, __be32 daddr, __be32 saddr,
rth->fl.mark == skb->mark &&
net_eq(dev_net(rth->u.dst.dev), net) &&
!rt_is_expired(rth)) {
- dst_use(&rth->u.dst, jiffies);
+ if (noref) {
+ dst_use_noref(&rth->u.dst, jiffies);
+ skb_dst_set_noref(skb, &rth->u.dst);
+ } else {
+ dst_use(&rth->u.dst, jiffies);
+ skb_dst_set(skb, &rth->u.dst);
+ }
RT_CACHE_STAT_INC(in_hit);
rcu_read_unlock();
- skb_dst_set(skb, &rth->u.dst);
return 0;
}
RT_CACHE_STAT_INC(in_hlist_search);
@@ -2944,7 +2949,7 @@ static int inet_rtm_getroute(struct sk_buff *in_skb, struct nlmsghdr* nlh, void
skb->protocol = htons(ETH_P_IP);
skb->dev = dev;
local_bh_disable();
- err = ip_route_input(skb, dst, src, rtm->rtm_tos, dev);
+ err = ip_route_input(skb, dst, src, rtm->rtm_tos, dev, 0);
local_bh_enable();
rt = skb_rtable(skb);
@@ -3008,7 +3013,7 @@ int ip_rt_dump(struct sk_buff *skb, struct netlink_callback *cb)
continue;
if (rt_is_expired(rt))
continue;
- skb_dst_set(skb, dst_clone(&rt->u.dst));
+ skb_dst_set_noref(skb, &rt->u.dst);
if (rt_fill_info(net, skb, NETLINK_CB(cb->skb).pid,
cb->nlh->nlmsg_seq, RTM_NEWROUTE,
1, NLM_F_MULTI) <= 0) {
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 2bdb0da..32fb9c6 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4297,6 +4297,7 @@ static void tcp_data_queue(struct sock *sk, struct sk_buff *skb)
if (TCP_SKB_CB(skb)->seq == TCP_SKB_CB(skb)->end_seq)
goto drop;
+ skb_dst_drop(skb);
__skb_pull(skb, th->doff * 4);
TCP_ECN_accept_cwr(tp, skb);
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 29ebb0d..094f1ad 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1024,7 +1024,7 @@ static int __udp_queue_rcv_skb(struct sock *sk, struct sk_buff *skb)
int is_udplite = IS_UDPLITE(sk);
int rc;
- if ((rc = sock_queue_rcv_skb(sk, skb)) < 0) {
+ if ((rc = ip_queue_rcv_skb(sk, skb)) < 0) {
/* Note that an ENOMEM error is charged twice */
if (rc == -ENOMEM) {
UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
diff --git a/net/ipv4/xfrm4_input.c b/net/ipv4/xfrm4_input.c
index f9f922a..fd5310b 100644
--- a/net/ipv4/xfrm4_input.c
+++ b/net/ipv4/xfrm4_input.c
@@ -27,7 +27,7 @@ static inline int xfrm4_rcv_encap_finish(struct sk_buff *skb)
const struct iphdr *iph = ip_hdr(skb);
if (ip_route_input(skb, iph->daddr, iph->saddr, iph->tos,
- skb->dev))
+ skb->dev, 1))
goto drop;
}
return dst_input(skb);
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
index a1d6045..94a23b9 100644
--- a/net/ipv6/ip6_tunnel.c
+++ b/net/ipv6/ip6_tunnel.c
@@ -564,7 +564,7 @@ ip4ip6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
} else {
ip_rt_put(rt);
if (ip_route_input(skb2, eiph->daddr, eiph->saddr, eiph->tos,
- skb2->dev) ||
+ skb2->dev, 0) ||
skb_dst(skb2)->dev->type != ARPHRD_TUNNEL)
goto out;
}
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index d79fa67..5732ff5 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -385,7 +385,7 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
goto drop;
}
- if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) {
+ if ((rc = ip_queue_rcv_skb(sk, skb)) < 0) {
/* Note that an ENOMEM error is charged twice */
if (rc == -ENOMEM) {
UDP6_INC_STATS_BH(sock_net(sk),
^ permalink raw reply related
* Re: [net-next-2.6 PATCH 1/3] mlx4_en: Adaptive moderation policy change
From: David Miller @ 2009-07-21 20:10 UTC (permalink / raw)
To: yevgenyp; +Cc: netdev, rdreier
In-Reply-To: <4A631A64.50804@mellanox.co.il>
Well Roland, after you flamed me last time for applying mlx4 patches
without your review, I'd like to know if you're going to look at these
three patches and also the independently submitted "mlx4: Fix double
pci unmapping." bug fix from Yevgeny or are these changes going to
simply rot on netdev?
They all look fine to me, but hey I remember what happened last time
:-)
^ permalink raw reply
* [PATCH] register at91_ether using platform_driver_probe
From: Uwe Kleine-König @ 2009-07-21 20:11 UTC (permalink / raw)
To: linux-kernel
Cc: David Brownell, netdev, Paulius Zaleckas, Marc Pignat,
Andrew Victor, Roel Kluin, Andrew Morton, Greg Kroah-Hartman
In-Reply-To: <200907111527.46441.david-b@pacbell.net>
at91ether_probe lives in .init.text, so using platform_driver_register
to register it is wrong because binding a device after the init memory
is discarded (e.g. via sysfs) results in an oops.
As requested by David Brownell platform_driver_probe is used instead of
moving the probe function to .devinit.text as proposed initially.
This saves some memory, but devices registered after the driver is
probed are not bound (probably there are none) and binding via sysfs
isn't possible.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: netdev@vger.kernel.org
Cc: Paulius Zaleckas <paulius.zaleckas@teltonika.lt>
Cc: Marc Pignat <marc.pignat@hevs.ch>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/arm/at91_ether.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/drivers/net/arm/at91_ether.c b/drivers/net/arm/at91_ether.c
index 2e7419a..5041d10 100644
--- a/drivers/net/arm/at91_ether.c
+++ b/drivers/net/arm/at91_ether.c
@@ -1228,7 +1228,6 @@ static int at91ether_resume(struct platform_device *pdev)
#endif
static struct platform_driver at91ether_driver = {
- .probe = at91ether_probe,
.remove = __devexit_p(at91ether_remove),
.suspend = at91ether_suspend,
.resume = at91ether_resume,
@@ -1240,7 +1239,7 @@ static struct platform_driver at91ether_driver = {
static int __init at91ether_init(void)
{
- return platform_driver_register(&at91ether_driver);
+ return platform_driver_probe(&at91ether_driver, at91ether_probe);
}
static void __exit at91ether_exit(void)
--
tg: (4b0a840..) t/platsection/at91ether_driver (depends on: linus/master)
^ permalink raw reply related
* Re: [PATCH] USB host CDC Phonet network interface driver
From: Marcel Holtmann @ 2009-07-21 20:14 UTC (permalink / raw)
To: David Miller
Cc: remi.denis-courmont-xNZwKgViW5gAvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20090721.124217.03326492.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Hi Dave,
> > Many Nokia handsets support a Phonet interface to the cellular modem
> > via a vendor-specific USB interface. CDC Phonet follows the
> > Communications Device Class model, with one control interface, and
> > and a pair of inactive and active data alternative interface. The later
> > has two bulk endpoint, one per direction.
> >
> > This was tested against Nokia E61, Nokia N95, and the existing Phonet
> > gadget function for the Linux composite USB gadget framework.
> >
> > Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
>
> Applied, thanks.
I think that Remi sent an updated version today.
Regards
Marcel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] USB host CDC Phonet network interface driver
From: David Miller @ 2009-07-21 20:18 UTC (permalink / raw)
To: marcel-kz+m5ild9QBg9hUCZPvPmw
Cc: remi.denis-courmont-xNZwKgViW5gAvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1248207240.28545.14.camel@violet>
From: Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
Date: Tue, 21 Jul 2009 22:14:00 +0200
> Hi Dave,
>
>> > Many Nokia handsets support a Phonet interface to the cellular modem
>> > via a vendor-specific USB interface. CDC Phonet follows the
>> > Communications Device Class model, with one control interface, and
>> > and a pair of inactive and active data alternative interface. The later
>> > has two bulk endpoint, one per direction.
>> >
>> > This was tested against Nokia E61, Nokia N95, and the existing Phonet
>> > gadget function for the Linux composite USB gadget framework.
>> >
>> > Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont-xNZwKgViW5g@public.gmane.orgm>
>>
>> Applied, thanks.
>
> I think that Remi sent an updated version today.
I'm pretty sure I applied the updated patch.
I'll double check to make sure.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] USB host CDC Phonet network interface driver
From: Marcel Holtmann @ 2009-07-21 20:20 UTC (permalink / raw)
To: David Miller
Cc: remi.denis-courmont-xNZwKgViW5gAvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20090721.131816.116617596.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Hi Dave,
> >> > Many Nokia handsets support a Phonet interface to the cellular modem
> >> > via a vendor-specific USB interface. CDC Phonet follows the
> >> > Communications Device Class model, with one control interface, and
> >> > and a pair of inactive and active data alternative interface. The later
> >> > has two bulk endpoint, one per direction.
> >> >
> >> > This was tested against Nokia E61, Nokia N95, and the existing Phonet
> >> > gadget function for the Linux composite USB gadget framework.
> >> >
> >> > Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
> >>
> >> Applied, thanks.
> >
> > I think that Remi sent an updated version today.
>
> I'm pretty sure I applied the updated patch.
>
> I'll double check to make sure.
I only mentioned it because your reply is to this patch and not the
other one from today. He sent 3 versions of it if I am not mis-counting.
Regards
Marcel
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH] USB host CDC Phonet network interface driver
From: David Miller @ 2009-07-21 20:20 UTC (permalink / raw)
To: marcel-kz+m5ild9QBg9hUCZPvPmw
Cc: remi.denis-courmont-xNZwKgViW5gAvxtiuMwx3w,
netdev-u79uwXL29TY76Z2rM5mHXA, linux-usb-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <20090721.131816.116617596.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
From: David Miller <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
Date: Tue, 21 Jul 2009 13:18:16 -0700 (PDT)
> From: Marcel Holtmann <marcel-kz+m5ild9QBg9hUCZPvPmw@public.gmane.org>
> Date: Tue, 21 Jul 2009 22:14:00 +0200
>
>> Hi Dave,
>>
>>> > Many Nokia handsets support a Phonet interface to the cellular modem
>>> > via a vendor-specific USB interface. CDC Phonet follows the
>>> > Communications Device Class model, with one control interface, and
>>> > and a pair of inactive and active data alternative interface. The later
>>> > has two bulk endpoint, one per direction.
>>> >
>>> > This was tested against Nokia E61, Nokia N95, and the existing Phonet
>>> > gadget function for the Linux composite USB gadget framework.
>>> >
>>> > Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
>>>
>>> Applied, thanks.
>>
>> I think that Remi sent an updated version today.
>
> I'm pretty sure I applied the updated patch.
>
> I'll double check to make sure.
I did apply the correct patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Kernel oops on setting sky2 interfaces down
From: Stephen Hemminger @ 2009-07-21 20:54 UTC (permalink / raw)
To: Rene Mayrhofer; +Cc: netdev, Richard Leitner
In-Reply-To: <4A661E36.7000109@gibraltar.at>
On Tue, 21 Jul 2009 21:59:50 +0200
Rene Mayrhofer <rene.mayrhofer@gibraltar.at> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Stephen Hemminger wrote:
> > Looks like the device is disappearing from the PCI bus when
> > brought down. Can you reproduce it with 2.6.30.2 or 2.6.31-rc3?
> >
> > Try later kernels.
> This is, as mentioned in my initial email, unfortunately not an option
> until later kernel support squashfs-lzma again. These embedded
> appliances boot from compact flash with the root FS in squashfs.
>
> The question probably is if newer sky2 module sources would compile and
> work with 2.6.28.10. Is this expected to work?
Kernel api (net_device_ops) changes are not in 2.6.28 as remember.
^ permalink raw reply
* [PATCH] igb/e1000e/e1000/e100: make wol usable
From: Andy Gospodarek @ 2009-07-21 21:01 UTC (permalink / raw)
To: netdev
Cc: jeffrey.t.kirsher, jesse.brandeburg, bruce.w.allan,
peter.p.waskiewicz.jr, john.ronciak, stable
It seems that the patches that intended to use the new calls to check
status and capabilities for WOL and fix it up:
commit bc79fc8409b3dccbde072e8113cc1fb3fd876fc5
Author: Rafael J. Wysocki <rjw@sisk.pl>
Date: Wed Oct 29 14:22:18 2008 -0700
e100: adapt to the reworked PCI PM
commit e1b86d8479f90aadee57a3d07d8e61c815c202d9
Author: Rafael J. Wysocki <rjw@sisk.pl>
Date: Fri Nov 7 20:30:37 2008 +0000
igb: Use device_set_wakeup_enable
commit de1264896c8012a261c1cba17e6a61199c276ad3
Author: Rafael J. Wysocki <rjw@sisk.pl>
Date: Fri Nov 7 20:30:19 2008 +0000
e1000: Use device_set_wakeup_enable
commit 6ff68026f4757d68461b7fbeca5c944e1f5f8b44
Author: Rafael J. Wysocki <rjw@sisk.pl>
Date: Wed Nov 12 09:52:32 2008 +0000
e1000e: Use device_set_wakeup_enable
Unfortunately they left out some important bits. This should make sure
the e100, igb, e1000e, and e1000-based devices can actually enable WOL
rather than their current state which is reported as not supported.
This looks like it has been broken since 2.6.28.
Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
---
e100.c | 1 +
e1000/e1000_main.c | 1 +
e1000e/netdev.c | 1 +
igb/igb_main.c | 1 +
4 files changed, 4 insertions(+)
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index 569df19..8824952 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -2816,6 +2816,7 @@ static int __devinit e100_probe(struct pci_dev *pdev,
if ((nic->mac >= mac_82558_D101_A4) &&
(nic->eeprom[eeprom_id] & eeprom_id_wol)) {
nic->flags |= wol_magic;
+ device_init_wakeup(&pdev->dev, true);
device_set_wakeup_enable(&pdev->dev, true);
}
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c
index d7df00c..229d874 100644
--- a/drivers/net/e1000/e1000_main.c
+++ b/drivers/net/e1000/e1000_main.c
@@ -1208,6 +1208,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
/* initialize the wol settings based on the eeprom settings */
adapter->wol = adapter->eeprom_wol;
+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
/* print bus type/speed/width info */
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index 63415bb..5c2edaa 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -5196,6 +5196,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
/* initialize the wol settings based on the eeprom settings */
adapter->wol = adapter->eeprom_wol;
+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
/* save off EEPROM version number */
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index adb09d3..8512a40 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1475,6 +1475,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
/* initialize the wol settings based on the eeprom settings */
adapter->wol = adapter->eeprom_wol;
+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
/* reset the hardware with the new settings */
^ permalink raw reply related
* [PATCH] move xtsonic's probe function to .devinit.text
From: Uwe Kleine-König @ 2009-07-21 21:25 UTC (permalink / raw)
To: netdev; +Cc: Chris Zankel, David S. Miller, Andrew Morton, Greg Kroah-Hartman
In-Reply-To: <1248211527-32253-1-git-send-email-u.kleine-koenig@pengutronix.de>
A pointer to xtsonic_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Chris Zankel <chris@zankel.net>
Cc: David S. Miller <davem@davemloft.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: netdev@vger.kernel.org
---
drivers/net/xtsonic.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/xtsonic.c b/drivers/net/xtsonic.c
index 5a4ad15..0c44135 100644
--- a/drivers/net/xtsonic.c
+++ b/drivers/net/xtsonic.c
@@ -239,7 +239,7 @@ out:
* Actually probing is superfluous but we're paranoid.
*/
-int __init xtsonic_probe(struct platform_device *pdev)
+int __devinit xtsonic_probe(struct platform_device *pdev)
{
struct net_device *dev;
struct sonic_local *lp;
--
tg: (aea1f79..) t/platsection/xtsonic_driver (depends on: linus/master)
^ permalink raw reply related
* [PATCH] move macsonic's probe function to .devinit.text
From: Uwe Kleine-König @ 2009-07-21 21:25 UTC (permalink / raw)
To: netdev
Cc: Jeff Garzik, David S. Miller, Geert Uytterhoeven, Andrew Morton,
Greg Kroah-Hartman
In-Reply-To: <1248211527-32253-1-git-send-email-u.kleine-koenig@pengutronix.de>
A pointer to mac_sonic_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
Various other functions that are called by mac_sonic_probe need to move
to .devinit.text, too.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Tested-by: Finn Thain <fthain@telegraphics.com.au>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: netdev@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/macsonic.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/net/macsonic.c b/drivers/net/macsonic.c
index acd143d..8f492c7 100644
--- a/drivers/net/macsonic.c
+++ b/drivers/net/macsonic.c
@@ -179,7 +179,7 @@ static const struct net_device_ops macsonic_netdev_ops = {
.ndo_set_mac_address = eth_mac_addr,
};
-static int __init macsonic_init(struct net_device *dev)
+static int __devinit macsonic_init(struct net_device *dev)
{
struct sonic_local* lp = netdev_priv(dev);
@@ -223,7 +223,7 @@ static int __init macsonic_init(struct net_device *dev)
return 0;
}
-static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
+static int __devinit mac_onboard_sonic_ethernet_addr(struct net_device *dev)
{
struct sonic_local *lp = netdev_priv(dev);
const int prom_addr = ONBOARD_SONIC_PROM_BASE;
@@ -288,7 +288,7 @@ static int __init mac_onboard_sonic_ethernet_addr(struct net_device *dev)
} else return 0;
}
-static int __init mac_onboard_sonic_probe(struct net_device *dev)
+static int __devinit mac_onboard_sonic_probe(struct net_device *dev)
{
/* Bwahahaha */
static int once_is_more_than_enough;
@@ -409,7 +409,7 @@ static int __init mac_onboard_sonic_probe(struct net_device *dev)
return macsonic_init(dev);
}
-static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev,
+static int __devinit mac_nubus_sonic_ethernet_addr(struct net_device *dev,
unsigned long prom_addr,
int id)
{
@@ -424,7 +424,7 @@ static int __init mac_nubus_sonic_ethernet_addr(struct net_device *dev,
return 0;
}
-static int __init macsonic_ident(struct nubus_dev *ndev)
+static int __devinit macsonic_ident(struct nubus_dev *ndev)
{
if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC &&
ndev->dr_sw == NUBUS_DRSW_SONIC_LC)
@@ -449,7 +449,7 @@ static int __init macsonic_ident(struct nubus_dev *ndev)
return -1;
}
-static int __init mac_nubus_sonic_probe(struct net_device *dev)
+static int __devinit mac_nubus_sonic_probe(struct net_device *dev)
{
static int slots;
struct nubus_dev* ndev = NULL;
@@ -562,7 +562,7 @@ static int __init mac_nubus_sonic_probe(struct net_device *dev)
return macsonic_init(dev);
}
-static int __init mac_sonic_probe(struct platform_device *pdev)
+static int __devinit mac_sonic_probe(struct platform_device *pdev)
{
struct net_device *dev;
struct sonic_local *lp;
--
tg: (aea1f79..) t/platsection/mac_sonic_driver (depends on: linus/master)
^ permalink raw reply related
* [PATCH] move meth's probe function to .devinit.text
From: Uwe Kleine-König @ 2009-07-21 21:25 UTC (permalink / raw)
To: netdev
Cc: David S. Miller, Thomas Bogendoerfer, Christoph Lameter,
Jeff Garzik, Andrew Morton, Greg Kroah-Hartman
In-Reply-To: <1248211527-32253-1-git-send-email-u.kleine-koenig@pengutronix.de>
A pointer to meth_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: David S. Miller <davem@davemloft.net>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: netdev@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/meth.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/meth.c b/drivers/net/meth.c
index 5d04d94..0dddb02 100644
--- a/drivers/net/meth.c
+++ b/drivers/net/meth.c
@@ -784,7 +784,7 @@ static const struct net_device_ops meth_netdev_ops = {
/*
* The init function.
*/
-static int __init meth_probe(struct platform_device *pdev)
+static int __devinit meth_probe(struct platform_device *pdev)
{
struct net_device *dev;
struct meth_private *priv;
--
tg: (aea1f79..) t/platsection/meth_driver (depends on: linus/master)
^ permalink raw reply related
* [PATCH] move jazzsonic's probe function to .devinit.text
From: Uwe Kleine-König @ 2009-07-21 21:25 UTC (permalink / raw)
To: netdev
Cc: Jeff Garzik, David S. Miller, Thomas Bogendoerfer, Finn Thain,
Geert Uytterhoeven, Andrew Morton, Greg Kroah-Hartman
A pointer to jazz_sonic_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
As noticed by Geert Uytterhoeven sonic_probe1 is called by
jazz_sonic_probe, so the former has to move to .devinit.text, too.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Jeff Garzik <jeff@garzik.org>
Cc: David S. Miller <davem@davemloft.net>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Cc: Finn Thain <fthain@telegraphics.com.au>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: netdev@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
---
drivers/net/jazzsonic.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/jazzsonic.c b/drivers/net/jazzsonic.c
index d12106b..8baf595 100644
--- a/drivers/net/jazzsonic.c
+++ b/drivers/net/jazzsonic.c
@@ -108,7 +108,7 @@ static const struct net_device_ops sonic_netdev_ops = {
.ndo_set_mac_address = eth_mac_addr,
};
-static int __init sonic_probe1(struct net_device *dev)
+static int __devinit sonic_probe1(struct net_device *dev)
{
static unsigned version_printed;
unsigned int silicon_revision;
@@ -211,7 +211,7 @@ out:
* Probe for a SONIC ethernet controller on a Mips Jazz board.
* Actually probing is superfluous but we're paranoid.
*/
-static int __init jazz_sonic_probe(struct platform_device *pdev)
+static int __devinit jazz_sonic_probe(struct platform_device *pdev)
{
struct net_device *dev;
struct sonic_local *lp;
--
tg: (aea1f79..) t/platsection/jazz_sonic_driver (depends on: linus/master)
^ permalink raw reply related
* [PATCH] move sb1250-mac's probe function to .devinit.text
From: Uwe Kleine-König @ 2009-07-21 21:25 UTC (permalink / raw)
To: netdev
Cc: Weiwei Wang, Jeff Garzik, David S. Miller, Stephen Hemminger,
Andrew Morton, Greg Kroah-Hartman
In-Reply-To: <1248211527-32253-1-git-send-email-u.kleine-koenig@pengutronix.de>
A pointer to sbmac_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Weiwei Wang <weiwei.wang@windriver.com>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Acked-by: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: netdev@vger.kernel.org
---
drivers/net/sb1250-mac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/sb1250-mac.c b/drivers/net/sb1250-mac.c
index d8c9cf1..96b37b9 100644
--- a/drivers/net/sb1250-mac.c
+++ b/drivers/net/sb1250-mac.c
@@ -2688,7 +2688,7 @@ static int sbmac_poll(struct napi_struct *napi, int budget)
}
-static int __init sbmac_probe(struct platform_device *pldev)
+static int __devinit sbmac_probe(struct platform_device *pldev)
{
struct net_device *dev;
struct sbmac_softc *sc;
--
tg: (aea1f79..) t/platsection/sbmac_driver (depends on: linus/master)
^ permalink raw reply related
* [PATCH] move sgiseeq's probe function to .devinit.text
From: Uwe Kleine-König @ 2009-07-21 21:25 UTC (permalink / raw)
To: netdev
Cc: Wang Chen, David S. Miller, Andrew Morton, Jeff Garzik,
Thomas Bogendoerfer, Greg Kroah-Hartman
In-Reply-To: <1248211527-32253-1-git-send-email-u.kleine-koenig@pengutronix.de>
A pointer to sgiseeq_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded. Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.
An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Wang Chen <wangchen@cn.fujitsu.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Jeff Garzik <jgarzik@redhat.com>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: netdev@vger.kernel.org
---
drivers/net/sgiseeq.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/sgiseeq.c b/drivers/net/sgiseeq.c
index 5fb88ca..53fa4f6 100644
--- a/drivers/net/sgiseeq.c
+++ b/drivers/net/sgiseeq.c
@@ -720,7 +720,7 @@ static const struct net_device_ops sgiseeq_netdev_ops = {
.ndo_validate_addr = eth_validate_addr,
};
-static int __init sgiseeq_probe(struct platform_device *pdev)
+static int __devinit sgiseeq_probe(struct platform_device *pdev)
{
struct sgiseeq_platform_data *pd = pdev->dev.platform_data;
struct hpc3_regs *hpcregs = pd->hpc;
--
tg: (aea1f79..) t/platsection/sgiseeq_driver (depends on: linus/master)
^ permalink raw reply related
* Re: [2.6.30.1] Significant latency playing video file from NFS4 share
From: Frans Pop @ 2009-07-21 21:54 UTC (permalink / raw)
To: Trond Myklebust
Cc: linux-nfs-u79uwXL29TY76Z2rM5mHXA, Linux Kernel Mailing List,
netdev-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <1248199105.21343.16.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
On Tuesday 21 July 2009, Trond Myklebust wrote:
> This would be where you are losing your performance. 1998.933 ms rtt
> means that you are seeing a 2 second delay from the instant the RPC
> client pushes the request into the socket to the moment that socket
> receives a reply from the server.
>
> Basically, you have either a _very_ slow server, or (more likely) a
The server should be fast enough.
> networking problem. A tcpdump ought to be able to show what the problem
> is: whether it is the packets getting ACKed very slowly, and/or if you
> have dropped packet issues or if it is truly a problem with the server
> taking a long time to reply.
I did run a traceroute alongside and that did not show packet loss, but I
do now see some TCP data loss events and retransmits of segments in
'netstat -s', and "TCP Previous segment lost" with varying time gaps in
wireshark. So I guess it is indeed a networking problem.
As I see it both with wired and wireless on the client, the problem must
be either in the server or the switch near the server (replacing the
cable from the server did not help).
I suspect the integrated e1000e NIC. Guess I'll add an extra NIC in the
server soon to see if that helps.
Thanks a lot for your help!
P.S. I see one strange thing in wireshark: NFS (or the networking stack)
seems to switch between small and large package (?) sizes occasionally in
the same stream. Is that normal?
Source Destination Protocol Info
[...]
<server> <client> RPC Continuation
<server> <client> RPC Continuation
<client> <server> TCP kink > nfs [ACK] ...
<server> <client> RPC Continuation
<server> <client> RPC Continuation
<client> <server> TCP kink > nfs [ACK] ...
<server> <client> TCP [TCP segment of reassembled PDU]
<server> <client> TCP [TCP segment of reassembled PDU]
<client> <server> TCP kink > nfs [ACK] ...
<server> <client> TCP [TCP segment of reassembled PDU]
<server> <client> TCP [TCP segment of reassembled PDU]
<client> <server> TCP kink > nfs [ACK] ...
[...]
<server> <client> TCP [TCP segment of reassembled PDU]
<server> <client> RPC Continuation (total: 65535 bytes)
<client> <server> TCP kink > nfs [ACK] ...
<server> <client> RPC Continuation
<server> <client> RPC Continuation
<client> <server> TCP kink > nfs [ACK] ...
[...]
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* RE: [PATCH] igb/e1000e/e1000/e100: make wol usable
From: Ronciak, John @ 2009-07-21 21:59 UTC (permalink / raw)
To: Andy Gospodarek, netdev@vger.kernel.org
Cc: Kirsher, Jeffrey T, Brandeburg, Jesse, Allan, Bruce W,
Waskiewicz Jr, Peter P, stable@kernel.org
In-Reply-To: <20090721210115.GL8515@gospo.rdu.redhat.com>
>-----Original Message-----
>From: Andy Gospodarek [mailto:andy@greyhouse.net]
>Sent: Tuesday, July 21, 2009 2:01 PM
>To: netdev@vger.kernel.org
>Cc: Kirsher, Jeffrey T; Brandeburg, Jesse; Allan, Bruce W;
>Waskiewicz Jr, Peter P; Ronciak, John; stable@kernel.org
>Subject: [PATCH] igb/e1000e/e1000/e100: make wol usable
>
>
>It seems that the patches that intended to use the new calls to check
>status and capabilities for WOL and fix it up:
>
> commit bc79fc8409b3dccbde072e8113cc1fb3fd876fc5
> Author: Rafael J. Wysocki <rjw@sisk.pl>
> Date: Wed Oct 29 14:22:18 2008 -0700
>
> e100: adapt to the reworked PCI PM
>
> commit e1b86d8479f90aadee57a3d07d8e61c815c202d9
> Author: Rafael J. Wysocki <rjw@sisk.pl>
> Date: Fri Nov 7 20:30:37 2008 +0000
>
> igb: Use device_set_wakeup_enable
>
> commit de1264896c8012a261c1cba17e6a61199c276ad3
> Author: Rafael J. Wysocki <rjw@sisk.pl>
> Date: Fri Nov 7 20:30:19 2008 +0000
>
> e1000: Use device_set_wakeup_enable
>
> commit 6ff68026f4757d68461b7fbeca5c944e1f5f8b44
> Author: Rafael J. Wysocki <rjw@sisk.pl>
> Date: Wed Nov 12 09:52:32 2008 +0000
>
> e1000e: Use device_set_wakeup_enable
>
>Unfortunately they left out some important bits. This should make sure
>the e100, igb, e1000e, and e1000-based devices can actually enable WOL
>rather than their current state which is reported as not supported.
>
>This looks like it has been broken since 2.6.28.
>
>Signed-off-by: Andy Gospodarek <andy@greyhouse.net>
>---
>
> e100.c | 1 +
> e1000/e1000_main.c | 1 +
> e1000e/netdev.c | 1 +
> igb/igb_main.c | 1 +
> 4 files changed, 4 insertions(+)
>
>diff --git a/drivers/net/e100.c b/drivers/net/e100.c
>index 569df19..8824952 100644
>--- a/drivers/net/e100.c
>+++ b/drivers/net/e100.c
>@@ -2816,6 +2816,7 @@ static int __devinit e100_probe(struct
>pci_dev *pdev,
> if ((nic->mac >= mac_82558_D101_A4) &&
> (nic->eeprom[eeprom_id] & eeprom_id_wol)) {
> nic->flags |= wol_magic;
>+ device_init_wakeup(&pdev->dev, true);
> device_set_wakeup_enable(&pdev->dev, true);
> }
>
>diff --git a/drivers/net/e1000/e1000_main.c
>b/drivers/net/e1000/e1000_main.c
>index d7df00c..229d874 100644
>--- a/drivers/net/e1000/e1000_main.c
>+++ b/drivers/net/e1000/e1000_main.c
>@@ -1208,6 +1208,7 @@ static int __devinit e1000_probe(struct
>pci_dev *pdev,
>
> /* initialize the wol settings based on the eeprom settings */
> adapter->wol = adapter->eeprom_wol;
>+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
> device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
>
> /* print bus type/speed/width info */
>diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
>index 63415bb..5c2edaa 100644
>--- a/drivers/net/e1000e/netdev.c
>+++ b/drivers/net/e1000e/netdev.c
>@@ -5196,6 +5196,7 @@ static int __devinit e1000_probe(struct
>pci_dev *pdev,
>
> /* initialize the wol settings based on the eeprom settings */
> adapter->wol = adapter->eeprom_wol;
>+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
> device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
>
> /* save off EEPROM version number */
>diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
>index adb09d3..8512a40 100644
>--- a/drivers/net/igb/igb_main.c
>+++ b/drivers/net/igb/igb_main.c
>@@ -1475,6 +1475,7 @@ static int __devinit igb_probe(struct
>pci_dev *pdev,
>
> /* initialize the wol settings based on the eeprom settings */
> adapter->wol = adapter->eeprom_wol;
>+ device_init_wakeup(&adapter->pdev->dev, adapter->wol);
> device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
>
> /* reset the hardware with the new settings */
Andy,
WoL not supported is reported back when WoL is disabled in the EEPROM. So if this is happening to you, that system (or at least that interface) has WoL disabled. How are you testing this?
Cheers,
John
-----------------------------------------------------------
"...that your people will judge you on what you can build, not what you destroy.", B. Obama, 2009
^ permalink raw reply
* [PATCH v3] net: Rework mdio-ofgpio driver to use of_mdio infrastructure
From: Mark Ware @ 2009-07-21 22:24 UTC (permalink / raw)
To: Grant Likely, netdev, Linuxppc-dev Development
Changes to the fs_enet driver (aa73832c5a80d6c52c69b18af858d88fa595dd3c) cause kernel crashes when using the mdio-ofgpio driver.
This patch replicates similar changes made to the fs_enet mii-bitbang drivers. It has been tested on a custom mpc8280 based board using an NFS
mounted root.
Signed-off-by: Mark Ware <mware@elphinstone.net>
Acked-by: Grant Likely <grant.likely@secretlab.ca>
---
The only changes in v3 are to the commit message.
drivers/net/phy/mdio-gpio.c | 77 ++++++++++++++++++++-----------------------
1 files changed, 36 insertions(+), 41 deletions(-)
diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index 33984b7..22cdd45 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -30,6 +30,7 @@
#ifdef CONFIG_OF_GPIO
#include <linux/of_gpio.h>
+#include <linux/of_mdio.h>
#include <linux/of_platform.h>
#endif
@@ -81,13 +82,12 @@ static struct mdiobb_ops mdio_gpio_ops = {
.get_mdio_data = mdio_get,
};
-static int __devinit mdio_gpio_bus_init(struct device *dev,
+static struct mii_bus * __devinit mdio_gpio_bus_init(struct device *dev,
struct mdio_gpio_platform_data *pdata,
int bus_id)
{
struct mii_bus *new_bus;
struct mdio_gpio_info *bitbang;
- int ret = -ENOMEM;
int i;
bitbang = kzalloc(sizeof(*bitbang), GFP_KERNEL);
@@ -104,8 +104,6 @@ static int __devinit mdio_gpio_bus_init(struct device *dev,
new_bus->name = "GPIO Bitbanged MDIO",
- ret = -ENODEV;
-
new_bus->phy_mask = pdata->phy_mask;
new_bus->irq = pdata->irqs;
new_bus->parent = dev;
@@ -129,15 +127,8 @@ static int __devinit mdio_gpio_bus_init(struct device *dev,
dev_set_drvdata(dev, new_bus);
- ret = mdiobus_register(new_bus);
- if (ret)
- goto out_free_all;
-
- return 0;
+ return new_bus;
-out_free_all:
- dev_set_drvdata(dev, NULL);
- gpio_free(bitbang->mdio);
out_free_mdc:
gpio_free(bitbang->mdc);
out_free_bus:
@@ -145,30 +136,47 @@ out_free_bus:
out_free_bitbang:
kfree(bitbang);
out:
- return ret;
+ return NULL;
}
-static void __devexit mdio_gpio_bus_destroy(struct device *dev)
+static void __devinit mdio_gpio_bus_deinit(struct device *dev)
{
struct mii_bus *bus = dev_get_drvdata(dev);
struct mdio_gpio_info *bitbang = bus->priv;
- mdiobus_unregister(bus);
- free_mdio_bitbang(bus);
dev_set_drvdata(dev, NULL);
- gpio_free(bitbang->mdc);
gpio_free(bitbang->mdio);
+ gpio_free(bitbang->mdc);
+ free_mdio_bitbang(bus);
kfree(bitbang);
}
+static void __devexit mdio_gpio_bus_destroy(struct device *dev)
+{
+ struct mii_bus *bus = dev_get_drvdata(dev);
+
+ mdiobus_unregister(bus);
+ mdio_gpio_bus_deinit(dev);
+}
+
static int __devinit mdio_gpio_probe(struct platform_device *pdev)
{
struct mdio_gpio_platform_data *pdata = pdev->dev.platform_data;
+ struct mii_bus *new_bus;
+ int ret;
if (!pdata)
return -ENODEV;
- return mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id);
+ new_bus = mdio_gpio_bus_init(&pdev->dev, pdata, pdev->id);
+ if (!new_bus)
+ return -ENODEV;
+
+ ret = mdiobus_register(new_bus);
+ if (ret)
+ mdio_gpio_bus_deinit(&pdev->dev);
+
+ return ret;
}
static int __devexit mdio_gpio_remove(struct platform_device *pdev)
@@ -179,29 +187,12 @@ static int __devexit mdio_gpio_remove(struct platform_device *pdev)
}
#ifdef CONFIG_OF_GPIO
-static void __devinit add_phy(struct mdio_gpio_platform_data *pdata,
- struct device_node *np)
-{
- const u32 *data;
- int len, id, irq;
-
- data = of_get_property(np, "reg", &len);
- if (!data || len != 4)
- return;
-
- id = *data;
- pdata->phy_mask &= ~(1 << id);
-
- irq = of_irq_to_resource(np, 0, NULL);
- if (irq)
- pdata->irqs[id] = irq;
-}
static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
const struct of_device_id *match)
{
- struct device_node *np = NULL;
struct mdio_gpio_platform_data *pdata;
+ struct mii_bus *new_bus;
int ret;
pdata = kzalloc(sizeof(*pdata), GFP_KERNEL);
@@ -215,14 +206,18 @@ static int __devinit mdio_ofgpio_probe(struct of_device *ofdev,
ret = of_get_gpio(ofdev->node, 1);
if (ret < 0)
- goto out_free;
+ goto out_free;
pdata->mdio = ret;
- while ((np = of_get_next_child(ofdev->node, np)))
- if (!strcmp(np->type, "ethernet-phy"))
- add_phy(pdata, np);
+ new_bus = mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc);
+ if (!new_bus)
+ return -ENODEV;
- return mdio_gpio_bus_init(&ofdev->dev, pdata, pdata->mdc);
+ ret = of_mdiobus_register(new_bus, ofdev->node);
+ if (ret)
+ mdio_gpio_bus_deinit(&ofdev->dev);
+
+ return ret;
out_free:
kfree(pdata);
--
1.5.6.5
^ permalink raw reply related
* Re: r8169 not advertising 1000mbit after suspend anymore
From: Francois Romieu @ 2009-07-21 22:37 UTC (permalink / raw)
To: Benjamin S.; +Cc: netdev
In-Reply-To: <20090719190937.7393ea99@pluto-lenny.milky.way>
Benjamin S. <sbenni@gmx.de> :
[...]
> I have a Gigabyte GA-MA78G-DS3H mainboard with a RTL8111/8168B Realtek
> Gigabit Ethernet Controller. Until first suspend everything works as
> expected, but after suspend only 100mbit are used instead of 1000.
Which kernel do you use ?
[...]
> mii-tool after suspend:
> eth0: negotiated 100baseTx-FD flow-control, link ok
> product info: vendor 00:07:32, model 17 rev 2
> basic mode: autonegotiation enabled
> basic status: autonegotiation complete, link ok
> capabilities: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD
> advertising: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
> link partner: 100baseTx-FD 100baseTx-HD 10baseT-FD 10baseT-HD flow-control
>
> mii-tool after setting speed to 1000 with "ethtool -s eth0 speed 1000":
> eth0: negotiated 1000baseT-FD flow-control, link ok
[snip]
At which point it works correctly again, right ?
[...]
> I did not knew if the Switch could be the problem and thus I connected the
> card to my laptop which also has a gigabit controller, but the result was
> the same as above.
At least some 8168 appear to lose the link settings :o/
Please send the XID line of the offender taken from dmesg.
--
Ueimor
^ permalink raw reply
* [PATCH 1/1] ipv4: IP_RECVERR should also enqueue source quench messages
From: Hagen Paul Pfeifer @ 2009-07-21 23:32 UTC (permalink / raw)
To: netdev
Currently ICMP source quench messages are silently dropped and not
enqueued in a per-socket error queue. The socket option IP_RECVERR
enables a connected datagram socket to notice error conditions received
via ICMP. This modification allows applications to notice ICMP source
quench error condition too.
Side note: source quench are obsolete since day ~0 and are one of the
early design mistakes of the Internet. Anyway, this does not interfere
with the fact that a connected socket should not be informed about
received source quench messages.
Signed-off-by: Hagen Paul Pfeifer <hagen@jauu.net>
---
net/ipv4/raw.c | 3 ++-
net/ipv4/udp.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/raw.c b/net/ipv4/raw.c
index 2979f14..1d73953 100644
--- a/net/ipv4/raw.c
+++ b/net/ipv4/raw.c
@@ -229,7 +229,8 @@ static void raw_err(struct sock *sk, struct sk_buff *skb, u32 info)
err = EHOSTUNREACH;
break;
case ICMP_SOURCE_QUENCH:
- return;
+ err = ENOBUFS;
+ break;
case ICMP_PARAMETERPROB:
err = EPROTO;
harderr = 1;
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 80e3812..ba4a4a8 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -409,7 +409,8 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct udp_table *udptable)
err = EHOSTUNREACH;
break;
case ICMP_SOURCE_QUENCH:
- goto out;
+ err = ENOBUFS;
+ break;
case ICMP_PARAMETERPROB:
err = EPROTO;
harderr = 1;
--
1.6.3.GIT
^ permalink raw reply related
* Re: [PATCH] move xtsonic's probe function to .devinit.text
From: Chris Zankel @ 2009-07-22 0:00 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: netdev, David S. Miller, Andrew Morton, Greg Kroah-Hartman
In-Reply-To: <1248211527-32253-6-git-send-email-u.kleine-koenig@pengutronix.de>
Hi Uwe,
I will add it to the Xtensa tree in the next couple of days (together
with other patches that have piled up - still fighting a compiler issue).
Thanks,
-Chris
Uwe Kleine-König wrote:
> A pointer to xtsonic_probe is passed to the core via
> platform_driver_register and so the function must not disappear when the
> .init sections are discarded. Otherwise (if also having HOTPLUG=y)
> unbinding and binding a device to the driver via sysfs will result in an
> oops as does a device being registered late.
>
> An alternative to this patch is using platform_driver_probe instead of
> platform_driver_register plus removing the pointer to the probe function
> from the struct platform_driver.
>
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> Cc: Chris Zankel <chris@zankel.net>
>
> Cc: David S. Miller <davem@davemloft.net>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Greg Kroah-Hartman <gregkh@suse.de>
> Cc: netdev@vger.kernel.org
>
> ---
> drivers/net/xtsonic.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/xtsonic.c b/drivers/net/xtsonic.c
> index 5a4ad15..0c44135 100644
> --- a/drivers/net/xtsonic.c
> +++ b/drivers/net/xtsonic.c
> @@ -239,7 +239,7 @@ out:
> * Actually probing is superfluous but we're paranoid.
> */
>
> -int __init xtsonic_probe(struct platform_device *pdev)
> +int __devinit xtsonic_probe(struct platform_device *pdev)
> {
> struct net_device *dev;
> struct sonic_local *lp;
>
^ permalink raw reply
* [PATCH] sky2: remove unnecessary assignment
From: Mike McCormack @ 2009-07-22 0:51 UTC (permalink / raw)
To: netdev; +Cc: Stephen Hemminger
Signed-off-by: Mike McCormack <mikem@ring3k.org>
---
drivers/net/sky2.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index 3550c5d..661abd0 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -4117,7 +4117,7 @@ static int sky2_debug_show(struct seq_file *seq, void *v)
seq_printf(seq, "\nRx ring hw get=%d put=%d last=%d\n",
sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_GET_IDX)),
- last = sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_PUT_IDX)),
+ sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_PUT_IDX)),
sky2_read16(hw, Y2_QADDR(rxqaddr[port], PREF_UNIT_LAST_IDX)));
sky2_read32(hw, B0_Y2_SP_LISR);
--
1.5.6.5
^ permalink raw reply related
* [PATCH] sky2: Avoid races in sky2_down
From: Mike McCormack @ 2009-07-22 0:50 UTC (permalink / raw)
To: netdev
Reset rx chain before trying to drain it.
Shut interrupts off last, incase there's something to report.
Signed-off-by: Mike McCormack <mikem@ring3k.org>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
---
drivers/net/sky2.c | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
index ba768df..3550c5d 100644
--- a/drivers/net/sky2.c
+++ b/drivers/net/sky2.c
@@ -1818,12 +1818,6 @@ static int sky2_down(struct net_device *dev)
if (netif_msg_ifdown(sky2))
printk(KERN_INFO PFX "%s: disabling interface\n", dev->name);
- /* Disable port IRQ */
- imask = sky2_read32(hw, B0_IMSK);
- imask &= ~portirq_msk[port];
- sky2_write32(hw, B0_IMSK, imask);
- sky2_read32(hw, B0_IMSK);
-
/* Force flow control off */
sky2_write8(hw, SK_REG(port, GMAC_CTRL), GMC_PAUSE_OFF);
@@ -1863,8 +1857,6 @@ static int sky2_down(struct net_device *dev)
sky2_write32(hw, RB_ADDR(txqaddr[port], RB_CTRL), RB_RST_SET);
- sky2_rx_stop(sky2);
-
sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_SET);
sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_RST_SET);
@@ -1874,6 +1866,14 @@ static int sky2_down(struct net_device *dev)
sky2_write32(hw, STAT_ISR_TIMER_CNT, 0);
sky2_read8(hw, STAT_ISR_TIMER_CTRL);
+ sky2_rx_stop(sky2);
+
+ /* Disable port IRQ */
+ imask = sky2_read32(hw, B0_IMSK);
+ imask &= ~portirq_msk[port];
+ sky2_write32(hw, B0_IMSK, imask);
+ sky2_read32(hw, B0_IMSK);
+
synchronize_irq(hw->pdev->irq);
napi_synchronize(&hw->napi);
--
1.5.6.5
^ permalink raw reply related
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