* linux-next: build failure after merge of the net tree
From: Stephen Rothwell @ 2011-01-21 1:05 UTC (permalink / raw)
To: David Miller, netdev
Cc: linux-next, linux-kernel, Pablo Neira Ayuso, Patrick McHardy
[-- Attachment #1: Type: text/plain, Size: 580 bytes --]
Hi all,
After merging the net tree, today's linux-next build (powerpc
ppc64_defconfig) failed like this:
ERROR: ".nf_conntrack_tstamp_fini" [net/netfilter/nf_conntrack.ko] undefined!
ERROR: ".nf_conntrack_tstamp_init" [net/netfilter/nf_conntrack.ko] undefined!
Presumably caused by commit a992ca2a0498edd22a88ac8c41570f536de29c9e
("netfilter: nf_conntrack_tstamp: add flow-based timestamp extension").
I have used the net tree from next-20110120 for today.
--
Cheers,
Stephen Rothwell sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
[-- Attachment #2: Type: application/pgp-signature, Size: 490 bytes --]
^ permalink raw reply
* Re: [PATCH clean-up] dccp: clean up unused DCCP_STATE_MASK definition
From: David Miller @ 2011-01-21 1:00 UTC (permalink / raw)
To: gerrit; +Cc: shanwei, acme, dccp, netdev
In-Reply-To: <58207.148.187.160.35.1295523521.squirrel@148.187.160.35>
From: gerrit@erg.abdn.ac.uk
Date: Thu, 20 Jan 2011 11:38:41 -0000 (GMT)
>> Remove unused DCCP_STATE_MASK macro.
>>
>>
>> Signed-off-by: Shan Wei <shanwei@cn.fujitsu.com>
> Acked-by: Gerrit Renker <gerrit@erg.abdn.ac.uk>
Applied.
^ permalink raw reply
* Re: [PATCH net-2.6] cxgb4: fix reported state of interfaces without link
From: David Miller @ 2011-01-21 1:00 UTC (permalink / raw)
To: dm; +Cc: netdev
In-Reply-To: <1295486945-22015-1-git-send-email-dm@chelsio.com>
From: Dimitris Michailidis <dm@chelsio.com>
Date: Wed, 19 Jan 2011 17:29:05 -0800
> Currently tools like ip and ifconfig report incorrect state for cxgb4
> interfaces that are up but do not have link and do so until first link
> establishment. This is because the initial netif_carrier_off call is
> before register_netdev and it needs to be after to be fully effective.
> Fix this by moving netif_carrier_off into .ndo_open.
>
> Signed-off-by: Dimitris Michailidis <dm@chelsio.com>
Applied.
^ permalink raw reply
* Re: [net-next-2.6 PATCH] enic: Bug Fix: Dont reset ENIC_SET_APPLIED flag on port profile disassociate
From: David Miller @ 2011-01-21 0:57 UTC (permalink / raw)
To: roprabhu; +Cc: netdev
In-Reply-To: <20110121003554.25697.15096.stgit@savbu-pc100.cisco.com>
From: Roopa Prabhu <roprabhu@cisco.com>
Date: Thu, 20 Jan 2011 16:35:54 -0800
> From: Roopa Prabhu <roprabhu@cisco.com>
>
> enic_get_vf_port returns port profile operation status only if ENIC_SET_APPLIED
> flag is set. A recent rework of enic_set_port_profile added code to reset this
> flag on disassociate. As a result of which a client calling enic_get_vf_port
> to get the status of port profile disassociate will always get a return value
> of ENODATA. This patch renames ENIC_SET_APPLIED to more appropriate
> ENIC_PORT_REQUEST_APPLIED and reverts back the recent change so that the
> flag is set both at associate and disassociate of a port profile.
>
> Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
> Signed-off-by: David Wang <dwang2@cisco.com>
> Signed-off-by: Christian Benvenuti <benve@cisco.com>
Applied.
^ permalink raw reply
* Re: [PATCH] ipv6: raw: rcu annotations
From: David Miller @ 2011-01-21 0:56 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1295545073.2825.436.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 20 Jan 2011 18:37:53 +0100
> Remove sparse warnings, using a function typedef to be able to use __rcu
> annotation on mh_filter pointer.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net: ipv6: sit: fix rcu annotations
From: David Miller @ 2011-01-21 0:56 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1295543784.2825.409.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 20 Jan 2011 18:16:24 +0100
> Fix minor __rcu annotations and remove sparse warnings
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next-2.6] net_sched: move TCQ_F_THROTTLED flag
From: David Miller @ 2011-01-21 0:56 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, kaber, hawk, jarkao2, hadi
In-Reply-To: <1295537236.2825.286.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 20 Jan 2011 16:27:16 +0100
> In commit 371121057607e (net: QDISC_STATE_RUNNING dont need atomic bit
> ops) I moved QDISC_STATE_RUNNING flag to __state container, located in
> the cache line containing qdisc lock and often dirtied fields.
>
> I now move TCQ_F_THROTTLED bit too, so that we let first cache line read
> mostly, and shared by all cpus. This should speedup HTB/CBQ for example.
>
> Not using test_bit()/__clear_bit()/__test_and_set_bit allows to use an
> "unsigned int" for __state container, reducing by 8 bytes Qdisc size.
>
> Introduce helpers to hide implementation details.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] via-velocity: fix the WOL bug on 1000M full duplex forced mode.
From: David Miller @ 2011-01-21 0:56 UTC (permalink / raw)
To: romieu; +Cc: netdev, DavidLv
In-Reply-To: <20110120145933.GC7291@electric-eye.fr.zoreil.com>
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 20 Jan 2011 15:59:33 +0100
> The VIA velocity card can't be waken up by WOL tool on 1000M full
> duplex forced mode. This patch fixes the bug.
>
> Signed-off-by: David Lv <DavidLv@viatech.com.cn>
> Acked-by: Francois Romieu <romieu@fr.zoreil.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next-2.6] net_sched: RCU conversion of stab
From: David Miller @ 2011-01-21 0:56 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, kaber, hawk, jarkao2, hadi
In-Reply-To: <1295531299.2825.175.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 20 Jan 2011 14:48:19 +0100
> This patch converts stab qdisc management to RCU, so that we can perform
> the qdisc_calculate_pkt_len() call before getting qdisc lock.
>
> This shortens the lock's held time in __dev_xmit_skb().
>
> This permits more qdiscs to get TCQ_F_CAN_BYPASS status, avoiding lot of
> cache misses and so reducing latencies.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next-2.6] net_sched: sfq: allow divisor to be a parameter
From: David Miller @ 2011-01-21 0:56 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev, kaber, hawk, jarkao2, hadi, shemminger
In-Reply-To: <1295518498.2825.2.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 20 Jan 2011 11:14:58 +0100
> SFQ currently uses a 1024 slots hash table, and its internal structure
> (sfq_sched_data) allocation needs order-1 page on x86_64
>
> Allow tc command to specify a divisor value (hash table size), between 1
> and 65536.
> If no value is provided, assume the 1024 default size.
>
> This allows admins to setup smaller (or bigger) SFQ for specific needs.
>
> This also brings back sfq_sched_data allocations to order-0 ones, saving
> 3KB per SFQ qdisc.
>
> Jesper uses ~55.000 SFQ in one machine, this patch should free 165 MB of
> memory.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] neigh: __rcu annotations
From: David Miller @ 2011-01-21 0:56 UTC (permalink / raw)
To: eric.dumazet; +Cc: netdev
In-Reply-To: <1295510567.2653.487.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Thu, 20 Jan 2011 09:02:47 +0100
> fix some minor issues and sparse (__rcu) warnings
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net: dev_close_many() is static
From: David Miller @ 2011-01-21 0:55 UTC (permalink / raw)
To: opurdila; +Cc: eric.dumazet, netdev
In-Reply-To: <201101201116.29031.opurdila@ixiacom.com>
From: Octavian Purdila <opurdila@ixiacom.com>
Date: Thu, 20 Jan 2011 11:16:28 +0200
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Thursday 20 January 2011, 09:23:22
>
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>> CC: Octavian Purdila <opurdila@ixiacom.com>
> Oops, missed that. Thanks Eric !
>
> Reviewed-by: Octavian Purdila <opurdila@ixiacom.com>
Applied.
^ permalink raw reply
* Re: [PATCH] atl1e: remove private #define.
From: David Miller @ 2011-01-21 0:50 UTC (permalink / raw)
To: romieu; +Cc: netdev, jcliburn, chris.snook, jie.yang
In-Reply-To: <20110120145922.GB7291@electric-eye.fr.zoreil.com>
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 20 Jan 2011 15:59:23 +0100
> Either unused or duplicates from mii.h.
>
> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Applied.
^ permalink raw reply
* Re: [PATCH] atl1c: remove private #define.
From: David Miller @ 2011-01-21 0:50 UTC (permalink / raw)
To: romieu; +Cc: netdev, jcliburn, chris.snook, jie.yang
In-Reply-To: <20110120145906.GA7291@electric-eye.fr.zoreil.com>
From: Francois Romieu <romieu@fr.zoreil.com>
Date: Thu, 20 Jan 2011 15:59:06 +0100
> Either unused or duplicates from mii.h.
>
> Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Applied.
^ permalink raw reply
* Re: [PATCH] Ensure that we unshare skbs prior to calling pskb_may_pull in bonding driver
From: David Miller @ 2011-01-21 0:47 UTC (permalink / raw)
To: nhorman; +Cc: netdev, andy, fubar
In-Reply-To: <1295550151-25913-1-git-send-email-nhorman@tuxdriver.com>
From: Neil Horman <nhorman@tuxdriver.com>
Date: Thu, 20 Jan 2011 14:02:31 -0500
> Recently reported oops:
Applied, but please compose reasonable Subject lines with your patches,
always begin the line with a subsystem tag followed by a colon.
This way we get
bonding: Foo bar baz
instead of
Foo bar baz in the bonding driver
Thanks.
^ permalink raw reply
* Re: [GIT] Networking
From: Davide Libenzi @ 2011-01-21 0:40 UTC (permalink / raw)
To: Linus Torvalds
Cc: Colin Walters, Eric Dumazet, David Miller, Andrew Morton, netdev,
Linux Kernel Mailing List
In-Reply-To: <AANLkTik8dk1o2u+JxzsijYFxJ7Y3ZV16DUNkc-+SYPnu@mail.gmail.com>
On Thu, 20 Jan 2011, Linus Torvalds wrote:
> On Thu, Jan 20, 2011 at 4:02 PM, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
> >
> > So far I only did a revert, I didn't see exactly _which_ of the wakeup
> > cases it was. But it's definitely that commit.
>
> This patch - that adds all the appropriate POLLxxx flags - seems to
> fix it for me. Will commit. Anybody wants to review/ack?
I believe you can drop the POLLERR, otherwise looks good to me.
- Davide
^ permalink raw reply
* Re: [PATCH 0/7] netfilter: netfilter fixes for net-next
From: David Miller @ 2011-01-21 0:38 UTC (permalink / raw)
To: kaber; +Cc: netfilter-devel, netdev
In-Reply-To: <1295554966-5263-1-git-send-email-kaber@trash.net>
From: kaber@trash.net
Date: Thu, 20 Jan 2011 21:22:39 +0100
> Please apply or pull from:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6.git master
Pulled, thanks Patrick.
^ permalink raw reply
* [net-next-2.6 PATCH] enic: Bug Fix: Dont reset ENIC_SET_APPLIED flag on port profile disassociate
From: Roopa Prabhu @ 2011-01-21 0:35 UTC (permalink / raw)
To: davem; +Cc: netdev
From: Roopa Prabhu <roprabhu@cisco.com>
enic_get_vf_port returns port profile operation status only if ENIC_SET_APPLIED
flag is set. A recent rework of enic_set_port_profile added code to reset this
flag on disassociate. As a result of which a client calling enic_get_vf_port
to get the status of port profile disassociate will always get a return value
of ENODATA. This patch renames ENIC_SET_APPLIED to more appropriate
ENIC_PORT_REQUEST_APPLIED and reverts back the recent change so that the
flag is set both at associate and disassociate of a port profile.
Signed-off-by: Roopa Prabhu <roprabhu@cisco.com>
Signed-off-by: David Wang <dwang2@cisco.com>
Signed-off-by: Christian Benvenuti <benve@cisco.com>
---
drivers/net/enic/enic.h | 6 +++---
drivers/net/enic/enic_main.c | 10 ++++++----
2 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index a937f49..ca3be4f 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -32,8 +32,8 @@
#define DRV_NAME "enic"
#define DRV_DESCRIPTION "Cisco VIC Ethernet NIC Driver"
-#define DRV_VERSION "1.4.1.10"
-#define DRV_COPYRIGHT "Copyright 2008-2010 Cisco Systems, Inc"
+#define DRV_VERSION "2.1.1.2"
+#define DRV_COPYRIGHT "Copyright 2008-2011 Cisco Systems, Inc"
#define ENIC_BARS_MAX 6
@@ -49,7 +49,7 @@ struct enic_msix_entry {
void *devid;
};
-#define ENIC_SET_APPLIED (1 << 0)
+#define ENIC_PORT_REQUEST_APPLIED (1 << 0)
#define ENIC_SET_REQUEST (1 << 1)
#define ENIC_SET_NAME (1 << 2)
#define ENIC_SET_INSTANCE (1 << 3)
diff --git a/drivers/net/enic/enic_main.c b/drivers/net/enic/enic_main.c
index a0af48c..89664c6 100644
--- a/drivers/net/enic/enic_main.c
+++ b/drivers/net/enic/enic_main.c
@@ -1318,18 +1318,20 @@ static int enic_set_port_profile(struct enic *enic, u8 *mac)
vic_provinfo_free(vp);
if (err)
return err;
-
- enic->pp.set |= ENIC_SET_APPLIED;
break;
case PORT_REQUEST_DISASSOCIATE:
- enic->pp.set &= ~ENIC_SET_APPLIED;
break;
default:
return -EINVAL;
}
+ /* Set flag to indicate that the port assoc/disassoc
+ * request has been sent out to fw
+ */
+ enic->pp.set |= ENIC_PORT_REQUEST_APPLIED;
+
return 0;
}
@@ -1411,7 +1413,7 @@ static int enic_get_vf_port(struct net_device *netdev, int vf,
int err, error, done;
u16 response = PORT_PROFILE_RESPONSE_SUCCESS;
- if (!(enic->pp.set & ENIC_SET_APPLIED))
+ if (!(enic->pp.set & ENIC_PORT_REQUEST_APPLIED))
return -ENODATA;
err = enic_dev_init_done(enic, &done, &error);
^ permalink raw reply related
* Re: [GIT] Networking
From: Linus Torvalds @ 2011-01-21 0:11 UTC (permalink / raw)
To: Colin Walters, Davide Libenzi
Cc: Eric Dumazet, David Miller, akpm, netdev, linux-kernel
In-Reply-To: <AANLkTim71374Qb1TW5Lc8H+rpQNk5a25ARczHU-+cn=D@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 352 bytes --]
On Thu, Jan 20, 2011 at 4:02 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> So far I only did a revert, I didn't see exactly _which_ of the wakeup
> cases it was. But it's definitely that commit.
This patch - that adds all the appropriate POLLxxx flags - seems to
fix it for me. Will commit. Anybody wants to review/ack?
Linus
[-- Attachment #2: patch.diff --]
[-- Type: text/x-patch, Size: 1773 bytes --]
fs/pipe.c | 10 +++++-----
1 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/fs/pipe.c b/fs/pipe.c
index 89e9e19..da42f7d 100644
--- a/fs/pipe.c
+++ b/fs/pipe.c
@@ -441,7 +441,7 @@ redo:
break;
}
if (do_wakeup) {
- wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT);
+ wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM);
kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
}
pipe_wait(pipe);
@@ -450,7 +450,7 @@ redo:
/* Signal writers asynchronously that there is more room. */
if (do_wakeup) {
- wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT);
+ wake_up_interruptible_sync_poll(&pipe->wait, POLLOUT | POLLWRNORM);
kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
}
if (ret > 0)
@@ -612,7 +612,7 @@ redo2:
break;
}
if (do_wakeup) {
- wake_up_interruptible_sync_poll(&pipe->wait, POLLIN);
+ wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
do_wakeup = 0;
}
@@ -623,7 +623,7 @@ redo2:
out:
mutex_unlock(&inode->i_mutex);
if (do_wakeup) {
- wake_up_interruptible_sync_poll(&pipe->wait, POLLIN);
+ wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLRDNORM);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
}
if (ret > 0)
@@ -715,7 +715,7 @@ pipe_release(struct inode *inode, int decr, int decw)
if (!pipe->readers && !pipe->writers) {
free_pipe_info(inode);
} else {
- wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT);
+ wake_up_interruptible_sync_poll(&pipe->wait, POLLIN | POLLOUT | POLLRDNORM | POLLWRNORM | POLLERR | POLLHUP);
kill_fasync(&pipe->fasync_readers, SIGIO, POLL_IN);
kill_fasync(&pipe->fasync_writers, SIGIO, POLL_OUT);
}
^ permalink raw reply related
* Re: [PATCH] Fix NULL dereference in rtlwifi driver
From: Jesper Juhl @ 2011-01-21 0:04 UTC (permalink / raw)
To: Larry Finger
Cc: netdev, linux-wireless, linux-kernel, John W. Linville,
Chaoming Li
In-Reply-To: <4D38CB7E.5000304@lwfinger.net>
On Thu, 20 Jan 2011, Larry Finger wrote:
> On 01/20/2011 04:18 PM, Jesper Juhl wrote:
> > In drivers/net/wireless/rtlwifi/pci.c::_rtl_pci_rx_interrupt() we call
> > dev_alloc_skb(), which may fail and return NULL, but we do not check the
> > returned value against NULL before dereferencing the returned pointer.
> > This may lead to a NULL pointer dereference which means we'll crash - not
> > good.
> >
> > This patch tries to solve the issue by testing for NULL and bailing out if
> > we couldn't allocate a skb. However, I don't know this code well, so I'm
> > not sure that jumping to the 'done' label here is the correct action to
> > take. Someone more knowledgable about this code than me should definately
> > review it before it is applied anywhere.
> > While I was in the area I also moved an assignment in
> > _rtl_pci_init_rx_ring() a bit - if the dev_alloc_skb() call in that
> > function fails there's no reason to waste clock cycles assigning to the
> > local variable 'entry', we may as well do that after the NULL check and
> > potential bail out.
> >
> > Here's the proposed patch, but please don't take it as much more than a
> > bug report. If it happens to be correct, then by all means apply it, but
> > I'm not personally making any guarantees.
> >
> > Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> > ---
> > pci.c | 9 ++++++++-
> > 1 file changed, 8 insertions(+), 1 deletion(-)
> >
> > compile tested only, I don't have the hardware to test for real.
> >
> > diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
> > index 0fa36aa..5e99f89 100644
> > --- a/drivers/net/wireless/rtlwifi/pci.c
> > +++ b/drivers/net/wireless/rtlwifi/pci.c
> > @@ -619,6 +619,13 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
> > struct sk_buff *uskb = NULL;
> > u8 *pdata;
> > uskb = dev_alloc_skb(skb->len + 128);
> > + if (!uskb) {
> > + RT_TRACE(rtlpriv,
> > + (COMP_INTR | COMP_RECV),
> > + DBG_DMESG,
> > + ("can't alloc rx skb\n"));
> > + goto done;
> > + }
> > memcpy(IEEE80211_SKB_RXCB(uskb),
> > &rx_status,
> > sizeof(rx_status));
> > @@ -1066,9 +1073,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
> > struct sk_buff *skb =
> > dev_alloc_skb(rtlpci->rxbuffersize);
> > u32 bufferaddress;
> > - entry = &rtlpci->rx_ring[rx_queue_idx].desc[i];
> > if (!skb)
> > return 0;
> > + entry = &rtlpci->rx_ring[rx_queue_idx].desc[i];
> >
> > /*skb->dev = dev; */
> >
>
> This patch looks mostly good to me. The only change I would make is to replace
> "DBG_DMESG" in the RT_TRACE statement with "DBG_EMERG". The standard setting of
> the debug variable does not generate output for DBG_DMESG.
>
> With that change, ACK and
> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
>
Here you go.
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
pci.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index 0fa36aa..1758d44 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -619,6 +619,13 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
struct sk_buff *uskb = NULL;
u8 *pdata;
uskb = dev_alloc_skb(skb->len + 128);
+ if (!uskb) {
+ RT_TRACE(rtlpriv,
+ (COMP_INTR | COMP_RECV),
+ DBG_EMERG,
+ ("can't alloc rx skb\n"));
+ goto done;
+ }
memcpy(IEEE80211_SKB_RXCB(uskb),
&rx_status,
sizeof(rx_status));
@@ -641,7 +648,7 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
new_skb = dev_alloc_skb(rtlpci->rxbuffersize);
if (unlikely(!new_skb)) {
RT_TRACE(rtlpriv, (COMP_INTR | COMP_RECV),
- DBG_DMESG,
+ DBG_EMERG,
("can't alloc skb for rx\n"));
goto done;
}
@@ -1066,9 +1073,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
struct sk_buff *skb =
dev_alloc_skb(rtlpci->rxbuffersize);
u32 bufferaddress;
- entry = &rtlpci->rx_ring[rx_queue_idx].desc[i];
if (!skb)
return 0;
+ entry = &rtlpci->rx_ring[rx_queue_idx].desc[i];
/*skb->dev = dev; */
--
Jesper Juhl <jj@chaosbits.net> http://www.chaosbits.net/
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please.
^ permalink raw reply related
* Re: [GIT] Networking
From: Linus Torvalds @ 2011-01-21 0:02 UTC (permalink / raw)
To: Colin Walters, Davide Libenzi
Cc: Eric Dumazet, David Miller, akpm, netdev, linux-kernel
In-Reply-To: <AANLkTin-RBwg+J4MqOm7A40-TFAJ1sp4e6tzi6OaobNi@mail.gmail.com>
On Thu, Jan 20, 2011 at 3:43 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
> But it turns out to be a kernel bug after all, although not in
> networking. It bisected down to commit e462c448fdc8: "pipe: use event
> aware wakeups".
>
> Anyway, I'll double-check my bisect by doing a revert of that commit
> on top of current -git, but I'm pretty sure the bisect was correct,
> since it did end up pointing to a commit that clearly changed poll
> behavior.
Confirmed. With that commit reverted, gnome-screensaver-dialog works again.
So far I only did a revert, I didn't see exactly _which_ of the wakeup
cases it was. But it's definitely that commit.
Linus
^ permalink raw reply
* Re: [PATCH] Fix NULL dereference in rtlwifi driver
From: Larry Finger @ 2011-01-20 23:55 UTC (permalink / raw)
To: Jesper Juhl
Cc: netdev, linux-wireless, linux-kernel, John W. Linville,
Chaoming Li
In-Reply-To: <alpine.LNX.2.00.1101202309030.11854@swampdragon.chaosbits.net>
On 01/20/2011 04:18 PM, Jesper Juhl wrote:
> In drivers/net/wireless/rtlwifi/pci.c::_rtl_pci_rx_interrupt() we call
> dev_alloc_skb(), which may fail and return NULL, but we do not check the
> returned value against NULL before dereferencing the returned pointer.
> This may lead to a NULL pointer dereference which means we'll crash - not
> good.
>
> This patch tries to solve the issue by testing for NULL and bailing out if
> we couldn't allocate a skb. However, I don't know this code well, so I'm
> not sure that jumping to the 'done' label here is the correct action to
> take. Someone more knowledgable about this code than me should definately
> review it before it is applied anywhere.
> While I was in the area I also moved an assignment in
> _rtl_pci_init_rx_ring() a bit - if the dev_alloc_skb() call in that
> function fails there's no reason to waste clock cycles assigning to the
> local variable 'entry', we may as well do that after the NULL check and
> potential bail out.
>
> Here's the proposed patch, but please don't take it as much more than a
> bug report. If it happens to be correct, then by all means apply it, but
> I'm not personally making any guarantees.
>
> Signed-off-by: Jesper Juhl <jj@chaosbits.net>
> ---
> pci.c | 9 ++++++++-
> 1 file changed, 8 insertions(+), 1 deletion(-)
>
> compile tested only, I don't have the hardware to test for real.
>
> diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
> index 0fa36aa..5e99f89 100644
> --- a/drivers/net/wireless/rtlwifi/pci.c
> +++ b/drivers/net/wireless/rtlwifi/pci.c
> @@ -619,6 +619,13 @@ static void _rtl_pci_rx_interrupt(struct ieee80211_hw *hw)
> struct sk_buff *uskb = NULL;
> u8 *pdata;
> uskb = dev_alloc_skb(skb->len + 128);
> + if (!uskb) {
> + RT_TRACE(rtlpriv,
> + (COMP_INTR | COMP_RECV),
> + DBG_DMESG,
> + ("can't alloc rx skb\n"));
> + goto done;
> + }
> memcpy(IEEE80211_SKB_RXCB(uskb),
> &rx_status,
> sizeof(rx_status));
> @@ -1066,9 +1073,9 @@ static int _rtl_pci_init_rx_ring(struct ieee80211_hw *hw)
> struct sk_buff *skb =
> dev_alloc_skb(rtlpci->rxbuffersize);
> u32 bufferaddress;
> - entry = &rtlpci->rx_ring[rx_queue_idx].desc[i];
> if (!skb)
> return 0;
> + entry = &rtlpci->rx_ring[rx_queue_idx].desc[i];
>
> /*skb->dev = dev; */
>
This patch looks mostly good to me. The only change I would make is to replace
"DBG_DMESG" in the RT_TRACE statement with "DBG_EMERG". The standard setting of
the debug variable does not generate output for DBG_DMESG.
With that change, ACK and
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Larry
^ permalink raw reply
* Re: [GIT] Networking
From: Linus Torvalds @ 2011-01-20 23:43 UTC (permalink / raw)
To: Colin Walters, Davide Libenzi
Cc: Eric Dumazet, David Miller, akpm, netdev, linux-kernel
In-Reply-To: <AANLkTin6GM5W0nmWgD1a-2FK=CvHk=P3o6CYe-sFe6c=@mail.gmail.com>
On Thu, Jan 20, 2011 at 2:38 PM, Colin Walters <walters@verbum.org> wrote:
>
> It is actually; see src/gs-auth-pam.c; there is some pretty scary code
> there; basically all of PAM is put in a thread to avoid blocking the
> mainloop. Whether the code is actually buggy I can't say immediately;
> it's certainly possible.
I stand corrected.
But it turns out to be a kernel bug after all, although not in
networking. It bisected down to commit e462c448fdc8: "pipe: use event
aware wakeups".
I don't immediately see why, but I suspect it's the pipe_release()
case that needs to add POLLHUP to the wakeup cases. I suspect that
what is going on is that gnome-screensaver-dialog uses a pipe to talk
to the PAM code, and waits for the pipe to close. And we used to wake
it up unconditionally, but now we only wake up the poll waiter if it's
waiting for POLLIN/POLLOUT, rather than for anything else.
Anyway, I'll double-check my bisect by doing a revert of that commit
on top of current -git, but I'm pretty sure the bisect was correct,
since it did end up pointing to a commit that clearly changed poll
behavior.
Linus
^ permalink raw reply
* Re: [PATCH] CHOKe flow scheduler (0.10)
From: Eric Dumazet @ 2011-01-20 22:46 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: Patrick McHardy, David Miller, netdev
In-Reply-To: <1295547589.2825.497.camel@edumazet-laptop>
Le jeudi 20 janvier 2011 à 19:19 +0100, Eric Dumazet a écrit :
> Le jeudi 20 janvier 2011 à 09:38 -0800, Stephen Hemminger a écrit :
>
> ...
>
> Hi Stephen
>
> I am contemplating choke_linearize_header() (yet another hash
> function... oh well...) and say :
>
> Instead of this boolean return, just use skb_get_rxhash(). It performs
> what you want, and return 32bits of information, instead of one bit.
>
> (if result (rxhash) is zero, it means you can drop packet because it is
> not linearized)
>
> So choke_match_flow() can be faster if rxhash differs (no cache miss on
> skb->data on an old skb)
> (Do the full check only if rxhash is equal on skb1 / skb2)
>
> More over, the skb_get_rxhash() call is _really_ needed only if CHOKe
> triggers :
> if (p->qavg <= p->qth_min)
> we dont have to compute rxhash at all.
>
> If you want, I can send a diff on your v0.10, just tell me !
Here is my diff against v 0.10
Seems to work well here
qdisc choke 11: parent 1:11 limit 130000b min 10833b max 32500b ewma 13 Plog 21 Scell_log 30
Sent 459876256 bytes 836183 pkt (dropped 318428, overlimits 28 requeues 0)
rate 51823Kbit 11779pps backlog 5926323b 10781p requeues 0
marked 0 early 28 pdrop 0 other 0 matched 159200
Thanks !
net/sched/sch_choke.c | 114 ++++++++++++----------------------------
1 file changed, 37 insertions(+), 77 deletions(-)
diff --git a/net/sched/sch_choke.c b/net/sched/sch_choke.c
index e1ac560..0e898ed 100644
--- a/net/sched/sch_choke.c
+++ b/net/sched/sch_choke.c
@@ -141,63 +141,24 @@ static void choke_drop_by_idx(struct Qdisc *sch, unsigned int idx)
--sch->q.qlen;
}
-/* Make sure network and transport headers can be dereferenced */
-static bool choke_linearize_header(struct sk_buff *skb)
-{
- int nhoff, poff;
- struct ipv6hdr *ip6;
- struct iphdr *ip;
- u8 ip_proto;
- u32 ihl;
-
- nhoff = skb_network_offset(skb);
-
- switch (skb->protocol) {
- case __constant_htons(ETH_P_IP):
- if (!pskb_may_pull(skb, sizeof(*ip) + nhoff))
- return false;
-
- ip = (struct iphdr *) (skb->data + nhoff);
- if (ip->frag_off & htons(IP_MF | IP_OFFSET))
- return false;
-
- ip_proto = ip->protocol;
- ihl = ip->ihl;
- break;
- case __constant_htons(ETH_P_IPV6):
- if (!pskb_may_pull(skb, sizeof(*ip6) + nhoff))
- return false;
-
- ip6 = (struct ipv6hdr *) (skb->data + nhoff);
- ip_proto = ip6->nexthdr;
- ihl = (40 >> 2);
- break;
- default:
- return true;
- }
-
- poff = proto_ports_offset(ip_proto);
- if (poff >= 0) {
- nhoff += ihl * 4 + poff;
- if (!pskb_may_pull(skb, nhoff + 4))
- return false;
- }
-
- return true;
-}
-
/*
* Compare flow of two packets
* Returns true only if source and destination address and port match.
* false for special cases
*/
-static bool choke_match_flow(const struct sk_buff *skb1,
- const struct sk_buff *skb2)
+static bool choke_match_flow(struct sk_buff *skb1,
+ struct sk_buff *skb2)
{
int off1, off2, poff;
+ const u32 *ports1, *ports2;
+ u8 ip_proto;
if (skb1->protocol != skb2->protocol)
return false;
+ if (skb_get_rxhash(skb1) != skb_get_rxhash(skb2))
+ return false;
+ if (!skb_get_rxhash(skb1))
+ return true;
off1 = skb_network_offset(skb1);
off2 = skb_network_offset(skb2);
@@ -209,27 +170,14 @@ static bool choke_match_flow(const struct sk_buff *skb1,
ip1 = (struct iphdr *) (skb1->data + off1);
ip2 = (struct iphdr *) (skb2->data + off2);
- if (ip1->protocol != ip2->protocol ||
+ ip_proto = ip1->protocol;
+ if (ip_proto != ip2->protocol ||
ip1->saddr != ip2->saddr || ip1->daddr != ip2->daddr)
return false;
-
- if (ip1->frag_off & htons(IP_MF | IP_OFFSET) ||
- ip2->frag_off & htons(IP_MF | IP_OFFSET))
- return ip1->id == ip2->id;
-
- poff = proto_ports_offset(ip1->protocol);
- if (poff < 0)
- return true;
- else {
- const u32 *ports1, *ports2;
-
- ports1 = (__force u32 *) (skb1->data + off1
- + ip1->ihl * 4 + poff);
- ports2 = (__force u32 *) (skb2->data + off2
- + ip2->ihl * 4 + poff);
-
- return *ports1 == *ports2;
- }
+ if ((ip1->frag_off | ip2->frag_off) & htons(IP_MF | IP_OFFSET))
+ ip_proto = 0;
+ off1 += ip1->ihl * 4;
+ off2 += ip2->ihl * 4;
break;
}
@@ -239,15 +187,32 @@ static bool choke_match_flow(const struct sk_buff *skb1,
ip1 = (struct ipv6hdr *) (skb1->data + off1);
ip2 = (struct ipv6hdr *) (skb2->data + off2);
- return (ip1->nexthdr == ip2->nexthdr &&
- ipv6_addr_cmp(&ip1->saddr, &ip2->saddr) == 0 &&
- ipv6_addr_cmp(&ip1->daddr, &ip2->daddr) == 0);
+ ip_proto = ip1->nexthdr;
+ if (ip_proto != ip2->nexthdr ||
+ ipv6_addr_cmp(&ip1->saddr, &ip2->saddr) ||
+ ipv6_addr_cmp(&ip1->daddr, &ip2->daddr))
+ return false;
+ off1 += 40;
+ off2 += 40;
}
default: /* Maybe compare MAC header here? */
return false;
}
- /* not reached */
+ poff = proto_ports_offset(ip_proto);
+ if (poff < 0)
+ return true;
+ off1 += poff;
+ off2 += poff;
+ if (!pskb_may_pull(skb1, off1 + 4))
+ return false;
+
+ if (!pskb_may_pull(skb2, off2 + 4))
+ return false;
+
+ ports1 = (__force u32 *)(skb1->data + off1);
+ ports2 = (__force u32 *)(skb2->data + off2);
+ return *ports1 == *ports2;
}
static inline void choke_set_classid(struct sk_buff *skb, u16 classid)
@@ -319,10 +284,10 @@ static struct sk_buff *choke_peek_random(const struct choke_sched_data *q,
* returns true if matched and sets *pidx
*/
static bool choke_match_random(const struct choke_sched_data *q,
- const struct sk_buff *nskb,
+ struct sk_buff *nskb,
unsigned int *pidx)
{
- const struct sk_buff *oskb;
+ struct sk_buff *oskb;
if (q->head == q->tail)
return false;
@@ -331,7 +296,6 @@ static bool choke_match_random(const struct choke_sched_data *q,
if (q->filter_list)
return choke_get_classid(nskb) == choke_get_classid(oskb);
-
return choke_match_flow(oskb, nskb);
}
@@ -345,10 +309,6 @@ static int choke_enqueue(struct sk_buff *skb, struct Qdisc *sch)
/* If using external classifiers, get result and record it. */
if (!choke_classify(skb, sch, &ret))
goto other_drop; /* Packet was eaten by filter */
- } else {
- /* for internal classifier, make header accessible */
- if (!choke_linearize_header(skb))
- goto other_drop;
}
/* Compute average queue usage (see RED) */
^ permalink raw reply related
* Re: [GIT] Networking
From: Colin Walters @ 2011-01-20 22:38 UTC (permalink / raw)
To: Linus Torvalds; +Cc: Eric Dumazet, David Miller, akpm, netdev, linux-kernel
In-Reply-To: <AANLkTikLY1B3=C2TjAbYKVHbub-aPeG2heaUBWRUAg=R@mail.gmail.com>
On Thu, Jan 20, 2011 at 5:21 PM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> On Thu, Jan 20, 2011 at 1:40 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>
>> Then here ask for fd=3 both POLLIN and POLLOUT :
>> kernel answers : OK for POLLOUT (not POLLIN), so previous poll() call
>> was OK to be blocked after all...
>>
>> So I'm wondering if it could be a userland bug, that triggers with
>> recent kernel changes.
>
> As far as I can tell, that program isn't multi-threaded
It is actually; see src/gs-auth-pam.c; there is some pretty scary code
there; basically all of PAM is put in a thread to avoid blocking the
mainloop. Whether the code is actually buggy I can't say immediately;
it's certainly possible.
^ 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