* Re: Frequent spurious tx_timeouts for libertas
From: Daniel Drake @ 2011-05-02 20:01 UTC (permalink / raw)
To: Ben Hutchings
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
libertas-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-wireless
In-Reply-To: <BANLkTi=FT4v=Jvv5bQpUX15R87kPudKq=Q@mail.gmail.com>
On 2 May 2011 20:59, Daniel Drake <dsd-2X9k7bc8m7Mdnm+yROfE0A@public.gmane.org> wrote:
> dev->trans_start is unconditionally initialized by dev_activate() in
> sch_generic.c:
Also, many drivers (including libertas) set it in their tx_timeout handlers:
dev->trans_start = jiffies; /* prevent tx timeout */
I don't understand why (the TX timeout has already occurred, it can't
be prevented at that stage).
Daniel
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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: Frequent spurious tx_timeouts for libertas
From: Ben Hutchings @ 2011-05-02 20:47 UTC (permalink / raw)
To: Daniel Drake
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
libertas-dev-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r, linux-wireless
In-Reply-To: <BANLkTi=FT4v=Jvv5bQpUX15R87kPudKq=Q@mail.gmail.com>
On Mon, 2011-05-02 at 20:59 +0100, Daniel Drake wrote:
> On 2 May 2011 03:24, Ben Hutchings <bhutchings-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org> wrote:
> >> Also, while looking at this code, I spotted a bug in dev_watchdog():
> >> /*
> >> * old device drivers set dev->trans_start
> >> */
> >> trans_start = txq->trans_start ? : dev->trans_start;
> >>
> >> i.e. it is trying to figure out whether to read trans_start from txq
> >> or dev. In both cases, trans_start is updated based on the value of
> >> jiffies, which will occasionally be 0 (as it wraps around). Therefore
> >> this line of code will occasionally make the wrong decision.
> >
> > No, I don't think so.
> >
> > If only dev->trans_start is being updated then the watchdog reads that.
> > If both txq->trans_start and dev->trans_start are being updated then it
> > doesn't matter much which the watchdog reads.
> > If only txq->trans_start is being updated then dev->trans_start is
> > always set to 0, so when txq->trans_start is 0 the watchdog still gets
> > 0.
>
> dev->trans_start is unconditionally initialized by dev_activate() in
> sch_generic.c:
>
> if (need_watchdog) {
> dev->trans_start = jiffies;
> dev_watchdog_up(dev);
> }
>
> so it is (usually) not 0.
[...]
You're right. Seems like we have an incomplete compatibility hack that
can hurt drivers that are doing the right thing.
For those few single-queue drivers that need to update the transmit
time, perhaps we could add a dev_trans_update() as a wrapper for
txq_trans_update(). Then delete net_device::trans_start and change
dev_trans_start() to avoid using it.
Ben.
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" 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] ipheth.c: Enable IP header alignment
From: Ben Hutchings @ 2011-05-02 21:04 UTC (permalink / raw)
To: L. Alberto Giménez
Cc: linux-kernel, dgiagio, dborca, davem, pmcenery, david.hill,
open list:USB SUBSYSTEM, open list:NETWORKING DRIVERS
In-Reply-To: <1304364912-15444-1-git-send-email-agimenez@sysvalve.es>
On Mon, 2011-05-02 at 21:35 +0200, L. Alberto Giménez wrote:
> Since commit ea812ca1b06113597adcd8e70c0f84a413d97544 (x86: Align skb w/ start
> of cacheline on newer core 2/Xeon Arch), NET_IP_ALIGN changed from 2 to 0, and
> the constant is used to reserve more room for the socket buffer.
>
> Some people have reported that tethering stopped working and David Hill
> submited a patch that redefined NET_IP_ALIGN. Pointed by Ben Hutchings, the
> patch has been reworked to use a private constant.
>
> I have no more an iPhone device to test it, so it is only compile-tested.
>
> Signed-off-by: L. Alberto Giménez <agimenez@sysvalve.es>
> ---
> drivers/net/usb/ipheth.c | 8 +++++---
> 1 files changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/usb/ipheth.c b/drivers/net/usb/ipheth.c
> index 7d42f9a..8f1ffc7 100644
> --- a/drivers/net/usb/ipheth.c
> +++ b/drivers/net/usb/ipheth.c
> @@ -80,6 +80,8 @@
> #define IPHETH_CARRIER_CHECK_TIMEOUT round_jiffies_relative(1 * HZ)
> #define IPHETH_CARRIER_ON 0x04
>
> +#define IPHETH_IP_ALIGN 2
> +
> static struct usb_device_id ipheth_table[] = {
> { USB_DEVICE_AND_INTERFACE_INFO(
> USB_VENDOR_APPLE, USB_PRODUCT_IPHONE,
> @@ -205,15 +207,15 @@ static void ipheth_rcvbulk_callback(struct urb *urb)
> len = urb->actual_length;
> buf = urb->transfer_buffer;
>
> - skb = dev_alloc_skb(NET_IP_ALIGN + len);
> + skb = dev_alloc_skb(IPHETH_IP_ALIGN + len);
> if (!skb) {
> err("%s: dev_alloc_skb: -ENOMEM", __func__);
> dev->net->stats.rx_dropped++;
> return;
> }
>
> - skb_reserve(skb, NET_IP_ALIGN);
> - memcpy(skb_put(skb, len), buf + NET_IP_ALIGN, len - NET_IP_ALIGN);
> + skb_reserve(skb, IPHETH_IP_ALIGN);
> + memcpy(skb_put(skb, len), buf + IPHETH_IP_ALIGN, len - IPHETH_IP_ALIGN);
[...]
So this was using NET_IP_ALIGN as an offset into the URB. Which was
totally bogus, as its value has long been architecture-dependent. The
code is also claiming to put len bytes but only copying len - delta.
The correct code would be something like:
if (urb->actual_length <= IPHETH_IP_ALIGN) {
dev->net->stats.rx_length_errors++;
return;
}
len = urb->actual_length - IPHETH_IP_ALIGN;
buf = urb->transfer_buffer + IPHETH_IP_ALIGN;
dev_alloc_skb(len);
...
memcpy(skb_put(skb, len), buf, len);
Ben.
> skb->dev = dev->net;
> skb->protocol = eth_type_trans(skb, dev->net);
>
--
Ben Hutchings, Senior Software Engineer, Solarflare
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.
^ permalink raw reply
* Re: [PATCH] ipheth.c: Enable IP header alignment
From: L. Alberto Giménez @ 2011-05-02 21:12 UTC (permalink / raw)
To: David Miller
Cc: linux-kernel, dgiagio, dborca, pmcenery, david.hill, linux-usb,
netdev
In-Reply-To: <20110502.124622.226785624.davem@davemloft.net>
On Mon, May 02, 2011 at 12:46:22PM -0700, David Miller wrote:
>
> Why did this break things?
Hi, I don't know. As upstream is unresponsive and is applying patches to his
private repo without submitting them to the list (which I can understand), I
decided to submit the particular fix so mainline users can get tethering working
again.
I received a forwarded email with the patch (I think that's because I submitted
the driver to mainline) asking for the mainline driver status and if it was
being maintained.
>
> I'm not applying a fix when nobody can explain the reason why:
>
> 1) Things broke in the first place
> 2) Forcing reservation of 2 bytes fixes things
Honestly, I can't answer either of those ones. I just submitted a patch that
*seemed* to fix the problem (I don't own an iPhone device since long time ago),
after explictly requesting upstream to submit by himself, and getting a
negative.
> Where is the built in assumption about "2" and why does it exist? Why
> can't we fix this code not to have such assumptions in the first
> place?
Ditto.
At this point, I think that David, Diego or Daniel should step in if they want
to keep on with this discussion. I won't have problems if you want to take this
off-list.
Best regards,
--
L. Alberto Giménez
JabberID agimenez@jabber.sysvalve.es
GnuPG key ID 0x3BAABDE1
^ permalink raw reply
* [PATCH net-next-2.6] ipv4: Make sure flowi4->{saddr,daddr} are always set.
From: David Miller @ 2011-05-02 21:38 UTC (permalink / raw)
To: netdev
Slow path output route resolution always makes sure that
->{saddr,daddr} are set, and also if we trigger into IPSEC resolution
we initialize them as well, because xfrm_lookup() expects them to be
fully resolved.
But if we hit the fast path and flowi4->flowi4_proto is zero, we won't
do this initialization.
Therefore, move the IPSEC path initialization to the route cache
lookup fast path to make sure these are always set.
Signed-off-by: David S. Miller <davem@davemloft.net>
---
net/ipv4/route.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/net/ipv4/route.c b/net/ipv4/route.c
index 93f71be..64f360d 100644
--- a/net/ipv4/route.c
+++ b/net/ipv4/route.c
@@ -2675,6 +2675,10 @@ struct rtable *__ip_route_output_key(struct net *net, struct flowi4 *flp4)
dst_use(&rth->dst, jiffies);
RT_CACHE_STAT_INC(out_hit);
rcu_read_unlock_bh();
+ if (!flp4->saddr)
+ flp4->saddr = rth->rt_src;
+ if (!flp4->daddr)
+ flp4->daddr = rth->rt_dst;
return rth;
}
RT_CACHE_STAT_INC(out_hlist_search);
@@ -2772,15 +2776,10 @@ struct rtable *ip_route_output_flow(struct net *net, struct flowi4 *flp4,
if (IS_ERR(rt))
return rt;
- if (flp4->flowi4_proto) {
- if (!flp4->saddr)
- flp4->saddr = rt->rt_src;
- if (!flp4->daddr)
- flp4->daddr = rt->rt_dst;
+ if (flp4->flowi4_proto)
rt = (struct rtable *) xfrm_lookup(net, &rt->dst,
flowi4_to_flowi(flp4),
sk, 0);
- }
return rt;
}
--
1.7.4.5
^ permalink raw reply related
* Re: [PATCH] amd8111e: trivial typo spelling: Negotitate -> Negotiate
From: David Miller @ 2011-05-02 21:47 UTC (permalink / raw)
To: joe; +Cc: netdev
In-Reply-To: <1304366369.7792.45.camel@Joe-Laptop>
From: Joe Perches <joe@perches.com>
Date: Mon, 02 May 2011 12:59:29 -0700
> Signed-off-by: Joe Perches <joe@perches.com>
Applied, thanks Joe.
^ permalink raw reply
* Re: [PATCH] linux/stmmac.h: include <linux/platform_device.h> to remove compilation warning.
From: David Miller @ 2011-05-02 22:01 UTC (permalink / raw)
To: viresh.kumar
Cc: peppe.cavallaro, netdev, shiraz.hashim, armando.visconti,
deepak.sikri, viresh.linux
In-Reply-To: <2239eca1d15014be7b6d94f883f9492dc1fbc60a.1304317552.git.viresh.kumar@st.com>
From: Viresh Kumar <viresh.kumar@st.com>
Date: Mon, 2 May 2011 12:00:37 +0530
> stmmac.h uses struct platform_device and doesn't include
> <linux/platform_device.h>. And so we get following compilation warning while
> using this file:
> warning: ‘struct platform_device’ declared inside parameter list
>
> This patch includes <linux/platform_device.h> in stmmac.h to remove this warning
>
> Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
This patch applies to neither net-2.6, nor net-next-2.6
The context around your change in all current trees looks a lot
different than what's in your patch.
In fact, even if I go through the entire history in GIT of this
header file, those STMAC_TYPE_0 defines are never there.
The string "STMAC_TYPE_0" doesn't even show up in a query to google
code search.
What tree are you even patching against?
^ permalink raw reply
* RE: [E1000-devel] WoL stopped working after power off with 2.6.38 (e1000e specific?)
From: Allan, Bruce W @ 2011-05-02 22:02 UTC (permalink / raw)
To: Kamil Iskra, netdev@vger.kernel.org,
e1000-devel@lists.sourceforge.net
Cc: linux-pm@lists.linux-foundation.org
In-Reply-To: <20110430054519.GA9826@scooby.iskra.name>
>-----Original Message-----
>From: Kamil Iskra [mailto:kamil@iskra.name]
>Sent: Friday, April 29, 2011 10:45 PM
>To: netdev@vger.kernel.org; e1000-devel@lists.sourceforge.net
>Subject: [E1000-devel] WoL stopped working after power off with 2.6.38 (e1000e
>specific?)
>
>[ Note: I'm not on these mailing lists, so be sure to Cc: me if you want
>more info from me ]
>
>After upgrading from kernel 2.6.37 to 2.6.38, Wake on LAN after shutdown
>stopped working for me on both of my Thinkpad laptops. Both systems use
>the e1000e driver. One (a T61) has an 82566MM NIC, the other (an X201) an
>82577LM. I'm running 64-bit Gentoo Linux with a custom compiled kernel.
>The network driver is built into the kernel.
>
>Wake on LAN still works after suspend (S3), but not after a complete
>shutdown (with power supply connected).
>
>I figured the updated e1000e driver in 2.6.38 was probably to blame,
>however, after I copied the whole drivers/net/e1000e directory from the
>2.6.37 over to the 2.6.38 tree and recompiled, the problem persisted, so I
>don't know anymore.
>
>I modified the system shutdown sequence to invoke ifconfig and ethtool
>right before the final halt. According to ifconfig, eth0 is down at that
>point. According to ethtool, WoL is configured correctly ("Wake-on: g").
>There is, however, a difference in the output of ethtool between the two
>kernel versions. "Link detected:" shows "yes" with 2.6.37, but "no" with
>2.6.38.
>
>A workaround that I found to work was to invoke "ifconfig eth0 up" right
>before the halt.
>
>Any suggestions? Is this new behavior expected or is it a bug?
WoL from S5 "works for me"(TM) using the e1000e driver on RHEL6 and 2.6.38.
Could you provide your customer kernel configuration?
Cc: linux-pm@lists.linux-foundation.org
Thanks,
Bruce.
^ permalink raw reply
* Re: pull request: batman-adv 2011-05-01
From: David Miller @ 2011-05-02 22:06 UTC (permalink / raw)
To: sven-KaDOiPu9UxWEi8DpZVb4nw
Cc: netdev-u79uwXL29TY76Z2rM5mHXA,
b.a.t.m.a.n-ZwoEplunGu2X36UT3dwllkB+6BGkLq7r
In-Reply-To: <1304284234-27338-1-git-send-email-sven-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.org>
From: Sven Eckelmann <sven-KaDOiPu9UxWEi8DpZVb4nw@public.gmane.org>
Date: Sun, 1 May 2011 23:10:30 +0200
> I would like to propose following patches for net-next-2.6/2.6.40. Marek
> Lindner continued to convert different datastructures to use RCU. Antonio
> Quartulli fixed an important bug introduced in the last patchset related to the
> update of the current gateway. He also did some minor cleanup work.
>
> I've removed the patch "net: batman-adv: remove rx_csum ethtool_ops" again
> because you already applied it in your branch.
I'll pull this, but I really want you to resolve atomic_dec_not_zero()
properly.
It does not belong in any batman-adv header file.
Instead it belongs in all of arch/${ARCH}/include/asm/atomic.h and
include/asm-generic/atomic.h
Please submit a patch which puts it in the proper place to linux-kernel
Don't worry about build problems resulting from this, I'll make sure
to deal with it properly when the change shows up in Linus's tree.
Thanks.
^ permalink raw reply
* RE: [E1000-devel] WoL stopped working after power off with 2.6.38 (e1000e specific?)
From: Allan, Bruce W @ 2011-05-02 22:07 UTC (permalink / raw)
To: Allan, Bruce W, Kamil Iskra, netdev@vger.kernel.org,
e1000-devel@lists.sourceforge.net
Cc: linux-pm@lists.linux-foundation.org
In-Reply-To: <8DD2590731AB5D4C9DBF71A877482A9001B54CE017@orsmsx509.amr.corp.intel.com>
>-----Original Message-----
>From: Allan, Bruce W [mailto:bruce.w.allan@intel.com]
>Sent: Monday, May 02, 2011 3:02 PM
>To: Kamil Iskra; netdev@vger.kernel.org; e1000-devel@lists.sourceforge.net
>Cc: linux-pm@lists.linux-foundation.org
>Subject: Re: [E1000-devel] WoL stopped working after power off with 2.6.38
>(e1000e specific?)
>
>>-----Original Message-----
>>From: Kamil Iskra [mailto:kamil@iskra.name]
>>Sent: Friday, April 29, 2011 10:45 PM
>>To: netdev@vger.kernel.org; e1000-devel@lists.sourceforge.net
>>Subject: [E1000-devel] WoL stopped working after power off with 2.6.38 (e1000e
>>specific?)
>>
>>[ Note: I'm not on these mailing lists, so be sure to Cc: me if you want
>>more info from me ]
>>
>>After upgrading from kernel 2.6.37 to 2.6.38, Wake on LAN after shutdown
>>stopped working for me on both of my Thinkpad laptops. Both systems use
>>the e1000e driver. One (a T61) has an 82566MM NIC, the other (an X201) an
>>82577LM. I'm running 64-bit Gentoo Linux with a custom compiled kernel.
>>The network driver is built into the kernel.
>>
>>Wake on LAN still works after suspend (S3), but not after a complete
>>shutdown (with power supply connected).
>>
>>I figured the updated e1000e driver in 2.6.38 was probably to blame,
>>however, after I copied the whole drivers/net/e1000e directory from the
>>2.6.37 over to the 2.6.38 tree and recompiled, the problem persisted, so I
>>don't know anymore.
>>
>>I modified the system shutdown sequence to invoke ifconfig and ethtool
>>right before the final halt. According to ifconfig, eth0 is down at that
>>point. According to ethtool, WoL is configured correctly ("Wake-on: g").
>>There is, however, a difference in the output of ethtool between the two
>>kernel versions. "Link detected:" shows "yes" with 2.6.37, but "no" with
>>2.6.38.
>>
>>A workaround that I found to work was to invoke "ifconfig eth0 up" right
>>before the halt.
>>
>>Any suggestions? Is this new behavior expected or is it a bug?
>
>WoL from S5 "works for me"(TM) using the e1000e driver on RHEL6 and 2.6.38.
>Could you provide your customer kernel configuration?
>
>Cc: linux-pm@lists.linux-foundation.org
>
>Thanks,
>Bruce.
:s/customer/custom/
^ permalink raw reply
* net-2.6 state...
From: David Miller @ 2011-05-02 22:20 UTC (permalink / raw)
To: netdev
Right now I'm sorting through patchwork to make sure anything that
belongs in net-2.6, is there.
Then I'm going to push things out to Linus.
We will be in a more serious lock down mode after that. So I really
only want to see obvious critical fixes going into net-2.6. Even
comment typos will be put into net-next-2.6.
Please cooperate with this policy and everything will go smoothly.
There is nothing I like more than seeing people work on bug fixes at
this point in the -rc* series, so if you want to make me (as well as
the users reporting these things) really happy, fix some bugs. :-)
Thanks!
^ permalink raw reply
* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
From: David Miller @ 2011-05-02 22:21 UTC (permalink / raw)
To: cmetcalf; +Cc: shanwei, netdev
In-Reply-To: <4DBF2E11.3010904@tilera.com>
From: Chris Metcalf <cmetcalf@tilera.com>
Date: Mon, 2 May 2011 18:20:01 -0400
> I took the drivers/net/tile/ change into my tree, but I'll defer to David
> or some other net person to take the net/ipv6/udp.c change. Thanks!
I took them both into my tree. Didn't you see my reply?
^ permalink raw reply
* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
From: Chris Metcalf @ 2011-05-02 22:20 UTC (permalink / raw)
To: Shan Wei; +Cc: David Miller, netdev
In-Reply-To: <4DB1617D.30600@cn.fujitsu.com>
On 4/22/2011 7:07 AM, Shan Wei wrote:
> Although these are equivalent, but the skb_checksum_start_offset() is more readable.
>
>
> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> ---
> drivers/net/tile/tilepro.c | 2 +-
> net/ipv6/udp.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/tile/tilepro.c b/drivers/net/tile/tilepro.c
> index 0825db6..1e980fd 100644
> --- a/drivers/net/tile/tilepro.c
> +++ b/drivers/net/tile/tilepro.c
> @@ -1930,7 +1930,7 @@ static int tile_net_tx(struct sk_buff *skb, struct net_device *dev)
> unsigned int len = skb->len;
> unsigned char *data = skb->data;
>
> - unsigned int csum_start = skb->csum_start - skb_headroom(skb);
> + unsigned int csum_start = skb_checksum_start_offset(skb);
>
> lepp_frag_t frags[LEPP_MAX_FRAGS];
>
> diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
> index 15c3774..95c62a1 100644
> --- a/net/ipv6/udp.c
> +++ b/net/ipv6/udp.c
> @@ -1328,7 +1328,7 @@ static struct sk_buff *udp6_ufo_fragment(struct sk_buff *skb, u32 features)
> /* Do software UFO. Complete and fill in the UDP checksum as HW cannot
> * do checksum of UDP packets sent as multiple IP fragments.
> */
> - offset = skb->csum_start - skb_headroom(skb);
> + offset = skb_checksum_start_offset(skb);
> csum = skb_checksum(skb, offset, skb->len- offset, 0);
> offset += skb->csum_offset;
> *(__sum16 *)(skb->data + offset) = csum_fold(csum);
I took the drivers/net/tile/ change into my tree, but I'll defer to David
or some other net person to take the net/ipv6/udp.c change. Thanks!
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
^ permalink raw reply
* Re: [PATCH net-next-2.6] net: dont hold rtnl mutex during netlink dump callbacks
From: David Miller @ 2011-05-02 22:27 UTC (permalink / raw)
To: shemminger; +Cc: eric.dumazet, kaber, netdev, remi.denis-courmont
In-Reply-To: <20110428084337.6b54603e@nehalam>
From: Stephen Hemminger <shemminger@vyatta.com>
Date: Thu, 28 Apr 2011 08:43:37 -0700
> On Thu, 28 Apr 2011 10:56:07 +0200
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
>> Four years ago, Patrick made a change to hold rtnl mutex during netlink
>> dump callbacks.
>>
>> I believe it was a wrong move. This slows down concurrent dumps, making
>> good old /proc/net/ files faster than rtnetlink in some situations.
>>
>> This occurred to me because one "ip link show dev ..." was _very_ slow
>> on a workload adding/removing network devices in background.
>>
>> All dump callbacks are able to use RCU locking now, so this patch does
>> roughly a revert of commits :
>>
>> 1c2d670f366 : [RTNETLINK]: Hold rtnl_mutex during netlink dump callbacks
>> 6313c1e0992 : [RTNETLINK]: Remove unnecessary locking in dump callbacks
>>
>> This let writers fight for rtnl mutex and readers going full speed.
>>
>> It also takes care of phonet : phonet_route_get() is now called from rcu
>> read section. I renamed it to phonet_route_get_rcu()
>>
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>> Cc: Patrick McHardy <kaber@trash.net>
>> Cc: Remi Denis-Courmont <remi.denis-courmont@nokia.com>
>
> Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Applied, thanks everyone!
^ permalink raw reply
* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
From: Chris Metcalf @ 2011-05-02 22:29 UTC (permalink / raw)
To: David Miller; +Cc: shanwei, netdev
In-Reply-To: <20110502.152136.115919893.davem@davemloft.net>
On 5/2/2011 6:21 PM, David Miller wrote:
> From: Chris Metcalf <cmetcalf@tilera.com>
> Date: Mon, 2 May 2011 18:20:01 -0400
>
>> I took the drivers/net/tile/ change into my tree, but I'll defer to David
>> or some other net person to take the net/ipv6/udp.c change. Thanks!
> I took them both into my tree. Didn't you see my reply?
I did, but I didn't see the change yet in .39-rc5, so I figured it would be
harmless to also take it into the tile tree. And, I thought you might have
just taken the platform-independent part of the change. I'll revert the
tile part of the change out of my tree. Thanks!
--
Chris Metcalf, Tilera Corp.
http://www.tilera.com
^ permalink raw reply
* Re: [PATCH net-next 1/3] net:use help function of skb_checksum_start_offset to calculate offset
From: David Miller @ 2011-05-02 22:35 UTC (permalink / raw)
To: cmetcalf; +Cc: shanwei, netdev
In-Reply-To: <4DBF3037.30203@tilera.com>
From: Chris Metcalf <cmetcalf@tilera.com>
Date: Mon, 2 May 2011 18:29:11 -0400
> On 5/2/2011 6:21 PM, David Miller wrote:
>> From: Chris Metcalf <cmetcalf@tilera.com>
>> Date: Mon, 2 May 2011 18:20:01 -0400
>>
>>> I took the drivers/net/tile/ change into my tree, but I'll defer to David
>>> or some other net person to take the net/ipv6/udp.c change. Thanks!
>> I took them both into my tree. Didn't you see my reply?
>
> I did, but I didn't see the change yet in .39-rc5, so I figured it would be
> harmless to also take it into the tile tree.
This change will show up in net-next-2.6 and as a consequence linux-2.6-next
^ permalink raw reply
* Re: [PATCH 1/5] networking: inappropriate ioctl operation should return ENOTTY
From: David Miller @ 2011-05-02 22:41 UTC (permalink / raw)
To: lifongsun; +Cc: alan, netdev, linux-kernel
In-Reply-To: <1303977891-29280-1-git-send-email-lifongsun@gmail.com>
From: Lifeng Sun <lifongsun@gmail.com>
Date: Thu, 28 Apr 2011 16:04:51 +0800
> ioctl() calls against a socket with an inappropriate ioctl operation
> are incorrectly returning EINVAL rather than ENOTTY:
>
> [ENOTTY]
> Inappropriate I/O control operation.
>
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=33992
>
> Signed-off-by: Lifeng Sun <lifongsun@gmail.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH] tg3: Fix failure to enable WoL by default when possible
From: David Miller @ 2011-05-02 22:47 UTC (permalink / raw)
To: rjw; +Cc: netdev, linux-kernel, mcarlson, mchan, sfr, linux-next
In-Reply-To: <201104282302.15502.rjw@sisk.pl>
From: "Rafael J. Wysocki" <rjw@sisk.pl>
Date: Thu, 28 Apr 2011 23:02:15 +0200
> From: Rafael J. Wysocki <rjw@sisk.pl>
>
> tg3 is supposed to enable WoL by default on adapters which support
> that, but it fails to do so unless the adapter's
> /sys/devices/.../power/wakeup file contains 'enabled' during the
> initialization of the adapter. Fix that by making tg3 use
> device_set_wakeup_enable() to enable wakeup automatically whenever
> WoL should be enabled by default.
>
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Applied, thanks Rafael.
Stephen, this patch is going to show up in net-2.6 and it will
generate a merge conflict with Joe Perches's commit in net-next-2.6
which converts tg3 to use a bitmap for the tp->tg3_flags* values.
--------------------
commit 63c3a66fe6c827a731dcbdee181158b295626f83
Author: Joe Perches <joe@perches.com>
Date: Tue Apr 26 08:12:10 2011 +0000
tg3: Convert u32 flag,flg2,flg3 uses to bitmap
--------------------
It should be easy to resolve, and you don't need to report this
to us when you hit it while building your -next tree, thanks :-)
I'll resolve it myself over the next day or two.
> ---
> drivers/net/tg3.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
>
> Index: linux-2.6/drivers/net/tg3.c
> ===================================================================
> --- linux-2.6.orig/drivers/net/tg3.c
> +++ linux-2.6/drivers/net/tg3.c
> @@ -12327,8 +12327,10 @@ static void __devinit tg3_get_eeprom_hw_
> if (val & VCPU_CFGSHDW_ASPM_DBNC)
> tp->tg3_flags |= TG3_FLAG_ASPM_WORKAROUND;
> if ((val & VCPU_CFGSHDW_WOL_ENABLE) &&
> - (val & VCPU_CFGSHDW_WOL_MAGPKT))
> + (val & VCPU_CFGSHDW_WOL_MAGPKT)) {
> tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
> + device_set_wakeup_enable(&tp->pdev->dev, true);
> + }
> goto done;
> }
>
> @@ -12461,8 +12463,10 @@ static void __devinit tg3_get_eeprom_hw_
> tp->tg3_flags &= ~TG3_FLAG_WOL_CAP;
>
> if ((tp->tg3_flags & TG3_FLAG_WOL_CAP) &&
> - (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE))
> + (nic_cfg & NIC_SRAM_DATA_CFG_WOL_ENABLE)) {
> tp->tg3_flags |= TG3_FLAG_WOL_ENABLE;
> + device_set_wakeup_enable(&tp->pdev->dev, true);
> + }
>
> if (cfg2 & (1 << 17))
> tp->phy_flags |= TG3_PHYFLG_CAPACITIVE_COUPLING;
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
^ permalink raw reply
* Re: [PATCH] smsc95xx: fix reset check
From: David Miller @ 2011-05-02 22:51 UTC (permalink / raw)
To: rabin; +Cc: steve.glendinning, netdev
In-Reply-To: <1304188167-18152-1-git-send-email-rabin@rab.in>
From: Rabin Vincent <rabin@rab.in>
Date: Sat, 30 Apr 2011 23:59:27 +0530
> The reset loop check should check the MII_BMCR register value for
> BMCR_RESET rather than for MII_BMCR (the register address, which also
> happens to be zero).
>
> Signed-off-by: Rabin Vincent <rabin@rab.in>
Applied, thank you.
^ permalink raw reply
* Re: [PATCH] usbnet: runtime pm: fix out of memory
From: David Miller @ 2011-05-02 22:52 UTC (permalink / raw)
To: tom.leiming; +Cc: netdev, linux-usb, oneukum
In-Reply-To: <1304066229-30875-1-git-send-email-tom.leiming@gmail.com>
From: tom.leiming@gmail.com
Date: Fri, 29 Apr 2011 16:37:09 +0800
> From: Ming Lei <tom.leiming@gmail.com>
>
> This patch makes use of the EVENT_DEV_OPEN flag introduced recently to
> fix one out of memory issue, which can be reproduced on omap3/4 based
> pandaboard/beagle XM easily with steps below:
...
Oliver please review this patch. Thanks!
> - enable runtime pm
> echo auto > /sys/devices/platform/usbhs-omap.0/ehci-omap.0/usb1/1-1/1-1.1/power/control
>
> - ifconfig eth0 up
>
> - then out of memroy happened, see [1] for kernel message.
>
> Follows my analysis:
> - 'ifconfig eth0 up' brings eth0 out of suspend, and usbnet_resume
> is called to schedule dev->bh, then rx urbs are submited to prepare for
> recieving data;
>
> - some usbnet devices will produce garbage rx packets flood if
> info->reset is not called in usbnet_open.
>
> - so there is no enough chances for usbnet_bh to handle and release
> recieved skb buffers since many rx interrupts consumes cpu, so out of memory
> for atomic allocation in rx_submit happened.
>
> This patch fixes the issue by simply not allowing schedule of usbnet_bh until device
> is opened.
>
> [1], dmesg
> [ 234.712005] smsc95xx 1-1.1:1.0: rpm_resume flags 0x4
> [ 234.712066] usb 1-1.1: rpm_resume flags 0x0
> [ 234.712066] usb 1-1: rpm_resume flags 0x0
> [ 234.712097] usb usb1: rpm_resume flags 0x0
> [ 234.712127] usb usb1: usb auto-resume
> [ 234.712158] ehci-omap ehci-omap.0: resume root hub
> [ 234.754028] hub 1-0:1.0: hub_resume
> [ 234.754821] hub 1-0:1.0: port 1: status 0507 change 0000
> [ 234.756011] hub 1-0:1.0: state 7 ports 3 chg 0000 evt 0000
> [ 234.756042] hub 1-0:1.0: rpm_resume flags 0x4
> [ 234.756072] usb usb1: rpm_resume flags 0x0
> [ 234.756164] usb usb1: rpm_resume returns 1
> [ 234.756195] hub 1-0:1.0: rpm_resume returns 0
> [ 234.756195] hub 1-0:1.0: rpm_suspend flags 0x4
> [ 234.756225] hub 1-0:1.0: rpm_suspend returns 0
> [ 234.756256] usb usb1: rpm_resume returns 0
> [ 234.757141] usb 1-1: usb auto-resume
> [ 234.793151] ehci-omap ehci-omap.0: GetStatus port:1 status 001005 0 ACK POWER sig=se0 PE CONNECT
> [ 234.816558] usb 1-1: finish resume
> [ 234.817871] hub 1-1:1.0: hub_resume
> [ 234.818420] hub 1-1:1.0: port 1: status 0507 change 0000
> [ 234.820495] ehci-omap ehci-omap.0: reused qh eec50220 schedule
> [ 234.820495] usb 1-1: link qh256-0001/eec50220 start 1 [1/0 us]
> [ 234.820587] usb 1-1: rpm_resume returns 0
> [ 234.820800] hub 1-1:1.0: state 7 ports 5 chg 0000 evt 0000
> [ 234.820800] hub 1-1:1.0: rpm_resume flags 0x4
> [ 234.820831] hub 1-1:1.0: rpm_resume returns 0
> [ 234.820861] hub 1-1:1.0: rpm_suspend flags 0x4
> [ 234.820861] hub 1-1:1.0: rpm_suspend returns 0
> [ 234.821777] usb 1-1.1: usb auto-resume
> [ 234.868591] hub 1-1:1.0: state 7 ports 5 chg 0000 evt 0002
> [ 234.868591] hub 1-1:1.0: rpm_resume flags 0x4
> [ 234.868621] hub 1-1:1.0: rpm_resume returns 0
> [ 234.868652] hub 1-1:1.0: rpm_suspend flags 0x4
> [ 234.868652] hub 1-1:1.0: rpm_suspend returns 0
> [ 234.879486] usb 1-1.1: finish resume
> [ 234.880279] usb 1-1.1: rpm_resume returns 0
> [ 234.880310] smsc95xx 1-1.1:1.0: rpm_resume returns 0
> [ 238.880187] ksoftirqd/0: page allocation failure. order:0, mode:0x20
> [ 238.880218] Backtrace:
> [ 238.880249] [<c01b9800>] (dump_backtrace+0x0/0xf8) from [<c065e1dc>] (dump_stack+0x18/0x1c)
> [ 238.880249] r6:00000000 r5:00000000 r4:00000020 r3:00000002
> [ 238.880310] [<c065e1c4>] (dump_stack+0x0/0x1c) from [<c026ece4>] (__alloc_pages_nodemask+0x620/0x724)
> [ 238.880340] [<c026e6c4>] (__alloc_pages_nodemask+0x0/0x724) from [<c02986d4>] (kmem_getpages.clone.34+0x34/0xc8)
> [ 238.880371] [<c02986a0>] (kmem_getpages.clone.34+0x0/0xc8) from [<c02988f8>] (cache_grow.clone.42+0x84/0x154)
> [ 238.880371] r6:ef871aa4 r5:ef871a80 r4:ef81fd40 r3:00000020
> [ 238.880401] [<c0298874>] (cache_grow.clone.42+0x0/0x154) from [<c0298b64>] (cache_alloc_refill+0x19c/0x1f0)
> [ 238.880432] [<c02989c8>] (cache_alloc_refill+0x0/0x1f0) from [<c0299804>] (kmem_cache_alloc+0x90/0x190)
> [ 238.880462] [<c0299774>] (kmem_cache_alloc+0x0/0x190) from [<c052e260>] (__alloc_skb+0x34/0xe8)
> [ 238.880493] [<c052e22c>] (__alloc_skb+0x0/0xe8) from [<bf0509f4>] (rx_submit+0x2c/0x1d4 [usbnet])
> [ 238.880523] [<bf0509c8>] (rx_submit+0x0/0x1d4 [usbnet]) from [<bf050d38>] (rx_complete+0x19c/0x1b0 [usbnet])
> [ 238.880737] [<bf050b9c>] (rx_complete+0x0/0x1b0 [usbnet]) from [<bf006fd0>] (usb_hcd_giveback_urb+0xa8/0xf4 [usbcore])
> [ 238.880737] r8:eeeced34 r7:eeecec00 r6:eeecec00 r5:00000000 r4:eec2dd20
> [ 238.880767] r3:bf050b9c
> [ 238.880859] [<bf006f28>] (usb_hcd_giveback_urb+0x0/0xf4 [usbcore]) from [<bf03c8f8>] (ehci_urb_done+0xb0/0xbc [ehci_hcd])
> [ 238.880859] r6:00000000 r5:eec2dd20 r4:eeeced44 r3:eec2dd34
> [ 238.880920] [<bf03c848>] (ehci_urb_done+0x0/0xbc [ehci_hcd]) from [<bf040204>] (qh_completions+0x308/0x3bc [ehci_hcd])
> [ 238.880920] r7:00000000 r6:eeda21a0 r5:ffdfe3c0 r4:eeda21ac
> [ 238.880981] [<bf03fefc>] (qh_completions+0x0/0x3bc [ehci_hcd]) from [<bf040ef8>] (scan_async+0xb0/0x16c [ehci_hcd])
> [ 238.881011] [<bf040e48>] (scan_async+0x0/0x16c [ehci_hcd]) from [<bf040fec>] (ehci_work+0x38/0x90 [ehci_hcd])
> [ 238.881042] [<bf040fb4>] (ehci_work+0x0/0x90 [ehci_hcd]) from [<bf042940>] (ehci_irq+0x300/0x34c [ehci_hcd])
> [ 238.881072] r4:eeeced34 r3:00000001
> [ 238.881134] [<bf042640>] (ehci_irq+0x0/0x34c [ehci_hcd]) from [<bf006828>] (usb_hcd_irq+0x40/0xac [usbcore])
> [ 238.881195] [<bf0067e8>] (usb_hcd_irq+0x0/0xac [usbcore]) from [<c0239764>] (handle_irq_event_percpu+0xb8/0x240)
> [ 238.881225] r6:eec504e0 r5:0000006d r4:eec504e0 r3:bf0067e8
> [ 238.881256] [<c02396ac>] (handle_irq_event_percpu+0x0/0x240) from [<c0239930>] (handle_irq_event+0x44/0x64)
> [ 238.881256] [<c02398ec>] (handle_irq_event+0x0/0x64) from [<c023bbd0>] (handle_level_irq+0xe0/0x114)
> [ 238.881286] r6:0000006d r5:c080c14c r4:c080c100 r3:00020000
> [ 238.881317] [<c023baf0>] (handle_level_irq+0x0/0x114) from [<c01ab090>] (asm_do_IRQ+0x90/0xd0)
> [ 238.881317] r5:00000000 r4:0000006d
> [ 238.881347] [<c01ab000>] (asm_do_IRQ+0x0/0xd0) from [<c06624d0>] (__irq_svc+0x50/0x134)
> [ 238.881378] Exception stack(0xef837e20 to 0xef837e68)
> [ 238.881378] 7e20: 00000001 00185610 016cc000 c00490c0 eb380000 ef800540 00000020 00004ae0
> [ 238.881408] 7e40: 00000020 bf0509f4 60000013 ef837e9c ef837e40 ef837e68 c0226f0c c0298ca0
> [ 238.881408] 7e60: 20000013 ffffffff
> [ 238.881408] r5:fa240100 r4:ffffffff
> [ 238.881439] [<c0298bb8>] (__kmalloc_track_caller+0x0/0x1d0) from [<c052e284>] (__alloc_skb+0x58/0xe8)
> [ 238.881469] [<c052e22c>] (__alloc_skb+0x0/0xe8) from [<bf0509f4>] (rx_submit+0x2c/0x1d4 [usbnet])
> [ 238.881500] [<bf0509c8>] (rx_submit+0x0/0x1d4 [usbnet]) from [<bf0513d8>] (usbnet_bh+0x1b4/0x250 [usbnet])
> [ 238.881530] [<bf051224>] (usbnet_bh+0x0/0x250 [usbnet]) from [<c01f912c>] (tasklet_action+0xb0/0x1f8)
> [ 238.881530] r6:00000000 r5:ef9757f0 r4:ef9757ec r3:bf051224
> [ 238.881561] [<c01f907c>] (tasklet_action+0x0/0x1f8) from [<c01f97ac>] (__do_softirq+0x140/0x290)
> [ 238.881561] r8:00000006 r7:00000101 r6:00000000 r5:c0806098 r4:00000001
> [ 238.881591] r3:c01f907c
> [ 238.881622] [<c01f966c>] (__do_softirq+0x0/0x290) from [<c01f99cc>] (run_ksoftirqd+0xd0/0x1f4)
> [ 238.881622] [<c01f98fc>] (run_ksoftirqd+0x0/0x1f4) from [<c02113b0>] (kthread+0x90/0x98)
> [ 238.881652] r7:00000013 r6:c01f98fc r5:00000000 r4:ef831efc
> [ 238.881683] [<c0211320>] (kthread+0x0/0x98) from [<c01f62f4>] (do_exit+0x0/0x374)
> [ 238.881713] r6:c01f62f4 r5:c0211320 r4:ef831efc
> [ 238.881713] Mem-info:
> [ 238.881744] Normal per-cpu:
> [ 238.881744] CPU 0: hi: 186, btch: 31 usd: 38
> [ 238.881744] CPU 1: hi: 186, btch: 31 usd: 169
> [ 238.881774] HighMem per-cpu:
> [ 238.881774] CPU 0: hi: 90, btch: 15 usd: 66
> [ 238.881774] CPU 1: hi: 90, btch: 15 usd: 86
> [ 238.881805] active_anon:544 inactive_anon:71 isolated_anon:0
> [ 238.881805] active_file:926 inactive_file:2538 isolated_file:0
> [ 238.881805] unevictable:0 dirty:10 writeback:0 unstable:0
> [ 238.881805] free:57782 slab_reclaimable:864 slab_unreclaimable:186898
> [ 238.881805] mapped:632 shmem:144 pagetables:50 bounce:0
> [ 238.881835] Normal free:1328kB min:3532kB low:4412kB high:5296kB active_anon:0kB inactive_anon:0kB active_file:880kB inactive_file:848kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:780288kB mlocked:0kB dirty:36kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:3456kB slab_unreclaimable:747592kB kernel_stack:392kB pagetables:200kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
> [ 238.881866] lowmem_reserve[]: 0 1904 1904
> [ 238.881896] HighMem free:229800kB min:236kB low:508kB high:784kB active_anon:2176kB inactive_anon:284kB active_file:2824kB inactive_file:9304kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:243712kB mlocked:0kB dirty:4kB writeback:0kB mapped:2528kB shmem:576kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? no
> [ 238.881927] lowmem_reserve[]: 0 0 0
> [ 238.881958] Normal: 0*4kB 4*8kB 6*16kB 0*32kB 1*64kB 1*128kB 0*256kB 2*512kB 0*1024kB 0*2048kB 0*4096kB = 1344kB
> [ 238.882019] HighMem: 6*4kB 2*8kB 4*16kB 4*32kB 1*64kB 1*128kB 0*256kB 2*512kB 3*1024kB 0*2048kB 55*4096kB = 229800kB
> [ 238.882080] 3610 total pagecache pages
> [ 238.882080] 0 pages in swap cache
> [ 238.882080] Swap cache stats: add 0, delete 0, find 0/0
> [ 238.882110] Free swap = 0kB
> [ 238.882110] Total swap = 0kB
> [ 238.933776] 262144 pages of RAM
> [ 238.933776] 58240 free pages
> [ 238.933776] 10503 reserved pages
> [ 238.933776] 187773 slab pages
> [ 238.933807] 2475 pages shared
> [ 238.933807] 0 pages swap cached
>
> Cc: David Miller <davem@davemloft.net>
> Signed-off-by: Ming Lei <tom.leiming@gmail.com>
> ---
> drivers/net/usb/usbnet.c | 10 +++++++---
> 1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
> index 009bba3..9ab439d 100644
> --- a/drivers/net/usb/usbnet.c
> +++ b/drivers/net/usb/usbnet.c
> @@ -645,6 +645,7 @@ int usbnet_stop (struct net_device *net)
> struct driver_info *info = dev->driver_info;
> int retval;
>
> + clear_bit(EVENT_DEV_OPEN, &dev->flags);
> netif_stop_queue (net);
>
> netif_info(dev, ifdown, dev->net,
> @@ -1524,9 +1525,12 @@ int usbnet_resume (struct usb_interface *intf)
> smp_mb();
> clear_bit(EVENT_DEV_ASLEEP, &dev->flags);
> spin_unlock_irq(&dev->txq.lock);
> - if (!(dev->txq.qlen >= TX_QLEN(dev)))
> - netif_start_queue(dev->net);
> - tasklet_schedule (&dev->bh);
> +
> + if (test_bit(EVENT_DEV_OPEN, &dev->flags)) {
> + if (!(dev->txq.qlen >= TX_QLEN(dev)))
> + netif_start_queue(dev->net);
> + tasklet_schedule (&dev->bh);
> + }
> }
> return 0;
> }
> --
> 1.7.4.1
>
^ permalink raw reply
* Re: [PATCH net-next-2.6] veth: remove unneeded ifname code from veth_newlink()
From: David Miller @ 2011-05-02 22:55 UTC (permalink / raw)
To: jpirko; +Cc: mirqus, netdev, xemul
In-Reply-To: <20110430112817.GD2658@psychotron.orion>
From: Jiri Pirko <jpirko@redhat.com>
Date: Sat, 30 Apr 2011 13:28:17 +0200
> Fri, Apr 22, 2011 at 11:43:10AM CEST, mirqus@gmail.com wrote:
>>2011/1/24 Jiri Pirko <jpirko@redhat.com>:
>>> The code is not needed because tb[IFLA_IFNAME] is already
>>> processed in rtnl_newlink(). Remove this redundancy.
>>>
>>> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
>>
>>Hi. This patch broke creation of veth devices. Reverting it fixes the issue.
>
> Sorry for troubles.
>
> For net-next-2.6 this is fixed by:
> http://patchwork.ozlabs.org/patch/93498/
>
> For net-2.6 I suggest to revert this patch:
>
> Subject: [PATCH net-2.6] Revert: veth: remove unneeded ifname code from veth_newlink()
>
> 84c49d8c3e4abefb0a41a77b25aa37ebe8d6b743 caused regression on veth
> creation. This patch reverts the original one.
>
> Signed-off-by: Jiri Pirko <jpirko@redhat.com>
Applied, with "Reported-by: " added to give credit to Michał Mirosław.
^ permalink raw reply
* Re: [PATCH] sysctl: net: call unregister_net_sysctl_table where needed
From: David Miller @ 2011-05-02 23:12 UTC (permalink / raw)
To: lucian.grijincu; +Cc: netdev
In-Reply-To: <BANLkTi=0-2aHDBtY2P794upF9brrW48aNA@mail.gmail.com>
From: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
Date: Sun, 1 May 2011 13:48:04 +0200
> On Sun, May 1, 2011 at 1:44 PM, Lucian Adrian Grijincu
> <lucian.grijincu@gmail.com> wrote:
>> ctl_table_headers registered with register_net_sysctl_table should
>> have been unregistered with the equivalent unregister_net_sysctl_table
>>
>> Signed-off-by: Lucian Adrian Grijincu <lucian.grijincu@gmail.com>
>
>
> David: I sent you this patch a while back but it was mixed with other
> unrelated patches that were mostly ignored.
>
> Again, to clarify: it does not matter at the moment if
> register_net_sysctl_table or unregister_sysctl_table is called because
> both to the same thing:
...
> We should either get rid of unregister_net_sysctl_table or use it consistently.
Applied to net-2.6, thanks Lucian.
^ permalink raw reply
* [net-next-2.6 PATCH] ethtool: Support to take FW dump
From: anirban.chakraborty @ 2011-05-02 23:29 UTC (permalink / raw)
To: netdev; +Cc: --no-chain-reply-to, bhutchings, davem, Anirban Chakraborty
In-Reply-To: <1304378957-24123-1-git-send-email-anirban.chakraborty@qlogic.com>
From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Added code to take FW dump via ethtool. A pair of set and get functions are
added to configure dump level and fetch it from the driver respectively. A
third function is added to retrieve the dumped FW data from the driver.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
include/linux/ethtool.h | 20 ++++++++++++
net/core/ethtool.c | 76 +++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 96 insertions(+), 0 deletions(-)
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index 9de3127..3dd91a5 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -595,6 +595,19 @@ struct ethtool_flash {
char data[ETHTOOL_FLASH_MAX_FILENAME];
};
+/**
+ * struct ethtool_dump - used for retrieving, setting device dump
+ * @flag: flag for dump setting
+ * @len: length of dump data
+ * @data: data collected for this command
+ */
+struct ethtool_dump {
+ __u32 cmd;
+ __u32 flag;
+ __u32 len;
+ u8 data[0];
+};
+
/* for returning and changing feature sets */
/**
@@ -926,6 +939,10 @@ struct ethtool_ops {
const struct ethtool_rxfh_indir *);
void (*get_channels)(struct net_device *, struct ethtool_channels *);
int (*set_channels)(struct net_device *, struct ethtool_channels *);
+ int (*set_dump)(struct net_device *, struct ethtool_dump *);
+ int (*get_dump)(struct net_device *, struct ethtool_dump *);
+ int (*get_dump_data)(struct net_device *,
+ struct ethtool_dump *, void *);
};
#endif /* __KERNEL__ */
@@ -997,6 +1014,9 @@ struct ethtool_ops {
#define ETHTOOL_SFEATURES 0x0000003b /* Change device offload settings */
#define ETHTOOL_GCHANNELS 0x0000003c /* Get no of channels */
#define ETHTOOL_SCHANNELS 0x0000003d /* Set no of channels */
+#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
+#define ETHTOOL_GET_DUMP 0x0000003f /* Get dump settings */
+#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/net/core/ethtool.c b/net/core/ethtool.c
index d8b1a8d..dce547c 100644
--- a/net/core/ethtool.c
+++ b/net/core/ethtool.c
@@ -1827,6 +1827,73 @@ static noinline_for_stack int ethtool_flash_device(struct net_device *dev,
return dev->ethtool_ops->flash_device(dev, &efl);
}
+static int ethtool_set_dump(struct net_device *dev,
+ void __user *useraddr)
+{
+ struct ethtool_dump dump;
+
+ if (!dev->ethtool_ops->set_dump)
+ return -EOPNOTSUPP;
+
+ if (copy_from_user(&dump, useraddr, sizeof(dump)))
+ return -EFAULT;
+
+ return dev->ethtool_ops->set_dump(dev, &dump);
+}
+
+static int ethtool_get_dump(struct net_device *dev,
+ void __user *useraddr)
+{
+ struct ethtool_dump dump;
+ const struct ethtool_ops *ops = dev->ethtool_ops;
+
+ if (!dev->ethtool_ops->get_dump)
+ return -EOPNOTSUPP;
+
+ if (copy_from_user(&dump, useraddr, sizeof(dump)))
+ return -EFAULT;
+
+ if (ops->get_dump(dev, &dump))
+ return -EFAULT;
+
+ if (copy_to_user(useraddr, &dump, sizeof(dump)))
+ return -EFAULT;
+ return 0;
+}
+
+static int ethtool_get_dump_data(struct net_device *dev,
+ void __user *useraddr)
+{
+ int ret;
+ void *data;
+ struct ethtool_dump dump;
+ const struct ethtool_ops *ops = dev->ethtool_ops;
+
+ if (!dev->ethtool_ops->get_dump_data)
+ return -EOPNOTSUPP;
+
+ if (copy_from_user(&dump, useraddr, sizeof(dump)))
+ return -EFAULT;
+ data = vzalloc(dump.len);
+ if (!data)
+ return -ENOMEM;
+ ret = ops->get_dump_data(dev, &dump, data);
+ if (ret) {
+ ret = -EFAULT;
+ goto out;
+ }
+ if (copy_to_user(useraddr, &dump, sizeof(dump))) {
+ ret = -EFAULT;
+ goto out;
+ }
+ useraddr += offsetof(struct ethtool_dump, data);
+ if (copy_to_user(useraddr, data, dump.len))
+ ret = -EFAULT;
+out:
+ vfree(data);
+ return ret;
+}
+
/* The main entry point in this file. Called from net/core/dev.c */
int dev_ethtool(struct net *net, struct ifreq *ifr)
@@ -2043,6 +2110,15 @@ int dev_ethtool(struct net *net, struct ifreq *ifr)
case ETHTOOL_SCHANNELS:
rc = ethtool_set_channels(dev, useraddr);
break;
+ case ETHTOOL_SET_DUMP:
+ rc = ethtool_set_dump(dev, useraddr);
+ break;
+ case ETHTOOL_GET_DUMP:
+ rc = ethtool_get_dump(dev, useraddr);
+ break;
+ case ETHTOOL_GET_DUMP_DATA:
+ rc = ethtool_get_dump_data(dev, useraddr);
+ break;
default:
rc = -EOPNOTSUPP;
}
--
1.7.4.1
^ permalink raw reply related
* [ethtool PATCH] FW dump support
From: anirban.chakraborty @ 2011-05-02 23:29 UTC (permalink / raw)
To: netdev; +Cc: --no-chain-reply-to, bhutchings, davem, Anirban Chakraborty
From: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Added support to take FW dump via ethtool.
Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
---
ethtool-copy.h | 17 ++++++++-
ethtool.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 127 insertions(+), 3 deletions(-)
diff --git a/ethtool-copy.h b/ethtool-copy.h
index 5b45442..0c0e847 100644
--- a/ethtool-copy.h
+++ b/ethtool-copy.h
@@ -76,6 +76,19 @@ struct ethtool_drvinfo {
__u32 regdump_len; /* Size of data from ETHTOOL_GREGS (bytes) */
};
+/* dump struct
+ * cmd: commnad to identify type of operation
+ * flag: specify dump related options
+ * len: length of dumped data
+ * data: dump data
+ */
+struct ethtool_dump {
+ __u32 cmd;
+ __u32 flag;
+ __u32 len;
+ __u8 data[0];
+};
+
#define SOPASS_MAX 6
/* wake-on-lan settings */
struct ethtool_wolinfo {
@@ -538,7 +551,6 @@ struct ethtool_flash {
char data[ETHTOOL_FLASH_MAX_FILENAME];
};
-
/* CMDs currently supported */
#define ETHTOOL_GSET 0x00000001 /* Get settings. */
#define ETHTOOL_SSET 0x00000002 /* Set settings. */
@@ -599,6 +611,9 @@ struct ethtool_flash {
#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
+#define ETHTOOL_SET_DUMP 0x0000003e /* Set dump settings */
+#define ETHTOOL_GET_DUMP 0x0000003f /* Get dump settings */
+#define ETHTOOL_GET_DUMP_DATA 0x00000040 /* Get dump data */
/* compatibility with older code */
#define SPARC_ETH_GSET ETHTOOL_GSET
diff --git a/ethtool.c b/ethtool.c
index cfdac65..1a826ae 100644
--- a/ethtool.c
+++ b/ethtool.c
@@ -28,6 +28,7 @@
#include <sys/types.h>
#include <string.h>
#include <stdlib.h>
+#include <stddef.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
@@ -110,6 +111,9 @@ static int do_srxntuple(int fd, struct ifreq *ifr);
static int do_grxntuple(int fd, struct ifreq *ifr);
static int do_flash(int fd, struct ifreq *ifr);
static int do_permaddr(int fd, struct ifreq *ifr);
+static int do_getdump(int fd, struct ifreq *ifr);
+static int do_getdumpdata(int fd, struct ifreq *ifr);
+static int do_setdump(int fd, struct ifreq *ifr);
static int send_ioctl(int fd, struct ifreq *ifr);
@@ -142,6 +146,9 @@ static enum {
MODE_GNTUPLE,
MODE_FLASHDEV,
MODE_PERMADDR,
+ MODE_SET_DUMP,
+ MODE_GET_DUMP,
+ MODE_GET_DUMP_DATA,
} mode = MODE_GSET;
static struct option {
@@ -263,6 +270,12 @@ static struct option {
"Get Rx ntuple filters and actions\n" },
{ "-P", "--show-permaddr", MODE_PERMADDR,
"Show permanent hardware address" },
+ { "-W", "--get-dump", MODE_GET_DUMP,
+ "Get dump level\n" },
+ { "-Wd", "--get-dump-data", MODE_GET_DUMP_DATA,
+ "Get dump data", "FILENAME " "Name of the dump file\n" },
+ { "-w", "--set-dump", MODE_SET_DUMP,
+ "Set dump level", "DUMPLEVEL " "Dump level for the device\n" },
{ "-h", "--help", MODE_HELP, "Show this help" },
{ NULL, "--version", MODE_VERSION, "Show version number" },
{}
@@ -413,6 +426,8 @@ static int flash_region = -1;
static int msglvl_changed;
static u32 msglvl_wanted = 0;
static u32 msglvl_mask = 0;
+static u32 dump_flag;
+static char *dump_file = NULL;
static enum {
ONLINE=0,
@@ -852,7 +867,10 @@ static void parse_cmdline(int argc, char **argp)
(mode == MODE_GNTUPLE) ||
(mode == MODE_PHYS_ID) ||
(mode == MODE_FLASHDEV) ||
- (mode == MODE_PERMADDR)) {
+ (mode == MODE_PERMADDR) ||
+ (mode == MODE_SET_DUMP) ||
+ (mode == MODE_GET_DUMP_DATA) ||
+ (mode == MODE_GET_DUMP)) {
devname = argp[i];
break;
}
@@ -874,6 +892,12 @@ static void parse_cmdline(int argc, char **argp)
flash_file = argp[i];
flash = 1;
break;
+ } else if (mode == MODE_SET_DUMP) {
+ dump_flag = get_u32(argp[i], 0);
+ break;
+ } else if (mode == MODE_GET_DUMP_DATA) {
+ dump_file = argp[i];
+ break;
}
/* fallthrough */
default:
@@ -2042,6 +2066,12 @@ static int doit(void)
return do_flash(fd, &ifr);
} else if (mode == MODE_PERMADDR) {
return do_permaddr(fd, &ifr);
+ } else if (mode == MODE_GET_DUMP_DATA) {
+ return do_getdumpdata(fd, &ifr);
+ } else if (mode == MODE_GET_DUMP) {
+ return do_getdump(fd, &ifr);
+ } else if (mode == MODE_SET_DUMP) {
+ return do_setdump(fd, &ifr);
}
return 69;
@@ -2679,7 +2709,6 @@ static int do_gregs(int fd, struct ifreq *ifr)
perror("Cannot get driver information");
return 72;
}
-
regs = calloc(1, sizeof(*regs)+drvinfo.regdump_len);
if (!regs) {
perror("Cannot allocate memory for register dump");
@@ -3241,6 +3270,86 @@ static int do_grxntuple(int fd, struct ifreq *ifr)
return 0;
}
+static void do_writedump(struct ethtool_dump *dump)
+{
+ FILE *f = fopen(dump_file, "wb+");
+ size_t bytes;
+
+ if (!f ) {
+ fprintf(stderr, "Can't open file %s: %s\n",
+ dump_file, strerror(errno));
+ return;
+ }
+
+ bytes = fwrite(dump->data, 1, dump->len, f);
+ fclose(f);
+}
+
+static int do_getdump(int fd, struct ifreq *ifr)
+{
+ struct ethtool_dump ddata;
+ int err;
+
+ ddata.cmd = ETHTOOL_GET_DUMP;
+ ifr->ifr_data = (caddr_t) &ddata;
+ err = send_ioctl(fd, ifr);
+ if (err < 0) {
+ perror("Can not get dump flag");
+ return 74;
+ }
+ fprintf(stdout, "Dump flag: 0x%x\n", ddata.flag);
+ return 0;
+}
+
+static int do_getdumpdata(int fd, struct ifreq *ifr)
+{
+ int err;
+ struct ethtool_dump edata;
+ struct ethtool_dump *data;
+
+ edata.cmd = ETHTOOL_GET_DUMP;
+
+ ifr->ifr_data = (caddr_t) &edata;
+ err = send_ioctl(fd, ifr);
+ if (err < 0) {
+ perror("Can not get dump level");
+ return 74;
+ }
+ data = calloc(1, offsetof(struct ethtool_dump, data)+edata.len);
+ if (!data) {
+ perror("Can not allocate enough memory");
+ return 0;
+ }
+ data->cmd = ETHTOOL_GET_DUMP_DATA;
+ data->len = edata.len;
+ ifr->ifr_data = (caddr_t) data;
+ err = send_ioctl(fd, ifr);
+ if (err < 0) {
+ perror("Can not get dump data\n");
+ goto free;
+ }
+ do_writedump(data);
+free:
+ free(data);
+ return 0;
+}
+
+static int do_setdump(int fd, struct ifreq *ifr)
+{
+ int err;
+ struct ethtool_dump dump;
+
+ dump.cmd = ETHTOOL_SET_DUMP;
+ dump.flag = dump_flag;
+ ifr->ifr_data = (caddr_t)&dump;
+ err = send_ioctl(fd, ifr);
+ if (err < 0) {
+ perror("Can not set dump level");
+ return 74;
+ }
+ return 0;
+}
+
static int send_ioctl(int fd, struct ifreq *ifr)
{
return ioctl(fd, SIOCETHTOOL, ifr);
--
1.7.4.1
^ permalink raw reply related
* [PATCH 0/2] libertas: cleanup logging styles
From: Joe Perches @ 2011-05-02 23:49 UTC (permalink / raw)
To: Dan Williams, libertas-dev
Cc: John W. Linville, linux-wireless, netdev, linux-kernel
Joe Perches (2):
libertas: Convert lbs_pr_<level> to pr_<level>
libertas: Use netdev_<level> or dev_<level> where possible
Compiled but otherwise untested.
drivers/net/wireless/libertas/cfg.c | 16 +++---
drivers/net/wireless/libertas/cmd.c | 40 +++++++++------
drivers/net/wireless/libertas/cmdresp.c | 27 ++++++----
drivers/net/wireless/libertas/debugfs.c | 5 +-
drivers/net/wireless/libertas/defs.h | 7 ---
drivers/net/wireless/libertas/if_cs.c | 57 ++++++++++++---------
drivers/net/wireless/libertas/if_sdio.c | 37 +++++++-------
drivers/net/wireless/libertas/if_spi.c | 83 +++++++++++++++++--------------
drivers/net/wireless/libertas/if_usb.c | 44 +++++++++-------
drivers/net/wireless/libertas/main.c | 42 +++++++++-------
drivers/net/wireless/libertas/mesh.c | 8 ++-
drivers/net/wireless/libertas/rx.c | 7 ++-
12 files changed, 206 insertions(+), 167 deletions(-)
--
1.7.5.rc3.dirty
^ 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