* [GIT]: Networking
From: David Miller @ 2009-11-09 5:32 UTC (permalink / raw)
To: torvalds; +Cc: akpm, netdev, linux-kernel
1) Wireless fixes, including a revert for something that added as
many bugs as it fixed. Via John Linville.
2) Rose and DecNET leaks device references. CAN protocol doesn't
lock device list accesses properly. All from Eric Dumazet.
3) TX of ixgbe can hang with ioatdma loded, fix from Don Skidmore.
4) be2net fixes for flow control programming on resume, the timing
of sending configuration commands to the chip, and a broken
status shift macro define, from Ajit Khaparde and Sathya Perla.
5) A queue of ISDN fixes via Andrew Morton.
6) Two netfilter bug fixes (Patrick McHardy has been offline for a month
or so these are the only two netfilter fixes that have gone in in
that time), from Jan Engelhardt and Jozsef Kadlecsik.
7) When PMTU discovery is off, we handle DF packets improperly in
IPIP tunnel driver. Fix from Herbert Xu.
8) fsl_pq_mdio is missing MODULE_LICENSE() tag, from Sebastian Siewior.
9) virtio_net section mismatch fix from Uwe Kleine-König.
10) IXGBE uses wrong gso_max_size on 82599 chips when DCB is enabled.
It also checks TXOFF status incorrectly when DCB is enabled. Both
fixed from Yi Zou.
11) CAN protocol needs to provide ->get_size() operation otherwise
netlink SKBs aren't sized for it correctly. From Wolfgang
Grandegger.
Please pull, thanks a lot.
The following changes since commit 7c9abfb884b8737f0afdc8a88bcea77526f0da87:
Linus Torvalds (1):
Merge branch 'kvm-updates/2.6.32' of git://git.kernel.org/pub/scm/virt/kvm/kvm
are available in the git repository at:
master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6.git master
Ajit Khaparde (2):
be2net: fix to set proper flow control on resume
be2net: Bug fix to send config commands to hardware after netdev_register
Dan Carpenter (1):
misdn: Fix reversed 'if' in st_own_ctrl
David S. Miller (1):
Merge branch 'master' of git://git.kernel.org/.../linville/wireless-2.6
Don Skidmore (1):
ixgbe: fix traffic hangs on Tx with ioatdma loaded
Eric Dumazet (3):
rose: device refcount leak
decnet: netdevice refcount leak
can: should not use __dev_get_by_index() without locks
Finn Thain (1):
macsonic: fix crash on PowerBook 520
Herbert Xu (1):
ipip: Fix handling of DF packets when pmtudisc is OFF
Jan Engelhardt (1):
netfilter: xt_connlimit: fix regression caused by zero family value
Jiri Slaby (4):
isdn: hisax: Fix lock imbalance.
isdn: eicon: Use offsetof
isdn: eicon: Return on error
NET: cassini, fix lock imbalance
Joe Perches (1):
MAINTAINERS: Add git net-next-2.6
John W. Linville (1):
Revert "ipw2200: fix oops on missing firmware"
Jozsef Kadlecsik (1):
netfilter: nf_nat: fix NAT issue in 2.6.30.4+
Larry Finger (1):
rtl8187: Fix kernel oops when device is removed when LEDS enabled
Martin Michlmayr (1):
hisax: remove bad udelay call to fix build error on ARM
Roel Kluin (2):
isdn: hisax: Fix test in waitforxfw
isdn: hfc_usb: Fix read buffer overflow
Ron Mercer (2):
qlge: Fix early exit from mbox cmd complete wait.
qlge: Set PCIe reset type for EEH to fundamental.
Sathya Perla (1):
be2net: Fix CQE_STATUS_EXTD_SHIFT define
Sean Cross (1):
rt2x00: Don't queue ieee80211 work after USB removal
Sebastian Haas (1):
ems_usb: Fix byte order issues on big endian machines
Sebastian Siewior (1):
net/fsl_pq_mdio: add module license GPL
Stephen Hemminger (1):
bridge: prevent bridging wrong device
Tonyliu (1):
DaVinci EMAC: correct param for ISR
Torgny Johansson (1):
cdc_ether: additional Ericsson MBM PID's to the whitelist
Uwe Kleine-König (1):
virtio_net: rename driver struct to please modpost
Wolfgang Grandegger (1):
can: fix WARN_ON dump in net/core/rtnetlink.c:rtmsg_ifinfo()
Yi Zou (2):
ixgbe: Fix gso_max_size for 82599 when DCB is enabled
ixgbe: Fix checking TFCS register for TXOFF status when DCB is enabled
MAINTAINERS | 1 +
drivers/isdn/hardware/eicon/maintidi.c | 5 +-
drivers/isdn/hardware/eicon/message.c | 18 ++--
drivers/isdn/hisax/amd7930_fn.c | 1 +
drivers/isdn/hisax/diva.c | 2 +-
drivers/isdn/hisax/elsa_ser.c | 22 +++---
drivers/isdn/hisax/hfc_usb.c | 4 +-
drivers/isdn/hisax/hscx_irq.c | 2 +-
drivers/isdn/hisax/icc.c | 1 +
drivers/isdn/mISDN/stack.c | 2 +-
drivers/net/benet/be.h | 2 +
drivers/net/benet/be_cmds.h | 2 +-
drivers/net/benet/be_ethtool.c | 8 +-
drivers/net/benet/be_main.c | 28 ++++---
drivers/net/can/dev.c | 17 ++++
drivers/net/can/usb/ems_usb.c | 5 +-
drivers/net/cassini.c | 5 +-
drivers/net/davinci_emac.c | 2 +-
drivers/net/fsl_pq_mdio.c | 1 +
drivers/net/ixgbe/ixgbe_main.c | 84 +++++++++++++++++--
drivers/net/macsonic.c | 117 +++++++++++++-------------
drivers/net/qlge/qlge_main.c | 2 +
drivers/net/qlge/qlge_mpi.c | 2 +-
drivers/net/usb/Kconfig | 2 +-
drivers/net/usb/cdc_ether.c | 42 +++++++++-
drivers/net/virtio_net.c | 6 +-
drivers/net/wireless/ipw2x00/ipw2100.c | 5 +-
drivers/net/wireless/ipw2x00/ipw2200.c | 2 -
drivers/net/wireless/ipw2x00/libipw.h | 1 -
drivers/net/wireless/ipw2x00/libipw_module.c | 14 +--
drivers/net/wireless/rt2x00/rt2x00dev.c | 4 +-
drivers/net/wireless/rt2x00/rt2x00link.c | 11 ++-
drivers/net/wireless/rt2x00/rt2x00usb.c | 9 ++-
drivers/net/wireless/rtl818x/rtl8187_leds.c | 4 +-
include/net/netfilter/nf_conntrack.h | 8 +-
include/net/netfilter/nf_nat_helper.h | 4 +
net/bridge/br_if.c | 6 +-
net/can/bcm.c | 19 +++--
net/decnet/sysctl_net_decnet.c | 7 +-
net/ipv4/ipip.c | 32 ++++----
net/ipv4/netfilter/nf_nat_core.c | 3 +
net/ipv4/netfilter/nf_nat_helper.c | 34 +++++---
net/netfilter/nf_conntrack_core.c | 8 ++
net/netfilter/nf_conntrack_proto_tcp.c | 64 ++++++--------
net/netfilter/xt_connlimit.c | 10 +--
net/rose/rose_route.c | 16 ++--
46 files changed, 407 insertions(+), 237 deletions(-)
^ permalink raw reply
* away but active for next 6 days.
From: David Miller @ 2009-11-09 5:04 UTC (permalink / raw)
To: netdev; +Cc: linux-ide, sparclinux
I will be away in New York City from Monday night until Saturday.
I intend to be as responsive as I was this past summer when I spent
nearly 2 months there :-)
I have one IDE fix, 2 or 3 Sparc fixes, and a moderately sized handful
of networking fixes sitting in my trees which I'll send pull requests
out for tonight.
^ permalink raw reply
* Re: [PATCH 2/2 net-next-2.6] au1000-eth: convert to platform_driver model
From: David Miller @ 2009-11-09 5:02 UTC (permalink / raw)
To: florian; +Cc: linux-mips, ralf, netdev
In-Reply-To: <200911081542.12219.florian@openwrt.org>
From: Florian Fainelli <florian@openwrt.org>
Date: Sun, 8 Nov 2009 15:42:11 +0100
> This patch converts the au1000-eth driver to become a full
> platform-driver as it ought to be. We now pass PHY-speficic
> configurations through platform_data but for compatibility
> the driver still assumes the default settings (search for PHY1 on
> MAC0) when no platform_data is passed. Tested on my MTX-1 board.
>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
Ralf, feel free to merge this yourself since it depends upon
the previous Alchemy platform patch:
Acked-by: David S. Miller <davem@davemloft.net>
^ permalink raw reply
* Re: linux-next: manual merge of the net tree with the net-current tree
From: David Miller @ 2009-11-09 4:59 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, wg, haas
In-Reply-To: <20091109130323.5dcc7829.sfr@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 9 Nov 2009 13:03:23 +1100
> Hi all,
>
> Today's linux-next merge of the net tree got a conflict in
> drivers/net/can/usb/ems_usb.c between commit
> 2b2072e902848a63168570f500a5726744b3873a ("ems_usb: Fix byte order issues
> on big endian machines") from the net-current tree and commit
> 7b6856a0296a8f187bb88ba31fa83a08abba7966 ("can: provide library functions
> for skb allocation") from the net tree.
>
> Just context changes. I fixed it up (see below) and can carry the fix
> for a while.
I'll do a merge and resolve this, thanks Stephen!
^ permalink raw reply
* Re: [PATCH] xfrm: SAD entries do not expire correctly after suspend-resume
From: David Miller @ 2009-11-09 4:58 UTC (permalink / raw)
To: ypolyans; +Cc: netdev, peterz, yoshfuji, tglx, mingo
In-Reply-To: <20091108211249.2ecdfd38@penta.localdomain>
From: Yury Polyanskiy <ypolyans@princeton.edu>
Date: Sun, 8 Nov 2009 21:12:49 -0500
>
> This fixes the following bug in the current implementation of
> net/xfrm: SAD entries timeouts do not count the time spent by the machine
> in the suspended state. This leads to the connectivity problems because
> after resuming local machine thinks that the SAD entry is still valid, while
> it has already been expired on the remote server.
...
> Signed-off-by: Yury Polyanskiy <polyanskiy@gmail.com>
Applied to net-next-2.6, thanks for following up on this.
^ permalink raw reply
* Re: [PATCH 2/2] net/compat_ioctl: support SIOCWANDEV
From: David Miller @ 2009-11-09 4:57 UTC (permalink / raw)
To: arnd; +Cc: khc, dwalker, linux-kernel, hch, netdev
In-Reply-To: <200911082239.24698.arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Sun, 8 Nov 2009 22:39:24 +0100
> This adds compat_ioctl support for SIOCWANDEV, which has
> always been missing.
>
> The definition of struct compat_ifreq was missing an
> ifru_settings fields that is needed to support SIOCWANDEV,
> so add that and clean up the whitespace damage in the
> struct definition.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH 1/2] net, compat_ioctl: fix SIOCGMII ioctls
From: David Miller @ 2009-11-09 4:56 UTC (permalink / raw)
To: arnd; +Cc: linux-kernel, hch, netdev
In-Reply-To: <200911082234.14031.arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Sun, 8 Nov 2009 22:34:13 +0100
> SIOCGMIIPHY and SIOCGMIIREG return data through ifreq,
> so it needs to be converted on the way out as well.
>
> SIOCGIFPFLAGS is unused, but has the same problem in theory.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Applied.
^ permalink raw reply
* Re: [RFC, PATCH 0/7] net, compat_ioctl: move handlers to net/socket.c
From: David Miller @ 2009-11-09 4:55 UTC (permalink / raw)
To: arnd; +Cc: linux-kernel, hch, netdev, dwmw2
In-Reply-To: <200911082231.48060.arnd@arndb.de>
From: Arnd Bergmann <arnd@arndb.de>
Date: Sun, 8 Nov 2009 22:31:47 +0100
> Any opinion on how to proceed with the ATM stuff? From my
> point of view, I'm fine with having moved it out of fs/compat_ioctl.c,
> but it's still a bit silly to have two half-complete implementations.
I haven't looked at that stuff yes, you can be sure it's in
my queue :-)
^ permalink raw reply
* Re: [PATCH 0/8 net-next-2.6] udp: optimisations
From: David Miller @ 2009-11-09 4:55 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, lgrijincu, opurdila
In-Reply-To: <4AF72738.7020606@gmail.com>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sun, 08 Nov 2009 21:16:56 +0100
> This patch series address UDP scalability problems, we failed to solve in 2007
> (commit 6aaf47fa48d3c44 INET : IPV4 UDP lookups converted to a 2 pass algo)
> we had to revert a bit later.
Looks great, all applied, thanks Eric.
I would even go so far as to say that the cutoff to the second hash
table should be even lower than 10, like maybe 4 or 5.
^ permalink raw reply
* Re: linux-next: net tree build failure
From: David Miller @ 2009-11-09 4:41 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, arnd
In-Reply-To: <20091109132151.0e0ec7bc.sfr@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 9 Nov 2009 13:21:51 +1100
> Subject: [PATCH] net/appletalk: using compat_ptr needs inclusion of linux/compat.h
>
> Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Applied, thanks Stephen.
^ permalink raw reply
* Stochastic Fair Blue updated for 2.6.31
From: Juliusz Chroboczek @ 2009-11-09 4:11 UTC (permalink / raw)
To: netdev
Just a quick note to inform people that I've updated the Stochastic Fair
Blue (SFB) qdisc for 2.6.31.
http://www.pps.jussieu.fr/~jch/software/files/sch_sfb-20091108.tar.gz
http://www.pps.jussieu.fr/~jch/software/files/sch_sfb-20091108.tar.gz.asc
It's described in detail on
http://www.pps.jussieu.fr/~jch/software/sfb/
Juliusz
^ permalink raw reply
* Re: [PATCH 00/23] Removal of binary sysctl support
From: Eric W. Biederman @ 2009-11-09 3:44 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linux-kernel, netdev, David Miller, Stephen Rothwell
In-Reply-To: <200911081306.20201.arnd@arndb.de>
Arnd Bergmann <arnd@arndb.de> writes:
> On Sunday 08 November 2009 12:16:43 Eric W. Biederman wrote:
>> This patchset reimplements sys_sysctl as a compatibility wrapper
>> around /proc/sys. After which it removes all of the code to all over
>> the kernel that is used today to implement the binary sysctls.
>>
>> I am posting this patchset to give everyone a heads up what is in
>> flight.
>>
>> I intend to carry all of these patches in my sysctl tree.
>
> Very nice patches again!
>
> Looking at what you did, I had two ideas how to move on from there,
> which may be part of your plans already:
>
> 1. Make it possible to build sysctl_binary.c as a loadable module
> so you can get a smaller kernel without losing the option to use
> binary sysctl altogether. This of course requires a small portion
> to remain in the kernel, to provide the actual syscall entry point
> and load the module on demand.
I can see how this could make sense from a distribution perspective.
> 2. On top of that, put the same code into glibc so that you don't
> even have to load the module when you're running a new glibc version.
> Since the binary sysctl ABI is stable (as in stiff and dead), there
> should be no need to synchronize any extensions to it betwen kernel
> and libc.
I don't expect we will need to move this to glibc. There are so few
users of sys_sysctl now, that I hardly expect it to be worth it to move
this code out of the kernel.
For me the big problem with sys_sysctl is solved by this patchset.
It no longer constitutes a maintenance burden on the rest of the sysctl
code, and the other sysctl users.
Now the implementation of /proc/sys can be implemented and optimized without
dealing with any sys_sysctl baggage.
All of that said if someone is interested in tweaking sysctl_binary.c to make
it easier to deal with sys_sysctl going away I don't have any problems.
Eric
^ permalink raw reply
* [PATCH] xfrm: SAD entries do not expire correctly after suspend-resume
From: Yury Polyanskiy @ 2009-11-09 2:12 UTC (permalink / raw)
To: netdev, davem, peterz, yoshfuji, Thomas Gleixner, mingo
[-- Attachment #1: Type: text/plain, Size: 5752 bytes --]
This fixes the following bug in the current implementation of
net/xfrm: SAD entries timeouts do not count the time spent by the machine
in the suspended state. This leads to the connectivity problems because
after resuming local machine thinks that the SAD entry is still valid, while
it has already been expired on the remote server.
The cause of this is very simple: the timeouts in the net/xfrm are bound to
the old mod_timer() timers. This patch reassigns them to the
CLOCK_REALTIME hrtimer.
I have been using this version of the patch for a few months on my
machines without any problems. Also run a few stress tests w/o any
issues.
This version of the patch uses tasklet_hrtimer by Peter Zijlstra
(commit 9ba5f0).
This patch is against 2.6.31.4. Please CC me.
Signed-off-by: Yury Polyanskiy <polyanskiy@gmail.com>
---
include/net/xfrm.h | 5 ++++-
net/xfrm/xfrm_state.c | 34 +++++++++++++++++++---------------
2 files changed, 23 insertions(+), 16 deletions(-)
diff --git a/include/net/xfrm.h b/include/net/xfrm.h
index 9e3a3f4..ef28810 100644
--- a/include/net/xfrm.h
+++ b/include/net/xfrm.h
@@ -19,6 +19,9 @@
#include <net/route.h>
#include <net/ipv6.h>
#include <net/ip6_fib.h>
+
+#include <linux/interrupt.h>
+
#ifdef CONFIG_XFRM_STATISTICS
#include <net/snmp.h>
#endif
@@ -199,7 +202,7 @@ struct xfrm_state
struct xfrm_stats stats;
struct xfrm_lifetime_cur curlft;
- struct timer_list timer;
+ struct tasklet_hrtimer mtimer;
/* Last used time */
unsigned long lastused;
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index f2f7c63..45fff9c 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -21,6 +21,9 @@
#include <linux/cache.h>
#include <linux/audit.h>
#include <asm/uaccess.h>
+#include <linux/ktime.h>
+#include <linux/interrupt.h>
+#include <linux/kernel.h>
#include "xfrm_hash.h"
@@ -352,7 +355,7 @@ static void xfrm_put_mode(struct xfrm_mode *mode)
static void xfrm_state_gc_destroy(struct xfrm_state *x)
{
- del_timer_sync(&x->timer);
+ tasklet_hrtimer_cancel(&x->mtimer);
del_timer_sync(&x->rtimer);
kfree(x->aalg);
kfree(x->ealg);
@@ -398,9 +401,10 @@ static inline unsigned long make_jiffies(long secs)
return secs*HZ;
}
-static void xfrm_timer_handler(unsigned long data)
-{
- struct xfrm_state *x = (struct xfrm_state*)data;
+static enum hrtimer_restart xfrm_timer_handler(struct hrtimer * me)
+{
+ struct tasklet_hrtimer *thr = container_of(me, struct tasklet_hrtimer, timer);
+ struct xfrm_state *x = container_of(thr, struct xfrm_state, mtimer);
struct net *net = xs_net(x);
unsigned long now = get_seconds();
long next = LONG_MAX;
@@ -451,8 +455,9 @@ static void xfrm_timer_handler(unsigned long data)
if (warn)
km_state_expired(x, 0, 0);
resched:
- if (next != LONG_MAX)
- mod_timer(&x->timer, jiffies + make_jiffies(next));
+ if (next != LONG_MAX){
+ tasklet_hrtimer_start(&x->mtimer, ktime_set(next, 0), HRTIMER_MODE_REL);
+ }
goto out;
@@ -474,6 +479,7 @@ expired:
out:
spin_unlock(&x->lock);
+ return HRTIMER_NORESTART;
}
static void xfrm_replay_timer_handler(unsigned long data);
@@ -492,7 +498,7 @@ struct xfrm_state *xfrm_state_alloc(struct net *net)
INIT_HLIST_NODE(&x->bydst);
INIT_HLIST_NODE(&x->bysrc);
INIT_HLIST_NODE(&x->byspi);
- setup_timer(&x->timer, xfrm_timer_handler, (unsigned long)x);
+ tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_REALTIME, HRTIMER_MODE_ABS);
setup_timer(&x->rtimer, xfrm_replay_timer_handler,
(unsigned long)x);
x->curlft.add_time = get_seconds();
@@ -843,8 +849,7 @@ found:
hlist_add_head(&x->byspi, net->xfrm.state_byspi+h);
}
x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires;
- x->timer.expires = jiffies + net->xfrm.sysctl_acq_expires*HZ;
- add_timer(&x->timer);
+ tasklet_hrtimer_start(&x->mtimer, ktime_set(net->xfrm.sysctl_acq_expires, 0), HRTIMER_MODE_REL);
net->xfrm.state_num++;
xfrm_hash_grow_check(net, x->bydst.next != NULL);
} else {
@@ -921,7 +926,7 @@ static void __xfrm_state_insert(struct xfrm_state *x)
hlist_add_head(&x->byspi, net->xfrm.state_byspi+h);
}
- mod_timer(&x->timer, jiffies + HZ);
+ tasklet_hrtimer_start(&x->mtimer, ktime_set(1, 0), HRTIMER_MODE_REL);
if (x->replay_maxage)
mod_timer(&x->rtimer, jiffies + x->replay_maxage);
@@ -1019,8 +1024,7 @@ static struct xfrm_state *__find_acq_core(struct net *net, unsigned short family
x->props.reqid = reqid;
x->lft.hard_add_expires_seconds = net->xfrm.sysctl_acq_expires;
xfrm_state_hold(x);
- x->timer.expires = jiffies + net->xfrm.sysctl_acq_expires*HZ;
- add_timer(&x->timer);
+ tasklet_hrtimer_start(&x->mtimer, ktime_set(net->xfrm.sysctl_acq_expires, 0), HRTIMER_MODE_REL);
list_add(&x->km.all, &net->xfrm.state_all);
hlist_add_head(&x->bydst, net->xfrm.state_bydst+h);
h = xfrm_src_hash(net, daddr, saddr, family);
@@ -1299,8 +1303,8 @@ out:
memcpy(&x1->sel, &x->sel, sizeof(x1->sel));
memcpy(&x1->lft, &x->lft, sizeof(x1->lft));
x1->km.dying = 0;
-
- mod_timer(&x1->timer, jiffies + HZ);
+
+ tasklet_hrtimer_start(&x1->mtimer, ktime_set(1, 0), HRTIMER_MODE_REL);
if (x1->curlft.use_time)
xfrm_state_check_expire(x1);
@@ -1325,7 +1329,7 @@ int xfrm_state_check_expire(struct xfrm_state *x)
if (x->curlft.bytes >= x->lft.hard_byte_limit ||
x->curlft.packets >= x->lft.hard_packet_limit) {
x->km.state = XFRM_STATE_EXPIRED;
- mod_timer(&x->timer, jiffies);
+ tasklet_hrtimer_start(&x->mtimer, ktime_set(0,0), HRTIMER_MODE_REL);
return -EINVAL;
}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply related
* linux-next: net tree build failure
From: Stephen Rothwell @ 2009-11-09 2:21 UTC (permalink / raw)
To: David S. Miller, netdev; +Cc: linux-next, linux-kernel, Arnd Bergmann
Hi all,
Today's linux-next build (x86_64 allmodconfig) failed like this:
net/appletalk/ddp.c: In function 'atalk_compat_ioctl':
net/appletalk/ddp.c:1866: error: implicit declaration of function 'compat_ptr'
Caused by commit 206602217747382488fcae68351673cc9103debc
("appletalk: handle SIOCATALKDIFADDR compat ioctl").
I applied this patch for today:
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Mon, 9 Nov 2009 13:11:26 +1100
Subject: [PATCH] net/appletalk: using compat_ptr needs inclusion of linux/compat.h
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
---
net/appletalk/ddp.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/appletalk/ddp.c b/net/appletalk/ddp.c
index b631cc7..73ca4d5 100644
--- a/net/appletalk/ddp.c
+++ b/net/appletalk/ddp.c
@@ -56,6 +56,7 @@
#include <linux/if_arp.h>
#include <linux/smp_lock.h>
#include <linux/termios.h> /* For TIOCOUTQ/INQ */
+#include <linux/compat.h>
#include <net/datalink.h>
#include <net/psnap.h>
#include <net/sock.h>
--
1.6.5.2
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
^ permalink raw reply related
* linux-next: manual merge of the net tree with the net-current tree
From: Stephen Rothwell @ 2009-11-09 2:03 UTC (permalink / raw)
To: David Miller, netdev
Cc: linux-next, linux-kernel, Wolfgang Grandegger, Sebastian Haas
Hi all,
Today's linux-next merge of the net tree got a conflict in
drivers/net/can/usb/ems_usb.c between commit
2b2072e902848a63168570f500a5726744b3873a ("ems_usb: Fix byte order issues
on big endian machines") from the net-current tree and commit
7b6856a0296a8f187bb88ba31fa83a08abba7966 ("can: provide library functions
for skb allocation") from the net tree.
Just context changes. I fixed it up (see below) and can carry the fix
for a while.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
diff --cc drivers/net/can/usb/ems_usb.c
index abdbd9c,3685f3e..0000000
--- a/drivers/net/can/usb/ems_usb.c
+++ b/drivers/net/can/usb/ems_usb.c
@@@ -315,11 -315,7 +315,7 @@@ static void ems_usb_rx_can_msg(struct e
if (skb == NULL)
return;
- skb->protocol = htons(ETH_P_CAN);
-
- cf = (struct can_frame *)skb_put(skb, sizeof(struct can_frame));
-
- cf->can_id = msg->msg.can_msg.id;
+ cf->can_id = le32_to_cpu(msg->msg.can_msg.id);
cf->can_dlc = min_t(u8, msg->msg.can_msg.length, 8);
if (msg->type == CPC_MSG_TYPE_EXT_CAN_FRAME
^ permalink raw reply
* Re: query: net-next section mismatch(es)
From: William Allen Simpson @ 2009-11-09 2:01 UTC (permalink / raw)
To: David Miller; +Cc: netdev
In-Reply-To: <20091108.163527.185100796.davem@davemloft.net>
David Miller wrote:
> From: William Allen Simpson <william.allen.simpson@gmail.com>
>> I remember compiling it once with that option, and not finding
>> anything
>> wrong in my code, but I'm wondering how it took a great leap?
>
> Well, type 'make CONFIG_DEBUG_SECTION_MISMATCH=y' as the message
> says, in order to find out.
>
Hardly worth the time, as 'make modules' doesn't compile today:
/home/administer/net-next-2.6/drivers/staging/android/logger.c: In function ‘logger_read’:
/home/administer/net-next-2.6/drivers/staging/android/logger.c:165: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
/home/administer/net-next-2.6/drivers/staging/android/logger.c:165: error: (Each undeclared identifier is reported only once
/home/administer/net-next-2.6/drivers/staging/android/logger.c:165: error: for each function it appears in.)
/home/administer/net-next-2.6/drivers/staging/android/logger.c:178: error: implicit declaration of function ‘signal_pending’
/home/administer/net-next-2.6/drivers/staging/android/logger.c:183: error: implicit declaration of function ‘schedule’
/home/administer/net-next-2.6/drivers/staging/android/logger.c: In function ‘logger_aio_write’:
/home/administer/net-next-2.6/drivers/staging/android/logger.c:325: error: dereferencing pointer to incomplete type
/home/administer/net-next-2.6/drivers/staging/android/logger.c:333: error: dereferencing pointer to incomplete type
/home/administer/net-next-2.6/drivers/staging/android/logger.c:334: error: dereferencing pointer to incomplete type
/home/administer/net-next-2.6/drivers/staging/android/logger.c:337: error: dereferencing pointer to incomplete type
/home/administer/net-next-2.6/drivers/staging/android/logger.c:360: error: dereferencing pointer to incomplete type
/home/administer/net-next-2.6/drivers/staging/android/logger.c:363: error: dereferencing pointer to incomplete type
/home/administer/net-next-2.6/drivers/staging/android/logger.c:370: error: increment of pointer to unknown structure
/home/administer/net-next-2.6/drivers/staging/android/logger.c:370: error: arithmetic on pointer to an incomplete type
/home/administer/net-next-2.6/drivers/staging/android/logger.c:377: error: ‘TASK_INTERRUPTIBLE’ undeclared (first use in this function)
make[4]: *** [drivers/staging/android/logger.o] Error 1
make[3]: *** [drivers/staging/android] Error 2
make[2]: *** [drivers/staging] Error 2
make[2]: *** Waiting for unfinished jobs....
But I did it with 'make vmlinux' anyway, still makes no sense to me:
/home/administer/net-next-2.6/arch/x86/include/asm/string_32.h:74: warning: array subscript is above array bounds
WARNING: drivers/acpi/processor.o(.text+0xa88): Section mismatch in reference from the function acpi_processor_add() to the function .cpuinit.text:acpi_processor_power_init()
The function acpi_processor_add() references
the function __cpuinit acpi_processor_power_init().
This is often because acpi_processor_add lacks a __cpuinit
annotation or the annotation of acpi_processor_power_init is wrong.
WARNING: drivers/acpi/built-in.o(.text+0x21f24): Section mismatch in reference from the function acpi_processor_add() to the function .cpuinit.text:acpi_processor_power_init()
The function acpi_processor_add() references
the function __cpuinit acpi_processor_power_init().
This is often because acpi_processor_add lacks a __cpuinit
annotation or the annotation of acpi_processor_power_init is wrong.
/home/administer/net-next-2.6/include/linux/mca-legacy.h:12:2: warning: #warning "MCA legacy - please move your driver to the new sysfs api"
WARNING: drivers/net/phy/built-in.o(.devexit.text+0x13): Section mismatch in reference from the function mdio_gpio_bus_destroy() to the function .devinit.text:mdio_gpio_bus_deinit()
The function __devexit mdio_gpio_bus_destroy() references
a function __devinit mdio_gpio_bus_deinit().
This is often seen when error handling in the exit function
uses functionality in the init path.
The fix is often to remove the __devinit annotation of
mdio_gpio_bus_deinit() so it may be used outside an init section.
WARNING: drivers/net/built-in.o(.devexit.text+0x13): Section mismatch in reference from the function mdio_gpio_bus_destroy() to the function .devinit.text:mdio_gpio_bus_deinit()
The function __devexit mdio_gpio_bus_destroy() references
a function __devinit mdio_gpio_bus_deinit().
This is often seen when error handling in the exit function
uses functionality in the init path.
The fix is often to remove the __devinit annotation of
mdio_gpio_bus_deinit() so it may be used outside an init section.
/home/administer/net-next-2.6/arch/x86/include/asm/string_32.h:74: warning: array subscript is above array bounds
WARNING: drivers/built-in.o(.text+0x48274): Section mismatch in reference from the function acpi_processor_add() to the function .cpuinit.text:acpi_processor_power_init()
The function acpi_processor_add() references
the function __cpuinit acpi_processor_power_init().
This is often because acpi_processor_add lacks a __cpuinit
annotation or the annotation of acpi_processor_power_init is wrong.
WARNING: drivers/built-in.o(.devexit.text+0x38c): Section mismatch in reference from the function mdio_gpio_bus_destroy() to the function .devinit.text:mdio_gpio_bus_deinit()
The function __devexit mdio_gpio_bus_destroy() references
a function __devinit mdio_gpio_bus_deinit().
This is often seen when error handling in the exit function
uses functionality in the init path.
The fix is often to remove the __devinit annotation of
mdio_gpio_bus_deinit() so it may be used outside an init section.
WARNING: vmlinux.o(.text+0x27c824): Section mismatch in reference from the function acpi_processor_add() to the function .cpuinit.text:acpi_processor_power_init()
The function acpi_processor_add() references
the function __cpuinit acpi_processor_power_init().
This is often because acpi_processor_add lacks a __cpuinit
annotation or the annotation of acpi_processor_power_init is wrong.
WARNING: vmlinux.o(.text+0x2c8469): Section mismatch in reference from the function twl4030_sih_setup() to the function .init.text:set_irq_noprobe()
The function twl4030_sih_setup() references
the function __init set_irq_noprobe().
This is often because twl4030_sih_setup lacks a __init
annotation or the annotation of set_irq_noprobe is wrong.
WARNING: vmlinux.o(.text+0x2c8581): Section mismatch in reference from the function twl_init_irq() to the function .init.text:set_irq_noprobe()
The function twl_init_irq() references
the function __init set_irq_noprobe().
This is often because twl_init_irq lacks a __init
annotation or the annotation of set_irq_noprobe is wrong.
WARNING: vmlinux.o(.devexit.text+0x3e1): Section mismatch in reference from the function mdio_gpio_bus_destroy() to the function .devinit.text:mdio_gpio_bus_deinit()
The function __devexit mdio_gpio_bus_destroy() references
a function __devinit mdio_gpio_bus_deinit().
This is often seen when error handling in the exit function
uses functionality in the init path.
The fix is often to remove the __devinit annotation of
mdio_gpio_bus_deinit() so it may be used outside an init section.
^ permalink raw reply
* Re: query: net-next section mismatch(es)
From: David Miller @ 2009-11-09 0:35 UTC (permalink / raw)
To: william.allen.simpson; +Cc: netdev
In-Reply-To: <4AF6D1F5.80307@gmail.com>
From: William Allen Simpson <william.allen.simpson@gmail.com>
Date: Sun, 08 Nov 2009 09:13:09 -0500
> Yesterday morning (and for a month), I was getting the usual:
>
> WARNING: modpost: Found 1 section mismatch(es).
> To see full details build your kernel with:
> 'make CONFIG_DEBUG_SECTION_MISMATCH=y'
>
> This morning, it changed:
>
> WARNING: modpost: Found 4 section mismatch(es).
> To see full details build your kernel with:
> 'make CONFIG_DEBUG_SECTION_MISMATCH=y'
>
> I remember compiling it once with that option, and not finding
> anything
> wrong in my code, but I'm wondering how it took a great leap?
Well, type 'make CONFIG_DEBUG_SECTION_MISMATCH=y' as the message
says, in order to find out.
^ permalink raw reply
* tulip : kernel BUG in tulip_up/tulip_resume
From: Philippe De Muyter @ 2009-11-08 22:33 UTC (permalink / raw)
To: grundler, kyle, netdev, linux-kernel
In-Reply-To: <20090129210701.GA8092@frolo.macqel>
Hello,
I have just installed 2.6.31 (from opensuse 11.2) one a tulip-equipped
computer and I get the following error message from the kernel :
[ 2495.526390] ------------[ cut here ]------------
[ 2495.526390] kernel BUG at /usr/src/packages/BUILD/kernel-default-2.6.31.5/linux-2.6.31/include/linux/netdevice.h:439!
[ 2495.526390] invalid opcode: 0000 [#1] SMP
[ 2495.526390] last sysfs file: /sys/devices/pci0000:00/0000:00:07.1/host0/target0:0:0/0:0:0:0/block/sda/uevent
[ 2495.526390] Modules linked in: ohci_hcd raw1394 ohci1394 ieee1394 acpi_cpufreq speedstep_lib processor thermal_sys hwmon edd ipv6 af_packet fuse loop dm_mod rtc_cmos rtc_core rtc_lib apm pcspkr sg tulip uhci_hcd ehci_hcd reiserfs ata_piix ahci libata
[ 2495.526390]
[ 2495.526390] Pid: 339, comm: kapmd Not tainted (2.6.31.5-0.1-default #1)
[ 2495.526390] EIP: 0060:[<c3d6045d>] EFLAGS: 00010246 CPU: 0
[ 2495.526390] EIP is at tulip_up+0xa2d/0xa80 [tulip]
[ 2495.526390] EAX: 00000000 EBX: c1cd7000 ECX: c022af50 EDX: 0001ec00
[ 2495.526390] ESI: c1cd7340 EDI: 00000000 EBP: c20bde44 ESP: c20bddfc
[ 2495.526390] DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
[ 2495.526390] Process kapmd (pid: 339, ti=c20bc000 task=c25a32c0 task.ti=c20bc000)
[ 2495.526390] Stack:
[ 2495.526390] 0000000b c20bde44 c02acf76 2caa9a94 c2481800 c20bde38 c043ca4a c20bde27
[ 2495.526390] <0> 069ee44b c20ec120 c087c020 0001ec00 c1cd7000 c3d5c720 2caa9a94 c1cd7000
[ 2495.526390] <0> c2480000 00000000 c20bde68 c3d60555 00000080 c1cd7000 c1cd7000 2caa9a94
[ 2495.526390] Call Trace:
[ 2495.526390] [<c3d60555>] tulip_resume+0xa5/0xd0 [tulip]
[ 2495.526390] [<c043dd65>] pci_legacy_resume+0x35/0x60
[ 2495.526390] [<c043df2f>] pci_pm_resume+0x7f/0xb0
[ 2495.526390] [<c04d82f2>] pm_op+0xd2/0x180
[ 2495.526390] [<c04d91ee>] device_resume+0x5e/0x1a0
[ 2495.526390] [<c04d93dd>] dpm_resume+0xad/0x140
[ 2495.526390] [<c04d948b>] dpm_resume_end+0x1b/0x40
[ 2495.526390] [<c3db1978>] check_events+0x148/0x240 [apm]
[ 2495.526390] [<c3db23a2>] apm_mainloop+0x82/0x130 [apm]
[ 2495.526390] [<c3db28fe>] apm+0x10e/0x3d0 [apm]
[ 2495.526390] [<c026bef4>] kthread+0x84/0x90
[ 2495.526390] [<c0204db7>] kernel_thread_helper+0x7/0x10
[ 2495.526390] Code: 45 e4 e8 37 ce 6c fc 8b 4d e8 89 5c 24 10 89 7c 24 0c 89 4c 24 04 89 44 24 08 c7 04 24 4c 4e d6 c3 e8 86 f7 89 fc e9 f4 f8 ff ff <0f> 0b eb fe 0f be 96 16 09 00 00 b9 01 00 00 00 8b 45 e8 e8 fb
[ 2495.526390] EIP: [<c3d6045d>] tulip_up+0xa2d/0xa80 [tulip] SS:ESP 0068:c20bddfc
[ 2495.534162] ---[ end trace 609ed25c95a75fa1 ]---
This comes from a BUG_ON in napi_enable in netdevice.h.
napi_enable itself is called by tulip_up as such :
#ifdef CONFIG_TULIP_NAPI
napi_enable(&tp->napi);
#endif
At first reading, a matching napi_disable is called in tulip_down.
Does someone know what could be wrong and have a fix or should I look myself ?
Thanks in advance
Philippe
^ permalink raw reply
* [PATCH 2/2] net/compat_ioctl: support SIOCWANDEV
From: Arnd Bergmann @ 2009-11-08 21:39 UTC (permalink / raw)
To: David Miller, Krzysztof Halasa, Daniel Walker; +Cc: linux-kernel, hch, netdev
In-Reply-To: <200911082231.48060.arnd@arndb.de>
This adds compat_ioctl support for SIOCWANDEV, which has
always been missing.
The definition of struct compat_ifreq was missing an
ifru_settings fields that is needed to support SIOCWANDEV,
so add that and clean up the whitespace damage in the
struct definition.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Krzysztof Halasa <khc@pm.waw.pl>
Cc: Daniel Walker <dwalker@fifo99.com>
---
Krzysztof, can you verify that this is really needed and that it
does the right thing?
Daniel, I didn't want to add another patch just for the broken
whitespace I copied, but since we needed another fix in this area...
---
include/linux/compat.h | 41 ++++++++++++++++++++++++-----------------
net/socket.c | 23 +++++++++++++++++++++++
2 files changed, 47 insertions(+), 17 deletions(-)
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 224c7a8..4dff55a 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -165,25 +165,32 @@ struct compat_ifmap {
unsigned char port;
};
+struct compat_if_settings
+{
+ unsigned int type; /* Type of physical device or protocol */
+ unsigned int size; /* Size of the data allocated by the caller */
+ compat_uptr_t ifs_ifsu; /* union of pointers */
+};
+
struct compat_ifreq {
- union {
- char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
- } ifr_ifrn;
- union {
- struct sockaddr ifru_addr;
- struct sockaddr ifru_dstaddr;
- struct sockaddr ifru_broadaddr;
- struct sockaddr ifru_netmask;
- struct sockaddr ifru_hwaddr;
- short ifru_flags;
- compat_int_t ifru_ivalue;
- compat_int_t ifru_mtu;
- struct compat_ifmap ifru_map;
- char ifru_slave[IFNAMSIZ]; /* Just fits the size */
+ union {
+ char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */
+ } ifr_ifrn;
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short ifru_flags;
+ compat_int_t ifru_ivalue;
+ compat_int_t ifru_mtu;
+ struct compat_ifmap ifru_map;
+ char ifru_slave[IFNAMSIZ]; /* Just fits the size */
char ifru_newname[IFNAMSIZ];
- compat_caddr_t ifru_data;
- /* XXXX? ifru_settings should be here */
- } ifr_ifru;
+ compat_caddr_t ifru_data;
+ struct compat_if_settings ifru_settings;
+ } ifr_ifru;
};
struct compat_ifconf {
diff --git a/net/socket.c b/net/socket.c
index 28a0263..17c98a5 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2468,6 +2468,27 @@ static int ethtool_ioctl(struct net *net, struct compat_ifreq __user *ifr32)
return dev_ioctl(net, SIOCETHTOOL, ifr);
}
+static int compat_siocwandev(struct net *net, struct compat_ifreq __user *uifr32)
+{
+ void __user *uptr;
+ compat_uptr_t uptr32;
+ struct ifreq __user *uifr;
+
+ uifr = compat_alloc_user_space(sizeof (*uifr));
+ if (copy_in_user(uifr, uifr32, sizeof(struct compat_ifreq)))
+ return -EFAULT;
+
+ if (get_user(uptr32, &uifr32->ifr_settings.ifs_ifsu))
+ return -EFAULT;
+
+ uptr = compat_ptr(uptr32);
+
+ if (put_user(uptr, &uifr->ifr_settings.ifs_ifsu.raw_hdlc))
+ return -EFAULT;
+
+ return dev_ioctl(net, SIOCWANDEV, uifr);
+}
+
static int bond_ioctl(struct net *net, unsigned int cmd,
struct compat_ifreq __user *ifr32)
{
@@ -2900,6 +2921,8 @@ static int compat_sock_ioctl_trans(struct file *file, struct socket *sock,
return dev_ifconf(net, argp);
case SIOCETHTOOL:
return ethtool_ioctl(net, argp);
+ case SIOCWANDEV:
+ return compat_siocwandev(net, argp);
case SIOCBONDENSLAVE:
case SIOCBONDRELEASE:
case SIOCBONDSETHWADDR:
--
1.6.3.3
^ permalink raw reply related
* [PATCH 1/2] net, compat_ioctl: fix SIOCGMII ioctls
From: Arnd Bergmann @ 2009-11-08 21:34 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, hch, netdev
In-Reply-To: <200911082231.48060.arnd@arndb.de>
SIOCGMIIPHY and SIOCGMIIREG return data through ifreq,
so it needs to be converted on the way out as well.
SIOCGIFPFLAGS is unused, but has the same problem in theory.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
net/socket.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/net/socket.c b/net/socket.c
index 688de5d..28a0263 100644
--- a/net/socket.c
+++ b/net/socket.c
@@ -2587,7 +2587,10 @@ static int dev_ifsioc(struct net *net, struct socket *sock,
case SIOCGIFBRDADDR:
case SIOCGIFDSTADDR:
case SIOCGIFNETMASK:
+ case SIOCGIFPFLAGS:
case SIOCGIFTXQLEN:
+ case SIOCGMIIPHY:
+ case SIOCGMIIREG:
if (copy_to_user(uifr32, &ifr, sizeof(*uifr32)))
return -EFAULT;
break;
--
1.6.3.3
^ permalink raw reply related
* Re: [RFC, PATCH 0/7] net, compat_ioctl: move handlers to net/socket.c
From: Arnd Bergmann @ 2009-11-08 21:31 UTC (permalink / raw)
To: David Miller; +Cc: linux-kernel, hch, netdev, David Woodhouse
In-Reply-To: <20091106.204753.223665411.davem@davemloft.net>
On Saturday 07 November 2009, David Miller wrote:
> From: Arnd Bergmann <arnd@arndb.de>
> Date: Fri, 6 Nov 2009 19:09:02 +0100
>
> > This cleans up some of the socket ioctl handling by moving it
> > from fs/compat_ioctl.c to net/socket.c. The code is still untested,
> > so this is an RFC for now. If you're happy with it, I'll do some
> > testing to see if everything still works.
> >
> > This series is a prerequisite for cleaning up the rest of
> > compat_ioctl.c, saving some 30kb of kernel memory in the end.
> >
> > The first four patches are probably worthwhile independently,
> > because they fix some bugs in compat_ioctl handling.
> > There is some obvious conflict with the ATM patch I sent
> > independently today. That one should probably be worked out
> > first.
>
> This looks great, all applied. Please make the fixups recommended
> to you in the feedback as followon patches.
Thanks! Two patches follow.
Any opinion on how to proceed with the ATM stuff? From my
point of view, I'm fine with having moved it out of fs/compat_ioctl.c,
but it's still a bit silly to have two half-complete implementations.
> Also, I added the following cure after your patch series:
>
> net: compat: No need to define IFHWADDRLEN and IFNAMSIZ twice.
>
> It's defined colloqually in linux/if.h and linux/compat.h
> includes that.
ok.
Arnd <><
^ permalink raw reply
* Re: [PATCH v4 12/12] tree-wide: convert open calls to remove spaces to skip_spaces() lib function
From: Julia Lawall @ 2009-11-08 20:23 UTC (permalink / raw)
To: Theodore Tso
Cc: Pavel Roskin, Stefan Haberland, Jan Kara, linux-cachefs,
Mike Snitzer, Neil Brown, Frederic Weisbecker, Jens Axboe,
Heiko Carstens, James E . J . Bottomley, ibm-acpi-devel, dm-devel,
H . Peter Anvin, Daire Byrne, Alasdair G Kergon, Greg Banks,
Stefan Weinhuber, Eric Sandeen, Adam Belay, Helge Deller, x86,
James Morris, Takashi Iwai, André Goddard Rosa, Alan Cox
In-Reply-To: <20091108184722.GA1647@mit.edu>
> > Also, while at it, if we see (*str && isspace(*str)), we can be sure to
> > remove the first condition (*str) as the second one (isspace(*str)) also
> > evaluates to 0 whenever *str == 0, making it redundant. In other words,
> > "a char equals zero is never a space".
I tried the following semantic patch (http://coccinelle.lip6.fr), and got
the results below.
@@
expression str;
@@
( // ignore skip_spaces cases
while (*str && isspace(*str)) { \(str++;\|++str;\) }
|
- *str &&
isspace(*str)
)
I haven't checked the results in any way, however.
julia
diff -u -p a/drivers/leds/led-class.c b/drivers/leds/led-class.c
--- a/drivers/leds/led-class.c
+++ b/drivers/leds/led-class.c
@@ -50,7 +50,7 @@ static ssize_t led_brightness_store(stru
unsigned long state = simple_strtoul(buf, &after, 10);
size_t count = after - buf;
- if (*after && isspace(*after))
+ if (isspace(*after))
count++;
if (count == size) {
diff -u -p a/drivers/leds/ledtrig-timer.c b/drivers/leds/ledtrig-timer.c
--- a/drivers/leds/ledtrig-timer.c
+++ b/drivers/leds/ledtrig-timer.c
@@ -83,7 +83,7 @@ static ssize_t led_delay_on_store(struct
unsigned long state = simple_strtoul(buf, &after, 10);
size_t count = after - buf;
- if (*after && isspace(*after))
+ if (isspace(*after))
count++;
if (count == size) {
@@ -127,7 +127,7 @@ static ssize_t led_delay_off_store(struc
unsigned long state = simple_strtoul(buf, &after, 10);
size_t count = after - buf;
- if (*after && isspace(*after))
+ if (isspace(*after))
count++;
if (count == size) {
diff -u -p a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c
--- a/drivers/video/backlight/lcd.c
+++ b/drivers/video/backlight/lcd.c
@@ -101,7 +101,7 @@ static ssize_t lcd_store_power(struct de
int power = simple_strtoul(buf, &endp, 0);
size_t size = endp - buf;
- if (*endp && isspace(*endp))
+ if (isspace(*endp))
size++;
if (size != count)
return -EINVAL;
@@ -140,7 +140,7 @@ static ssize_t lcd_store_contrast(struct
int contrast = simple_strtoul(buf, &endp, 0);
size_t size = endp - buf;
- if (*endp && isspace(*endp))
+ if (isspace(*endp))
size++;
if (size != count)
return -EINVAL;
diff -u -p a/drivers/video/display/display-sysfs.c b/drivers/video/display/display-sysfs.c
--- a/drivers/video/display/display-sysfs.c
+++ b/drivers/video/display/display-sysfs.c
@@ -67,7 +67,7 @@ static ssize_t display_store_contrast(st
contrast = simple_strtoul(buf, &endp, 0);
size = endp - buf;
- if (*endp && isspace(*endp))
+ if (isspace(*endp))
size++;
if (size != count)
diff -u -p a/drivers/video/output.c b/drivers/video/output.c
--- a/drivers/video/output.c
+++ b/drivers/video/output.c
@@ -50,7 +50,7 @@ static ssize_t video_output_store_state(
int request_state = simple_strtoul(buf,&endp,0);
size_t size = endp - buf;
- if (*endp && isspace(*endp))
+ if (isspace(*endp))
size++;
if (size != count)
return -EINVAL;
^ permalink raw reply
* [PATCH 8/8] udp: multicast RX should increment SNMP/sk_drops counter in allocation failures
From: Eric Dumazet @ 2009-11-08 20:20 UTC (permalink / raw)
To: David S. Miller
Cc: Linux Netdev List, Lucian Adrian Grijincu, Octavian Purdila
When skb_clone() fails, we should increment sk_drops and SNMP counters.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/ipv4/udp.c | 12 +++++++++++-
net/ipv6/udp.c | 8 +++++++-
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 9d9072c..d73e917 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1335,12 +1335,22 @@ static void flush_stack(struct sock **stack, unsigned int count,
{
unsigned int i;
struct sk_buff *skb1 = NULL;
+ struct sock *sk;
for (i = 0; i < count; i++) {
+ sk = stack[i];
if (likely(skb1 == NULL))
skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
- if (skb1 && udp_queue_rcv_skb(stack[i], skb1) <= 0)
+ if (!skb1) {
+ atomic_inc(&sk->sk_drops);
+ UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_RCVBUFERRORS,
+ IS_UDPLITE(sk));
+ UDP_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS,
+ IS_UDPLITE(sk));
+ }
+
+ if (skb1 && udp_queue_rcv_skb(sk, skb1) <= 0)
skb1 = NULL;
}
if (unlikely(skb1))
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 173e531..84cc4a8 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -579,14 +579,20 @@ static void flush_stack(struct sock **stack, unsigned int count,
for (i = 0; i < count; i++) {
skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
+ sk = stack[i];
if (skb1) {
- sk = stack[i];
bh_lock_sock(sk);
if (!sock_owned_by_user(sk))
udpv6_queue_rcv_skb(sk, skb1);
else
sk_add_backlog(sk, skb1);
bh_unlock_sock(sk);
+ } else {
+ atomic_inc(&sk->sk_drops);
+ UDP6_INC_STATS_BH(sock_net(sk),
+ UDP_MIB_RCVBUFERRORS, IS_UDPLITE(sk));
+ UDP6_INC_STATS_BH(sock_net(sk),
+ UDP_MIB_INERRORS, IS_UDPLITE(sk));
}
}
}
^ permalink raw reply related
* [PATCH 7/8] ipv6: udp: Optimise multicast reception
From: Eric Dumazet @ 2009-11-08 20:18 UTC (permalink / raw)
To: David S. Miller
Cc: Linux Netdev List, Lucian Adrian Grijincu, Octavian Purdila
IPV6 UDP multicast rx path is a bit complex and can hold a spinlock
for a long time.
Using a small (32 or 64 entries) stack of socket pointers can help
to perform expensive operations (skb_clone(), udp_queue_rcv_skb())
outside of the lock, in most cases.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
net/ipv6/udp.c | 71 +++++++++++++++++++++++++++++++----------------
1 files changed, 47 insertions(+), 24 deletions(-)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index c5b0451..173e531 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -569,6 +569,27 @@ static struct sock *udp_v6_mcast_next(struct net *net, struct sock *sk,
return NULL;
}
+static void flush_stack(struct sock **stack, unsigned int count,
+ struct sk_buff *skb, unsigned int final)
+{
+ unsigned int i;
+ struct sock *sk;
+ struct sk_buff *skb1;
+
+ for (i = 0; i < count; i++) {
+ skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
+
+ if (skb1) {
+ sk = stack[i];
+ bh_lock_sock(sk);
+ if (!sock_owned_by_user(sk))
+ udpv6_queue_rcv_skb(sk, skb1);
+ else
+ sk_add_backlog(sk, skb1);
+ bh_unlock_sock(sk);
+ }
+ }
+}
/*
* Note: called only from the BH handler context,
* so we don't need to lock the hashes.
@@ -577,41 +598,43 @@ static int __udp6_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
struct in6_addr *saddr, struct in6_addr *daddr,
struct udp_table *udptable)
{
- struct sock *sk, *sk2;
+ struct sock *sk, *stack[256 / sizeof(struct sock *)];
const struct udphdr *uh = udp_hdr(skb);
struct udp_hslot *hslot = udp_hashslot(udptable, net, ntohs(uh->dest));
int dif;
+ unsigned int i, count = 0;
spin_lock(&hslot->lock);
sk = sk_nulls_head(&hslot->head);
dif = inet6_iif(skb);
sk = udp_v6_mcast_next(net, sk, uh->dest, daddr, uh->source, saddr, dif);
- if (!sk) {
- kfree_skb(skb);
- goto out;
- }
-
- sk2 = sk;
- while ((sk2 = udp_v6_mcast_next(net, sk_nulls_next(sk2), uh->dest, daddr,
- uh->source, saddr, dif))) {
- struct sk_buff *buff = skb_clone(skb, GFP_ATOMIC);
- if (buff) {
- bh_lock_sock(sk2);
- if (!sock_owned_by_user(sk2))
- udpv6_queue_rcv_skb(sk2, buff);
- else
- sk_add_backlog(sk2, buff);
- bh_unlock_sock(sk2);
+ while (sk) {
+ stack[count++] = sk;
+ sk = udp_v6_mcast_next(net, sk_nulls_next(sk), uh->dest, daddr,
+ uh->source, saddr, dif);
+ if (unlikely(count == ARRAY_SIZE(stack))) {
+ if (!sk)
+ break;
+ flush_stack(stack, count, skb, ~0);
+ count = 0;
}
}
- bh_lock_sock(sk);
- if (!sock_owned_by_user(sk))
- udpv6_queue_rcv_skb(sk, skb);
- else
- sk_add_backlog(sk, skb);
- bh_unlock_sock(sk);
-out:
+ /*
+ * before releasing the lock, we must take reference on sockets
+ */
+ for (i = 0; i < count; i++)
+ sock_hold(stack[i]);
+
spin_unlock(&hslot->lock);
+
+ if (count) {
+ flush_stack(stack, count, skb, count - 1);
+
+ for (i = 0; i < count; i++)
+ sock_put(stack[i]);
+ } else {
+ kfree_skb(skb);
+ }
return 0;
}
^ permalink raw reply related
* [PATCH 6/8] ipv4: udp: Optimise multicast reception
From: Eric Dumazet @ 2009-11-08 20:18 UTC (permalink / raw)
To: David S. Miller
Cc: Linux Netdev List, Lucian Adrian Grijincu, Octavian Purdila
UDP multicast rx path is a bit complex and can hold a spinlock
for a long time.
Using a small (32 or 64 entries) stack of socket pointers can help
to perform expensive operations (skb_clone(), udp_queue_rcv_skb())
outside of the lock, in most cases.
It's also a base for a future RCU conversion of multicast recption.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Lucian Adrian Grijincu <lgrijincu@ixiacom.com>
---
net/ipv4/udp.c | 76 ++++++++++++++++++++++++++++++-----------------
1 files changed, 50 insertions(+), 26 deletions(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index dd7f3d2..9d9072c 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1329,49 +1329,73 @@ drop:
return -1;
}
+
+static void flush_stack(struct sock **stack, unsigned int count,
+ struct sk_buff *skb, unsigned int final)
+{
+ unsigned int i;
+ struct sk_buff *skb1 = NULL;
+
+ for (i = 0; i < count; i++) {
+ if (likely(skb1 == NULL))
+ skb1 = (i == final) ? skb : skb_clone(skb, GFP_ATOMIC);
+
+ if (skb1 && udp_queue_rcv_skb(stack[i], skb1) <= 0)
+ skb1 = NULL;
+ }
+ if (unlikely(skb1))
+ kfree_skb(skb1);
+}
+
/*
* Multicasts and broadcasts go to each listener.
*
- * Note: called only from the BH handler context,
- * so we don't need to lock the hashes.
+ * Note: called only from the BH handler context.
*/
static int __udp4_lib_mcast_deliver(struct net *net, struct sk_buff *skb,
struct udphdr *uh,
__be32 saddr, __be32 daddr,
struct udp_table *udptable)
{
- struct sock *sk;
+ struct sock *sk, *stack[256 / sizeof(struct sock *)];
struct udp_hslot *hslot = udp_hashslot(udptable, net, ntohs(uh->dest));
int dif;
+ unsigned int i, count = 0;
spin_lock(&hslot->lock);
sk = sk_nulls_head(&hslot->head);
dif = skb->dev->ifindex;
sk = udp_v4_mcast_next(net, sk, uh->dest, daddr, uh->source, saddr, dif);
- if (sk) {
- struct sock *sknext = NULL;
-
- do {
- struct sk_buff *skb1 = skb;
-
- sknext = udp_v4_mcast_next(net, sk_nulls_next(sk), uh->dest,
- daddr, uh->source, saddr,
- dif);
- if (sknext)
- skb1 = skb_clone(skb, GFP_ATOMIC);
-
- if (skb1) {
- int ret = udp_queue_rcv_skb(sk, skb1);
- if (ret > 0)
- /* we should probably re-process instead
- * of dropping packets here. */
- kfree_skb(skb1);
- }
- sk = sknext;
- } while (sknext);
- } else
- consume_skb(skb);
+ while (sk) {
+ stack[count++] = sk;
+ sk = udp_v4_mcast_next(net, sk_nulls_next(sk), uh->dest,
+ daddr, uh->source, saddr, dif);
+ if (unlikely(count == ARRAY_SIZE(stack))) {
+ if (!sk)
+ break;
+ flush_stack(stack, count, skb, ~0);
+ count = 0;
+ }
+ }
+ /*
+ * before releasing chain lock, we must take a reference on sockets
+ */
+ for (i = 0; i < count; i++)
+ sock_hold(stack[i]);
+
spin_unlock(&hslot->lock);
+
+ /*
+ * do the slow work with no lock held
+ */
+ if (count) {
+ flush_stack(stack, count, skb, count - 1);
+
+ for (i = 0; i < count; i++)
+ sock_put(stack[i]);
+ } else {
+ kfree_skb(skb);
+ }
return 0;
}
^ 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