* Re: [PATCH] b44: remove unused dma_desc_align_mask
From: David Miller @ 2010-07-08 1:25 UTC (permalink / raw)
To: fujita.tomonori; +Cc: netdev, zambrano
In-Reply-To: <20100708095537B.fujita.tomonori@lab.ntt.co.jp>
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Date: Thu, 8 Jul 2010 09:55:58 +0900
>
> Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Applied, thanks.
^ permalink raw reply
* Re: linux-next: build warning after merge of the net tree
From: David Miller @ 2010-07-08 1:23 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, jonas
In-Reply-To: <20100707143045.0c472f5d.sfr@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 7 Jul 2010 14:30:45 +1000
> Hi Dave,
>
> After merging the net tree, today's linux-next build (x86_64
> allmodconfig) produced this warning:
>
> drivers/net/ethoc.c: In function 'ethoc_init_ring':
> drivers/net/ethoc.c:302: warning: assignment makes integer from pointer without a cast
>
> Introduced by commit f8555ad0cfb0ba6cbc8729f337341fb11c82db89 ("ethoc:
> Write bus addresses to registers").
I'll fix this as follows:
--------------------
ethoc: Fix warning in ethoc_init_ring().
Get rid of the pointless back-and-forth casting of dev->mem_start
from long to pointer back to long again.
Also fixes a warning reported by Stephen Rothwell:
drivers/net/ethoc.c: In function 'ethoc_init_ring':
drivers/net/ethoc.c:302: warning: assignment makes integer from pointer without a cast
Signed-off-by: David S. Miller <davem@davemloft.net>
---
drivers/net/ethoc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/net/ethoc.c b/drivers/net/ethoc.c
index db519a8..5bb6bb7 100644
--- a/drivers/net/ethoc.c
+++ b/drivers/net/ethoc.c
@@ -286,7 +286,7 @@ static inline void ethoc_disable_rx_and_tx(struct ethoc *dev)
ethoc_write(dev, MODER, mode);
}
-static int ethoc_init_ring(struct ethoc *dev, void* mem_start)
+static int ethoc_init_ring(struct ethoc *dev, unsigned long mem_start)
{
struct ethoc_bd bd;
int i;
@@ -670,7 +670,7 @@ static int ethoc_open(struct net_device *dev)
if (ret)
return ret;
- ethoc_init_ring(priv, (void*)dev->mem_start);
+ ethoc_init_ring(priv, dev->mem_start);
ethoc_reset(priv);
if (netif_queue_stopped(dev)) {
--
1.7.1.1
^ permalink raw reply related
* Re: linux-next: build warning after merge of the net tree
From: David Miller @ 2010-07-08 1:18 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, joe, gregkh
In-Reply-To: <20100707.174522.148565561.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Wed, 07 Jul 2010 17:45:22 -0700 (PDT)
> From: Stephen Rothwell <sfr@canb.auug.org.au>
> Date: Tue, 6 Jul 2010 14:25:42 +1000
>
>> After merging the net tree, today's linux-next build (powerpc
>> ppc64_defconfig) produced these warnings:
>>
>> drivers/scsi/sym53c8xx_2/sym_hipd.c: In function 'sym_print_msg':
>> drivers/scsi/sym53c8xx_2/sym_hipd.c:78: warning: zero-length gnu_printf format string
>
> Thanks Stephen I'll look into this.
Yeah this is a bit ugly.
It used to be that the dev_*() format string was CPP pasted to whatever
format string the user gave. So if the user gave an empty string it
still looked like a non-empty printf string.
But that no longer happens because we hide the implementation, and thus
the top-level printf format string, in the external functions.
It seems the construction:
/*
* Stupid hackaround for existing uses of non-printk uses dev_info
*
* Note that the definition of dev_info below is actually _dev_info
* and a macro is used to avoid redefining dev_info
*/
#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
added to linux/device.h was meant to handle these cases, but as we see
it doesn't.
It looks like there are just a hand-ful of cases, so maybe we can tweak
them by hand. For example, in the sym53c8xx_2 driver bits we can replace
the NULL labels passed to sym_print_msg() with a real string and therefore
remove the "" case.
Joe, any better ideas?
^ permalink raw reply
* [PATCH] b44: remove unused dma_desc_align_mask
From: FUJITA Tomonori @ 2010-07-08 0:55 UTC (permalink / raw)
To: netdev; +Cc: zambrano
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
drivers/net/b44.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/net/b44.c b/drivers/net/b44.c
index 3d52538..37617ab 100644
--- a/drivers/net/b44.c
+++ b/drivers/net/b44.c
@@ -135,7 +135,6 @@ static void b44_init_rings(struct b44 *);
static void b44_init_hw(struct b44 *, int);
-static int dma_desc_align_mask;
static int dma_desc_sync_size;
static int instance;
@@ -2340,7 +2339,6 @@ static int __init b44_init(void)
int err;
/* Setup paramaters for syncing RX/TX DMA descriptors */
- dma_desc_align_mask = ~(dma_desc_align_size - 1);
dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, sizeof(struct dma_desc));
err = b44_pci_init();
--
1.6.5
^ permalink raw reply related
* Re: linux-next: build warning after merge of the net tree
From: David Miller @ 2010-07-08 0:45 UTC (permalink / raw)
To: sfr; +Cc: netdev, linux-next, linux-kernel, joe, gregkh
In-Reply-To: <20100706142542.d723903f.sfr@canb.auug.org.au>
From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Tue, 6 Jul 2010 14:25:42 +1000
> After merging the net tree, today's linux-next build (powerpc
> ppc64_defconfig) produced these warnings:
>
> drivers/scsi/sym53c8xx_2/sym_hipd.c: In function 'sym_print_msg':
> drivers/scsi/sym53c8xx_2/sym_hipd.c:78: warning: zero-length gnu_printf format string
Thanks Stephen I'll look into this.
^ permalink raw reply
* Re: [RFC PATCH]: Fix a warning in the niu driver
From: David Miller @ 2010-07-08 0:08 UTC (permalink / raw)
To: prarit; +Cc: netdev
In-Reply-To: <4C3514ED.2060904@redhat.com>
From: Prarit Bhargava <prarit@redhat.com>
Date: Wed, 07 Jul 2010 19:59:41 -0400
> This is an RFC to fix the mismatch compile warning in the niu driver.
>
> drivers/net/niu.c: In function 'niu_process_rx_pkt':
> drivers/net/niu.c:3490: warning: 'link' may be used uninitialized in this function
>
> AFAICT, link is unused. It is set in several places but never consumed by
> any code. Additionally, the value of page is unchecked in the functions that
> call niu_find_rx_page(). This could lead to a NULL pointer. However, in
> both cases it seems like if !page then the rx ring is corrupt. I *think* a
> BUG() is appropriate, but one of you may have a better suggestion as to
> what to do in that case. Maybe leaving the while loops with a break?
>
> Checking for !page is probably overkill -- maybe the fix is to just remove
> link?
>
> Any suggestions or advice is appreciated,
You completely removed the unlinking of the page from the hash chain
list.
That's the side effect you're missing.
niu_rx_pkt_ignore() {
...
page = niu_find_rxpage(rp, addr, &link);
...
*link = (struct page *) page->mapping;
...
}
niu_process_rx_pkt() {
...
page = niu_find_rxpage(rp, addr, &link);
...
*link = (struct page *) page->mapping;
...
}
Your patch would corrupt the list state, since we'd leave
pages in the rx page hash which have only externally references
and thus will be freed up.
Just BUG() if the loop terminates without finding a page.
--------------------
niu: BUG on inability to find page in rx page hashes.
Signed-off-by: David S. Miller <davem@davemloft.net>
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 3d523cb..5d36531 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -3330,10 +3330,12 @@ static struct page *niu_find_rxpage(struct rx_ring_info *rp, u64 addr,
for (; (p = *pp) != NULL; pp = (struct page **) &p->mapping) {
if (p->index == addr) {
*link = pp;
- break;
+ goto found;
}
}
+ BUG();
+found:
return p;
}
@@ -3417,7 +3419,6 @@ static int niu_rx_pkt_ignore(struct niu *np, struct rx_ring_info *rp)
addr = (val & RCR_ENTRY_PKT_BUF_ADDR) <<
RCR_ENTRY_PKT_BUF_ADDR_SHIFT;
page = niu_find_rxpage(rp, addr, &link);
-
rcr_size = rp->rbr_sizes[(val & RCR_ENTRY_PKTBUFSZ) >>
RCR_ENTRY_PKTBUFSZ_SHIFT];
if ((page->index + PAGE_SIZE) - rcr_size == addr) {
^ permalink raw reply related
* [RFC PATCH]: Fix a warning in the niu driver
From: Prarit Bhargava @ 2010-07-07 23:59 UTC (permalink / raw)
To: netdev; +Cc: davem
This is an RFC to fix the mismatch compile warning in the niu driver.
drivers/net/niu.c: In function 'niu_process_rx_pkt':
drivers/net/niu.c:3490: warning: 'link' may be used uninitialized in this function
AFAICT, link is unused. It is set in several places but never consumed by
any code. Additionally, the value of page is unchecked in the functions that
call niu_find_rx_page(). This could lead to a NULL pointer. However, in
both cases it seems like if !page then the rx ring is corrupt. I *think* a
BUG() is appropriate, but one of you may have a better suggestion as to
what to do in that case. Maybe leaving the while loops with a break?
Checking for !page is probably overkill -- maybe the fix is to just remove
link?
Any suggestions or advice is appreciated,
P.
diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 961b9ea..8f2251d 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -3353,19 +3353,17 @@ static unsigned int niu_hash_rxaddr(struct rx_ring_info *rp, u64 a)
return (a & (MAX_RBR_RING_SIZE - 1));
}
-static struct page *niu_find_rxpage(struct rx_ring_info *rp, u64 addr,
- struct page ***link)
+static struct page *niu_find_rxpage(struct rx_ring_info *rp, u64 addr)
{
unsigned int h = niu_hash_rxaddr(rp, addr);
- struct page *p, **pp;
+ struct page *p = NULL;
+ struct page **pp;
addr &= PAGE_MASK;
pp = &rp->rxhash[h];
for (; (p = *pp) != NULL; pp = (struct page **) &p->mapping) {
- if (p->index == addr) {
- *link = pp;
+ if (p->index == addr)
break;
- }
}
return p;
@@ -3441,7 +3439,7 @@ static int niu_rx_pkt_ignore(struct niu *np, struct rx_ring_info *rp)
rp->rx_dropped++;
while (1) {
- struct page *page, **link;
+ struct page *page;
u64 addr, val;
u32 rcr_size;
@@ -3450,12 +3448,12 @@ static int niu_rx_pkt_ignore(struct niu *np, struct rx_ring_info *rp)
val = le64_to_cpup(&rp->rcr[index]);
addr = (val & RCR_ENTRY_PKT_BUF_ADDR) <<
RCR_ENTRY_PKT_BUF_ADDR_SHIFT;
- page = niu_find_rxpage(rp, addr, &link);
+ page = niu_find_rxpage(rp, addr);
+ BUG_ON(!page); /* page cannot be NULL, rx_ring is corrupt */
rcr_size = rp->rbr_sizes[(val & RCR_ENTRY_PKTBUFSZ) >>
RCR_ENTRY_PKTBUFSZ_SHIFT];
if ((page->index + PAGE_SIZE) - rcr_size == addr) {
- *link = (struct page *) page->mapping;
np->ops->unmap_page(np->device, page->index,
PAGE_SIZE, DMA_FROM_DEVICE);
page->index = 0;
@@ -3487,7 +3485,7 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
num_rcr = 0;
while (1) {
- struct page *page, **link = NULL;
+ struct page *page;
u32 rcr_size, append_size;
u64 addr, val, off;
@@ -3501,7 +3499,8 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
addr = (val & RCR_ENTRY_PKT_BUF_ADDR) <<
RCR_ENTRY_PKT_BUF_ADDR_SHIFT;
- page = niu_find_rxpage(rp, addr, &link);
+ page = niu_find_rxpage(rp, addr);
+ BUG_ON(!page); /* page cannot be NULL, rx_ring is corrupt */
rcr_size = rp->rbr_sizes[(val & RCR_ENTRY_PKTBUFSZ) >>
RCR_ENTRY_PKTBUFSZ_SHIFT];
@@ -3528,7 +3527,6 @@ static int niu_process_rx_pkt(struct napi_struct *napi, struct niu *np,
niu_rx_skb_append(skb, page, off, append_size);
if ((page->index + rp->rbr_block_size) - rcr_size == addr) {
- *link = (struct page *) page->mapping;
np->ops->unmap_page(np->device, page->index,
PAGE_SIZE, DMA_FROM_DEVICE);
page->index = 0;
^ permalink raw reply related
* RE: [PATCH] ixgbe: fix crashing with ixgbe_vlan_filter_enable
From: Tantilov, Emil S @ 2010-07-07 23:31 UTC (permalink / raw)
To: Yinghai Lu, David Miller, Brandeburg, Jesse; +Cc: NetDev
In-Reply-To: <4C350991.6080002@kernel.org>
Yinghai Lu wrote:
> happens with reboot or call kexec on system with ixgbe.
>
> [ 4912.773390] BUG: unable to handle kernel NULL pointer dereference
> [ 4912.785756] IP: [<ffffffff81691600>]
> ixgbe_vlan_filter_enable+0x74/0xda [ 4912.794084] PGD 10391a0067 PUD
> 1022e3c067 PMD 0 [ 4912.805976] Oops: 0000 [#1] SMP
> [ 4912.809312] last sysfs file:
> /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/host4/target4:2:0/4:2:0:0/vendor
> [ 4912.828965] CPU 1 [ 4912.830533] Modules linked in:
> [ 4912.834366]
> [ 4912.835288] Pid: 25366, comm: reboot Not tainted
> 2.6.34-rc4-tip-yh-04420-g4537151-dirty #70 [ 4912.854250] RIP:
> 0010:[<ffffffff81691600>] [<ffffffff81691600>]
> ixgbe_vlan_filter_enable+0x74/0xda [ 4912.870439] RSP:
> 0018:ffff88203de49d08 EFLAGS: 00010287 [ 4912.885521] RAX:
> 0000000000000000 RBX: ffff88703d5d8900 RCX: ffff88703d5d8900 [
> 4912.896225] RDX: 0000000000000000 RSI: 0000000000000040 RDI:
> ffff88703d5d8900 [ 4912.908265] RBP: ffff88203de49d08 R08:
> ffffc90047280000 R09: ffff88203de49b98 [ 4912.915174] R10:
> 0000000000000000 R11: ffff88203de49d38 R12: ffff88703d5d8000 [
> 4912.936333] R13: ffff88703d5d9e80 R14: 0000000000000000 R15:
> 0000000000000000 [ 4912.947284] FS: 00007f91db5a36f0(0000)
> GS:ffff880079e00000(0000) knlGS:0000000000000000 [ 4912.965019] CS:
> 0010 DS: 0000 ES: 0000 CR0: 000000008005003b [ 4912.970282] CR2:
> 000000000000002e CR3: 0000001021d27000 CR4: 00000000000006e0 [
> 4912.986573] DR0: 0000000000000000 DR1: 0000000000000000 DR2:
> 0000000000000000 [ 4912.997240] DR3: 0000000000000000 DR6:
> 00000000ffff0ff0 DR7: 0000000000000400 [ 4913.012609] Process reboot
> (pid: 25366, threadinfo ffff88203de48000, task ffff88203d902340) [
> 4913.028237] Stack: [ 4913.030121] ffff88203de49d38 ffffffff81697d16
> ffff88703d5d8900 ffff88503ed00000 [ 4913.045165] <0> 000000000000001e
> ffff88703d5d8000 ffff88203de49d98 ffffffff81697e46 [ 4913.053297] <0>
> ffff88203d902340 ffffffff81bd9fc4 ffff88203de49db7 0000000000000000 [
> 4913.070554] Call Trace: [ 4913.074948] [<ffffffff81697d16>]
> ixgbe_set_rx_mode+0x137/0x17e [ 4913.086386] [<ffffffff81697e46>]
> __ixgbe_shutdown+0xe9/0x1a6 [ 4913.092895] [<ffffffff81bd9fc4>] ?
> _raw_spin_unlock_irq+0x30/0x36 [ 4913.108970] [<ffffffff81697f1d>]
> ixgbe_shutdown+0x1a/0x43 [ 4913.113514] [<ffffffff813e3bea>]
> pci_device_shutdown+0x2c/0x40 [ 4913.128080] [<ffffffff81489e25>]
> device_shutdown+0x53/0x74 [ 4913.135736] [<ffffffff8108dd91>]
> kernel_restart_prepare+0x2c/0x33 [ 4913.147206] [<ffffffff8108dddb>]
> kernel_restart+0x16/0x48 [ 4913.154807] [<ffffffff8108df6f>]
> sys_reboot+0x150/0x196 [ 4913.167525] [<ffffffff810a4891>] ?
> trace_hardirqs_on+0xd/0xf [ 4913.175020] [<ffffffff811430c2>] ?
> mntput_no_expire+0x2c/0xf5 [ 4913.191952] [<ffffffff8112da8c>] ?
> __fput+0x1d8/0x1e7 [ 4913.197452] [<ffffffff81033b8c>] ?
> sysret_check+0x27/0x62 [ 4913.207708] [<ffffffff81bd9472>] ?
> trace_hardirqs_on_thunk+0x3a/0x3f [ 4913.212377]
> [<ffffffff81033b5b>] system_call_fastpath+0x16/0x1b [ 4913.230877]
> Code: 00 00 00 40 48 8b 97 80 15 00 00 25 ff ff ff df 89 82 88 50 00
> 00 31 d2 48 89 f9 eb 6a 48 8b 81 40 0e 00 00 4c 8b 87 80 15 00 00
> <0f> b7 40 2e 83 f8 3f 7f 0d 89 c6 c1 e6 06 81 c6 28 10 00 00 eb [
> 4913.268163] RIP [<ffffffff81691600>]
> ixgbe_vlan_filter_enable+0x74/0xda [ 4913.273435] RSP
> <ffff88203de49d08> [ 4913.285451] CR2: 000000000000002e [
> 4913.290668] ---[ end trace 0aaa048b0b730b65 ]---
>
> add checking before reference them.
>
> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
There should be a patch in net-2.6 that fixes this issue:
http://git.kernel.org/?p=linux/kernel/git/davem/net-2.6.git;a=commitdiff;h=fa37813401ff52d78591c262d6542e4d5d935584
Thanks,
Emil
^ permalink raw reply
* [PATCH] ixgbe: fix crashing with ixgbe_vlan_filter_enable
From: Yinghai Lu @ 2010-07-07 23:11 UTC (permalink / raw)
To: David Miller, Brandeburg, Jesse; +Cc: NetDev
happens with reboot or call kexec on system with ixgbe.
[ 4912.773390] BUG: unable to handle kernel NULL pointer dereference
[ 4912.785756] IP: [<ffffffff81691600>] ixgbe_vlan_filter_enable+0x74/0xda
[ 4912.794084] PGD 10391a0067 PUD 1022e3c067 PMD 0
[ 4912.805976] Oops: 0000 [#1] SMP
[ 4912.809312] last sysfs file: /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0/host4/target4:2:0/4:2:0:0/vendor
[ 4912.828965] CPU 1
[ 4912.830533] Modules linked in:
[ 4912.834366]
[ 4912.835288] Pid: 25366, comm: reboot Not tainted 2.6.34-rc4-tip-yh-04420-g4537151-dirty #70
[ 4912.854250] RIP: 0010:[<ffffffff81691600>] [<ffffffff81691600>] ixgbe_vlan_filter_enable+0x74/0xda
[ 4912.870439] RSP: 0018:ffff88203de49d08 EFLAGS: 00010287
[ 4912.885521] RAX: 0000000000000000 RBX: ffff88703d5d8900 RCX: ffff88703d5d8900
[ 4912.896225] RDX: 0000000000000000 RSI: 0000000000000040 RDI: ffff88703d5d8900
[ 4912.908265] RBP: ffff88203de49d08 R08: ffffc90047280000 R09: ffff88203de49b98
[ 4912.915174] R10: 0000000000000000 R11: ffff88203de49d38 R12: ffff88703d5d8000
[ 4912.936333] R13: ffff88703d5d9e80 R14: 0000000000000000 R15: 0000000000000000
[ 4912.947284] FS: 00007f91db5a36f0(0000) GS:ffff880079e00000(0000) knlGS:0000000000000000
[ 4912.965019] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[ 4912.970282] CR2: 000000000000002e CR3: 0000001021d27000 CR4: 00000000000006e0
[ 4912.986573] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[ 4912.997240] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[ 4913.012609] Process reboot (pid: 25366, threadinfo ffff88203de48000, task ffff88203d902340)
[ 4913.028237] Stack:
[ 4913.030121] ffff88203de49d38 ffffffff81697d16 ffff88703d5d8900 ffff88503ed00000
[ 4913.045165] <0> 000000000000001e ffff88703d5d8000 ffff88203de49d98 ffffffff81697e46
[ 4913.053297] <0> ffff88203d902340 ffffffff81bd9fc4 ffff88203de49db7 0000000000000000
[ 4913.070554] Call Trace:
[ 4913.074948] [<ffffffff81697d16>] ixgbe_set_rx_mode+0x137/0x17e
[ 4913.086386] [<ffffffff81697e46>] __ixgbe_shutdown+0xe9/0x1a6
[ 4913.092895] [<ffffffff81bd9fc4>] ? _raw_spin_unlock_irq+0x30/0x36
[ 4913.108970] [<ffffffff81697f1d>] ixgbe_shutdown+0x1a/0x43
[ 4913.113514] [<ffffffff813e3bea>] pci_device_shutdown+0x2c/0x40
[ 4913.128080] [<ffffffff81489e25>] device_shutdown+0x53/0x74
[ 4913.135736] [<ffffffff8108dd91>] kernel_restart_prepare+0x2c/0x33
[ 4913.147206] [<ffffffff8108dddb>] kernel_restart+0x16/0x48
[ 4913.154807] [<ffffffff8108df6f>] sys_reboot+0x150/0x196
[ 4913.167525] [<ffffffff810a4891>] ? trace_hardirqs_on+0xd/0xf
[ 4913.175020] [<ffffffff811430c2>] ? mntput_no_expire+0x2c/0xf5
[ 4913.191952] [<ffffffff8112da8c>] ? __fput+0x1d8/0x1e7
[ 4913.197452] [<ffffffff81033b8c>] ? sysret_check+0x27/0x62
[ 4913.207708] [<ffffffff81bd9472>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[ 4913.212377] [<ffffffff81033b5b>] system_call_fastpath+0x16/0x1b
[ 4913.230877] Code: 00 00 00 40 48 8b 97 80 15 00 00 25 ff ff ff df 89 82 88 50 00 00 31 d2 48 89 f9 eb 6a 48 8b 81 40 0e 00 00 4c 8b 87 80 15 00 00 <0f> b7 40 2e 83 f8 3f 7f 0d 89 c6 c1 e6 06 81 c6 28 10 00 00 eb
[ 4913.268163] RIP [<ffffffff81691600>] ixgbe_vlan_filter_enable+0x74/0xda
[ 4913.273435] RSP <ffff88203de49d08>
[ 4913.285451] CR2: 000000000000002e
[ 4913.290668] ---[ end trace 0aaa048b0b730b65 ]---
add checking before reference them.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
drivers/net/ixgbe/ixgbe_main.c | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
Index: linux-2.6/drivers/net/ixgbe/ixgbe_main.c
===================================================================
--- linux-2.6.orig/drivers/net/ixgbe/ixgbe_main.c
+++ linux-2.6/drivers/net/ixgbe/ixgbe_main.c
@@ -2915,7 +2915,13 @@ static void ixgbe_vlan_filter_disable(st
break;
#endif
for (i = 0; i < adapter->num_rx_queues; i++) {
- j = adapter->rx_ring[i]->reg_idx;
+ struct ixgbe_ring *rx_ring;
+
+ rx_ring = adapter->rx_ring[i];
+ if (!rx_ring)
+ continue;
+
+ j = rx_ring->reg_idx;
vlnctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(j));
vlnctrl &= ~IXGBE_RXDCTL_VME;
IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(j), vlnctrl);
@@ -2947,7 +2953,13 @@ static void ixgbe_vlan_filter_enable(str
vlnctrl &= ~IXGBE_VLNCTRL_CFIEN;
IXGBE_WRITE_REG(hw, IXGBE_VLNCTRL, vlnctrl);
for (i = 0; i < adapter->num_rx_queues; i++) {
- j = adapter->rx_ring[i]->reg_idx;
+ struct ixgbe_ring *rx_ring;
+
+ rx_ring = adapter->rx_ring[i];
+ if (!rx_ring)
+ continue;
+
+ j = rx_ring->reg_idx;
vlnctrl = IXGBE_READ_REG(hw, IXGBE_RXDCTL(j));
vlnctrl |= IXGBE_RXDCTL_VME;
IXGBE_WRITE_REG(hw, IXGBE_RXDCTL(j), vlnctrl);
^ permalink raw reply
* Re: [PATCH] net/ipv4/ip_output.c: Removal of unused variable in ip_fragment()
From: David Miller @ 2010-07-07 22:45 UTC (permalink / raw)
To: desnacked; +Cc: netdev, linux-kernel
In-Reply-To: <874ogctheb.fsf@gmail.com>
From: George Kadianakis <desnacked@gmail.com>
Date: Wed, 07 Jul 2010 00:44:12 +0300
> From: George Kadianakis <desnacked@gmail.com>
>
> Removal of unused integer variable in ip_fragment().
>
> Signed-off-by: George Kadianakis <desnacked@gmail.com>
Applied.
^ permalink raw reply
* Re: [PATCH] net: sh_eth: add support for SH7757's ETHER
From: David Miller @ 2010-07-07 22:45 UTC (permalink / raw)
To: yoshihiro.shimoda.uh; +Cc: netdev, linux-sh
In-Reply-To: <4C32B1F2.4040106@renesas.com>
From: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Date: Tue, 06 Jul 2010 13:32:50 +0900
> The SH7757 has 2 Fast Ethernet controller (ETHER) and 2 Gigabit Ethernet
> Controller (GETHER). This patch supports 2 ETHER only.
>
> Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Applied to net-next-2.6, thanks.
^ permalink raw reply
* Re: [net-next PATCH] bnx2x: Set RXHASH for LRO packets
From: David Miller @ 2010-07-07 22:45 UTC (permalink / raw)
To: vladz; +Cc: netdev, eilong
In-Reply-To: <1278425383.22257.4.camel@lb-tlvb-vladz>
From: "Vladislav Zolotarov" <vladz@broadcom.com>
Date: Tue, 6 Jul 2010 17:09:43 +0300
> Set Toeplitz hash both for LRO and none-LRO skbs.
> The first CQE (TPA_START) will contain a hash for an LRO packet.
>
> Current code sets skb->rx_hash for none-LRO skbs only.
>
> Signed-off-by: Vladislav Zolotarov <vladz@broadcom.com>
> Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Applied.
^ permalink raw reply
* Re: [PATCH net-next-2.6 V2] net: fix 64 bit counters on 32 bit arches
From: David Miller @ 2010-07-07 22:41 UTC (permalink / raw)
To: eric.dumazet; +Cc: bhutchings, shemminger, arnd, netdev, linux-net-drivers
In-Reply-To: <20100707.143645.135512197.davem@davemloft.net>
From: David Miller <davem@davemloft.net>
Date: Wed, 07 Jul 2010 14:36:45 -0700 (PDT)
> From: Eric Dumazet <eric.dumazet@gmail.com>
> Date: Mon, 05 Jul 2010 22:05:22 +0200
>
>> [PATCH net-next-2.6 V2] net: fix 64 bit counters on 32 bit arches
Some dev_get_stats() conversions were missing, such as parisc/led,
some s390 code, usb rndis, etc.
I took care of this when integrating this patch.
^ permalink raw reply
* Re: [PATCH v3 0/9] atm: propagate atm_dev signal carrier to LOWER_UP of netdevice
From: David Miller @ 2010-07-07 22:07 UTC (permalink / raw)
To: karl; +Cc: linux-atm-general, netdev, chas
In-Reply-To: <1278492636-11094-1-git-send-email-karl@hiramoto.org>
From: Karl Hiramoto <karl@hiramoto.org>
Date: Wed, 7 Jul 2010 10:50:27 +0200
> Changes from v2:
> * use atomic instead of blocking notifier
> * use read_lock_irq() instead of read_lock() in atm/br2684
> * clean up comments
> * remove unused variable. I feel really bad about missing that last time.
>
> Changes from v1:
> Use atm_dev notifier chain instead of callback function pointer in struct vcc.
> In drivers/usb/atm call atm_dev_signal_change().
>
> In userspace it's helpful to know if a network device has a carrier signal.
> Often it is monitored via netlink. This patchset allows a way for the
> struct atm_dev drivers to pass carrier on/off to the netdevice.
>
> For DSL, carrier is on when the line has reached showtime state.
>
> Currently this patchset only propagates the changes to br2684 vccs,
> as this is the only type of hardware I have to test.
>
> If you prefer git you can pull from:
> git://github.com/karlhiramoto/linux-2.6.git atm-v3
I think the locking still needs another tweak.
By using read_lock_irq() you are assuming that you are invoked
from a context where irqs are disabled.
That's not necessarily the case, in fact some of your notifier call
sites in the drivers are in interrupt handlers where interrupts may or
may not be disabled.
So you'll likely need to use read_lock_irqsave() and read_lock_irqrestore().
Next, please format comments:
/* Like
* this.
*/
Thanks.
^ permalink raw reply
* Re: NET: SB1250: Initialize .owner
From: David Miller @ 2010-07-07 22:01 UTC (permalink / raw)
To: ralf; +Cc: netdev, linux-mips, macro
In-Reply-To: <20100706151811.GA4829@linux-mips.org>
From: Ralf Baechle <ralf@linux-mips.org>
Date: Tue, 6 Jul 2010 16:18:11 +0100
> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Applied, thanks Ralf.
^ permalink raw reply
* Re: [PATCH] vxge: show startup message with KERN_INFO
From: David Miller @ 2010-07-07 21:52 UTC (permalink / raw)
To: jon.mason; +Cc: fengguang.wu, Sreenivasa.Honnur, netdev
In-Reply-To: <20100706160824.GA31635@exar.com>
From: Jon Mason <jon.mason@exar.com>
Date: Tue, 6 Jul 2010 11:08:25 -0500
> On Tue, Jul 06, 2010 at 06:02:03AM -0700, Wu Fengguang wrote:
>> The original KERN_CRIT will mess up terminals.
>
> Looks reasonable to me.
...
>> CC: Sreenivasa Honnur <Sreenivasa.Honnur@neterion.com>
>> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Applied, thanks.
^ permalink raw reply
* Re: [PATCH kernel 2.6.35-rc3-git7] axnet_cs: local_irq_save before calling ei_irq_wrapper
From: David Miller @ 2010-07-07 21:51 UTC (permalink / raw)
To: ken_kawasaki; +Cc: netdev
In-Reply-To: <20100706202243.95319ab4.ken_kawasaki@spring.nifty.jp>
From: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
Date: Tue, 6 Jul 2010 20:22:43 +0900
>
> axnet_cs:
> local_irq_save before calling ei_irq_wrapper.
>
>
> Signed-off-by: Ken Kawasaki <ken_kawasaki@spring.nifty.jp>
An interrupt handler may not assume that interrupts are disabled when
it is invoked.
The axnet_interrupt() code needs to be fixed to use
spin_lock_irqsave() et al.
Then, this change of your's is no longer needed.
^ permalink raw reply
* Re: [PATCH -net-2.6] ll_temac: Fix missing iounmaps
From: David Miller @ 2010-07-07 21:48 UTC (permalink / raw)
To: dkirjanov; +Cc: john.linn, brian.hill, netdev
In-Reply-To: <20100706074420.GA15451@hera.kernel.org>
From: Denis Kirjanov <dkirjanov@kernel.org>
Date: Tue, 6 Jul 2010 07:44:20 +0000
> Fix missing iounmaps.
>
> Signed-off-by: Denis Kirjanov <dkirjanov@kernel.org>
Applied, thanks.
^ permalink raw reply
* Re: Possible bug in net/ipv4/route.c?
From: David Miller @ 2010-07-07 21:46 UTC (permalink / raw)
To: herbert
Cc: gjin, shemminger, skavy, linux-kernel, gren, msezgin, silgen,
netdev
In-Reply-To: <20100706072928.GB14612@gondor.apana.org.au>
From: Herbert Xu <herbert@gondor.apana.org.au>
Date: Tue, 6 Jul 2010 15:29:28 +0800
> bridge: Clear IPCB before possible entry into IP stack
>
> The bridge protocol lives dangerously by having incestuous relations
> with the IP stack. In this instance an abomination has been created
> where a bogus IPCB area from a bridged packet leads to a crash in
> the IP stack because it's interpreted as IP options.
>
> This patch papers over the problem by clearing the IPCB area in that
> particular spot. To fix this properly we'd also need to parse any
> IP options if present but I'm way too lazy for that.
>
> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Applied, thanks a lot!
^ permalink raw reply
* [PATCH 14/18] irda/irnet: use noop_llseek
From: Arnd Bergmann @ 2010-07-07 21:40 UTC (permalink / raw)
To: linux-kernel
Cc: John Kacur, Frederic Weisbecker, Arnd Bergmann, Christoph Hellwig,
Samuel Ortiz, netdev
In-Reply-To: <1278538820-1392-1-git-send-email-arnd@arndb.de>
There may be applications trying to seek
on the irnet character device, so we should
use noop_llseek to avoid returning an error
when the default llseek changes to no_llseek.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: netdev@vger.kernel.org
---
net/irda/irnet/irnet_ppp.h | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/net/irda/irnet/irnet_ppp.h b/net/irda/irnet/irnet_ppp.h
index b5df241..7b9949e 100644
--- a/net/irda/irnet/irnet_ppp.h
+++ b/net/irda/irnet/irnet_ppp.h
@@ -104,6 +104,7 @@ static const struct file_operations irnet_device_fops =
.unlocked_ioctl = dev_irnet_ioctl,
.open = dev_irnet_open,
.release = dev_irnet_close
+ .llseek = noop_llseek,
/* Also : llseek, readdir, mmap, flush, fsync, fasync, lock, readv, writev */
};
--
1.7.1
^ permalink raw reply related
* [PATCH 02/18] net/wireless: use generic_file_llseek in debugfs
From: Arnd Bergmann @ 2010-07-07 21:40 UTC (permalink / raw)
To: linux-kernel
Cc: John Kacur, Frederic Weisbecker, Arnd Bergmann, Christoph Hellwig,
John W. Linville, linux-wireless, netdev
In-Reply-To: <1278538820-1392-1-git-send-email-arnd@arndb.de>
The default llseek operation is changing from
default_llseek to no_llseek, so all code relying on
the current behaviour needs to make that explicit.
The wireless driver infrastructure and some of the drivers
make use of generated debugfs files, so they cannot
be converted by our script that automatically determines
the right operation.
All these files use debugfs and they typically rely
on simple_read_from_buffer, so the best llseek operation
here is generic_file_llseek.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org
Cc: netdev@vger.kernel.org
---
drivers/misc/iwmc3200top/debugfs.c | 3 +++
drivers/net/wireless/b43/debugfs.c | 1 +
drivers/net/wireless/b43legacy/debugfs.c | 1 +
drivers/net/wireless/iwlwifi/iwl-debugfs.c | 3 +++
drivers/net/wireless/libertas/debugfs.c | 1 +
drivers/net/wireless/rt2x00/rt2x00debug.c | 1 +
drivers/net/wireless/wl12xx/wl1251_debugfs.c | 2 ++
drivers/net/wireless/wl12xx/wl1271_debugfs.c | 2 ++
net/mac80211/debugfs.c | 2 ++
net/mac80211/debugfs_key.c | 2 ++
net/mac80211/debugfs_netdev.c | 1 +
net/mac80211/debugfs_sta.c | 2 ++
net/wireless/debugfs.c | 1 +
13 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/drivers/misc/iwmc3200top/debugfs.c b/drivers/misc/iwmc3200top/debugfs.c
index e9eda47..62fbaec 100644
--- a/drivers/misc/iwmc3200top/debugfs.c
+++ b/drivers/misc/iwmc3200top/debugfs.c
@@ -71,6 +71,7 @@ ssize_t iwmct_dbgfs_##name##_write(struct file *file, \
static const struct file_operations iwmct_dbgfs_##name##_ops = { \
.read = iwmct_dbgfs_##name##_read, \
.open = iwmct_dbgfs_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
#define DEBUGFS_WRITE_FILE_OPS(name) \
@@ -78,6 +79,7 @@ ssize_t iwmct_dbgfs_##name##_write(struct file *file, \
static const struct file_operations iwmct_dbgfs_##name##_ops = { \
.write = iwmct_dbgfs_##name##_write, \
.open = iwmct_dbgfs_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
#define DEBUGFS_READ_WRITE_FILE_OPS(name) \
@@ -87,6 +89,7 @@ ssize_t iwmct_dbgfs_##name##_write(struct file *file, \
.write = iwmct_dbgfs_##name##_write, \
.read = iwmct_dbgfs_##name##_read, \
.open = iwmct_dbgfs_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
diff --git a/drivers/net/wireless/b43/debugfs.c b/drivers/net/wireless/b43/debugfs.c
index 80b19a4..59f59fa 100644
--- a/drivers/net/wireless/b43/debugfs.c
+++ b/drivers/net/wireless/b43/debugfs.c
@@ -627,6 +627,7 @@ out_unlock:
.open = b43_debugfs_open, \
.read = b43_debugfs_read, \
.write = b43_debugfs_write, \
+ .llseek = generic_file_llseek, \
}, \
.file_struct_offset = offsetof(struct b43_dfsentry, \
file_##name), \
diff --git a/drivers/net/wireless/b43legacy/debugfs.c b/drivers/net/wireless/b43legacy/debugfs.c
index 1f85ac5..f232618 100644
--- a/drivers/net/wireless/b43legacy/debugfs.c
+++ b/drivers/net/wireless/b43legacy/debugfs.c
@@ -334,6 +334,7 @@ out_unlock:
.open = b43legacy_debugfs_open, \
.read = b43legacy_debugfs_read, \
.write = b43legacy_debugfs_write, \
+ .llseek = generic_file_llseek, \
}, \
.file_struct_offset = offsetof(struct b43legacy_dfsentry, \
file_##name), \
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 9659c5d..0d03cf2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -87,6 +87,7 @@ static int iwl_dbgfs_open_file_generic(struct inode *inode, struct file *file)
static const struct file_operations iwl_dbgfs_##name##_ops = { \
.read = iwl_dbgfs_##name##_read, \
.open = iwl_dbgfs_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
#define DEBUGFS_WRITE_FILE_OPS(name) \
@@ -94,6 +95,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \
static const struct file_operations iwl_dbgfs_##name##_ops = { \
.write = iwl_dbgfs_##name##_write, \
.open = iwl_dbgfs_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
@@ -104,6 +106,7 @@ static const struct file_operations iwl_dbgfs_##name##_ops = { \
.write = iwl_dbgfs_##name##_write, \
.read = iwl_dbgfs_##name##_read, \
.open = iwl_dbgfs_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
int iwl_dbgfs_statistics_flag(struct iwl_priv *priv, char *buf, int bufsz)
diff --git a/drivers/net/wireless/libertas/debugfs.c b/drivers/net/wireless/libertas/debugfs.c
index de2caac..94f8f99 100644
--- a/drivers/net/wireless/libertas/debugfs.c
+++ b/drivers/net/wireless/libertas/debugfs.c
@@ -713,6 +713,7 @@ out_unlock:
.open = open_file_generic, \
.read = (fread), \
.write = (fwrite), \
+ .llseek = generic_file_llseek, \
}
struct lbs_debugfs_files {
diff --git a/drivers/net/wireless/rt2x00/rt2x00debug.c b/drivers/net/wireless/rt2x00/rt2x00debug.c
index e9fe93f..fe92500 100644
--- a/drivers/net/wireless/rt2x00/rt2x00debug.c
+++ b/drivers/net/wireless/rt2x00/rt2x00debug.c
@@ -508,6 +508,7 @@ static const struct file_operations rt2x00debug_fop_##__name = {\
.write = rt2x00debug_write_##__name, \
.open = rt2x00debug_file_open, \
.release = rt2x00debug_file_release, \
+ .llseek = generic_file_llseek, \
};
RT2X00DEBUGFS_OPS(csr, "0x%.8x\n", u32);
diff --git a/drivers/net/wireless/wl12xx/wl1251_debugfs.c b/drivers/net/wireless/wl12xx/wl1251_debugfs.c
index 5e4465a..a4ae7c4 100644
--- a/drivers/net/wireless/wl12xx/wl1251_debugfs.c
+++ b/drivers/net/wireless/wl12xx/wl1251_debugfs.c
@@ -50,6 +50,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \
static const struct file_operations name## _ops = { \
.read = name## _read, \
.open = wl1251_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
#define DEBUGFS_ADD(name, parent) \
@@ -86,6 +87,7 @@ static ssize_t sub## _ ##name## _read(struct file *file, \
static const struct file_operations sub## _ ##name## _ops = { \
.read = sub## _ ##name## _read, \
.open = wl1251_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
#define DEBUGFS_FWSTATS_ADD(sub, name) \
diff --git a/drivers/net/wireless/wl12xx/wl1271_debugfs.c b/drivers/net/wireless/wl12xx/wl1271_debugfs.c
index c239ef4..6e25303 100644
--- a/drivers/net/wireless/wl12xx/wl1271_debugfs.c
+++ b/drivers/net/wireless/wl12xx/wl1271_debugfs.c
@@ -51,6 +51,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \
static const struct file_operations name## _ops = { \
.read = name## _read, \
.open = wl1271_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
#define DEBUGFS_ADD(name, parent) \
@@ -87,6 +88,7 @@ static ssize_t sub## _ ##name## _read(struct file *file, \
static const struct file_operations sub## _ ##name## _ops = { \
.read = sub## _ ##name## _read, \
.open = wl1271_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
#define DEBUGFS_FWSTATS_ADD(sub, name) \
diff --git a/net/mac80211/debugfs.c b/net/mac80211/debugfs.c
index 637929b..31b6b89 100644
--- a/net/mac80211/debugfs.c
+++ b/net/mac80211/debugfs.c
@@ -36,6 +36,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \
static const struct file_operations name## _ops = { \
.read = name## _read, \
.open = mac80211_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
#define DEBUGFS_ADD(name) \
@@ -349,6 +350,7 @@ static ssize_t stats_ ##name## _read(struct file *file, \
static const struct file_operations stats_ ##name## _ops = { \
.read = stats_ ##name## _read, \
.open = mac80211_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
#define DEBUGFS_STATS_ADD(name) \
diff --git a/net/mac80211/debugfs_key.c b/net/mac80211/debugfs_key.c
index 97c9e46..1bc39ac 100644
--- a/net/mac80211/debugfs_key.c
+++ b/net/mac80211/debugfs_key.c
@@ -32,6 +32,7 @@ static ssize_t key_##name##_read(struct file *file, \
static const struct file_operations key_ ##name## _ops = { \
.read = key_##name##_read, \
.open = mac80211_open_file_generic, \
+ .llseek = generic_file_llseek, \
}
#define KEY_FILE(name, format) \
@@ -46,6 +47,7 @@ static const struct file_operations key_ ##name## _ops = { \
static const struct file_operations key_ ##name## _ops = { \
.read = key_conf_##name##_read, \
.open = mac80211_open_file_generic, \
+ .llseek = generic_file_llseek, \
}
#define KEY_CONF_FILE(name, format) \
diff --git a/net/mac80211/debugfs_netdev.c b/net/mac80211/debugfs_netdev.c
index 20b2998..8ad33ee 100644
--- a/net/mac80211/debugfs_netdev.c
+++ b/net/mac80211/debugfs_netdev.c
@@ -121,6 +121,7 @@ static const struct file_operations name##_ops = { \
.read = ieee80211_if_read_##name, \
.write = (_write), \
.open = mac80211_open_file_generic, \
+ .llseek = generic_file_llseek, \
}
#define __IEEE80211_IF_FILE_W(name) \
diff --git a/net/mac80211/debugfs_sta.c b/net/mac80211/debugfs_sta.c
index e763f15..73f8f36 100644
--- a/net/mac80211/debugfs_sta.c
+++ b/net/mac80211/debugfs_sta.c
@@ -37,6 +37,7 @@ static ssize_t sta_ ##name## _read(struct file *file, \
static const struct file_operations sta_ ##name## _ops = { \
.read = sta_##name##_read, \
.open = mac80211_open_file_generic, \
+ .llseek = generic_file_llseek, \
}
#define STA_OPS_RW(name) \
@@ -44,6 +45,7 @@ static const struct file_operations sta_ ##name## _ops = { \
.read = sta_##name##_read, \
.write = sta_##name##_write, \
.open = mac80211_open_file_generic, \
+ .llseek = generic_file_llseek, \
}
#define STA_FILE(name, field, format) \
diff --git a/net/wireless/debugfs.c b/net/wireless/debugfs.c
index a4991a3..3f9a57e 100644
--- a/net/wireless/debugfs.c
+++ b/net/wireless/debugfs.c
@@ -34,6 +34,7 @@ static ssize_t name## _read(struct file *file, char __user *userbuf, \
static const struct file_operations name## _ops = { \
.read = name## _read, \
.open = cfg80211_open_file_generic, \
+ .llseek = generic_file_llseek, \
};
DEBUGFS_READONLY_FILE(rts_threshold, 20, "%d",
--
1.7.1
^ permalink raw reply related
* Re: [PATCH net-next-2.6 V2] net: fix 64 bit counters on 32 bit arches
From: David Miller @ 2010-07-07 21:36 UTC (permalink / raw)
To: eric.dumazet; +Cc: bhutchings, shemminger, arnd, netdev, linux-net-drivers
In-Reply-To: <1278360322.2466.90.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 05 Jul 2010 22:05:22 +0200
> [PATCH net-next-2.6 V2] net: fix 64 bit counters on 32 bit arches
>
> There is a small possibility that a reader gets incorrect values on 32
> bit arches. SNMP applications could catch incorrect counters when a
> 32bit high part is changed by another stats consumer/provider.
>
> One way to solve this is to add a rtnl_link_stats64 param to all
> ndo_get_stats64() methods, and also add such a parameter to
> dev_get_stats().
>
> Rule is that we are not allowed to use dev->stats64 as a temporary
> storage for 64bit stats, but a caller provided area (usually on stack)
>
> Old drivers (only providing get_stats() method) need no changes.
>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Looks great, applied, thanks Eric.
^ permalink raw reply
* Re: [PATCHv3 2/2] sfc: Implement 64-bit net device statistics on all architectures
From: David Miller @ 2010-07-07 19:56 UTC (permalink / raw)
To: eric.dumazet; +Cc: bhutchings, shemminger, arnd, netdev, linux-net-drivers
In-Reply-To: <1278354682.2877.639.camel@edumazet-laptop>
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 05 Jul 2010 20:31:22 +0200
> One other way would be to add a rtnl_link_stats64 param to
> ndo_get_stats64() method, and ask drivers to copy their stats in this
> zone, instead of returning &dev->stats64 or something...
>
> And also change dev_get_stats() with this new parameter.
>
> Each caller would use a private copy, with no risk of concurrent
> updates.
If this can be reliably be made at all call sites, I think such
an approach is preferable.
^ permalink raw reply
* Re: [PATCH] bnx2x: add support for receive hashing
From: Tom Herbert @ 2010-07-07 19:17 UTC (permalink / raw)
To: Vladislav Zolotarov; +Cc: netdev@vger.kernel.org
In-Reply-To: <8628FE4E7912BF47A96AE7DD7BAC0AADDDE646FD52@SJEXCHCCR02.corp.ad.broadcom.com>
On Tue, Jul 6, 2010 at 12:16 AM, Vladislav Zolotarov <vladz@broadcom.com> wrote:
> Let me rephrase: the part of your patch below enables RSS flow in our FW even if there is only one HW queue and I wonder why?
> To refresh:
> 1) FW won't provide Toeplitz hash on CQE if RSS is not enabled.
> 2) There can be one HW queue in only 2 cases:
> - There is only one CPU in the system. In that case I wonder if u have anything to do with Toeplitz hash on the skb at all.
> - User has explicitly requested 1 HW queue with module parameter (num_queues=1). In that case if u r going to use the RSS hash on the skb means that u r actually going to do SW RSS instead of HW RSS, which sounds strange to me.
It might not be so strange. Previously, we has hit a firmware bug in
bnx2x that was make multi-queue not perform well under some loads, so
we had disabled it for a while... it is a valid configuration we have
used.
>
> So, Herbert, could u, pls., explain, what was your original idea about these code lines?
>
It is to enable the device to provide the RSS hash in RX descriptor.
The hash severs two purposes now, it's used internally in the device
to perform RSS table lookup and also value in RX descriptor. The
latter does not require multi-queue. Strictly speaking, on a single
processor system without multqueue, it would be true that enabling the
RX hash on bnx2x is currently superfluous (notwithstanding some other
use of the hash might be implemented).
> Thanks,
> vlad
>
>> -----Original Message-----
>> From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On
>> Behalf Of Vladislav Zolotarov
>> Sent: Sunday, July 04, 2010 7:36 PM
>> To: Tom Herbert
>> Cc: netdev@vger.kernel.org
>> Subject: RE: [PATCH] bnx2x: add support for receive hashing
>>
>> Tom, could u, pls., explain what did u mean by taking the (RSS) flags
>> configuration out of RSS "if"? To recall "if(is_multi(bp))" is true iff RSS
>> is enabled.
>>
>> Thanks,
>> vlad
>>
>> > @@ -5750,10 +5757,10 @@ static void bnx2x_init_internal_func(struct bnx2x
>> > *bp)
>> > u32 offset;
>> > u16 max_agg_size;
>> >
>> > - if (is_multi(bp)) {
>> > - tstorm_config.config_flags = MULTI_FLAGS(bp);
>> > + tstorm_config.config_flags = RSS_FLAGS(bp);
>> > +
>> > + if (is_multi(bp))
>> > tstorm_config.rss_result_mask = MULTI_MASK;
>> > - }
>> >
>> > /* Enable TPA if needed */
>> > if (bp->flags & TPA_ENABLE_FLAG)
>>
>>
>> > -----Original Message-----
>> > From: netdev-owner@vger.kernel.org [mailto:netdev-owner@vger.kernel.org] On
>> > Behalf Of Tom Herbert
>> > Sent: Friday, April 23, 2010 8:54 AM
>> > To: davem@davemloft.net; netdev@vger.kernel.org
>> > Subject: [PATCH] bnx2x: add support for receive hashing
>> >
>> > Add support to bnx2x to extract Toeplitz hash out of the receive descriptor
>> > for use in skb->rxhash.
>> >
>> > Signed-off-by: Tom Herbert <therbert@google.com>
>> > ---
>> > diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h
>> > index 0819530..8bd2368 100644
>> > --- a/drivers/net/bnx2x.h
>> > +++ b/drivers/net/bnx2x.h
>> > @@ -1330,7 +1330,7 @@ static inline u32 reg_poll(struct bnx2x *bp, u32 reg,
>> > u32 expected, int ms,
>> > AEU_INPUTS_ATTN_BITS_MCP_LATCHED_UMP_TX_PARITY | \
>> > AEU_INPUTS_ATTN_BITS_MCP_LATCHED_SCPAD_PARITY)
>> >
>> > -#define MULTI_FLAGS(bp) \
>> > +#define RSS_FLAGS(bp) \
>> > (TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_CAPABILITY | \
>> > TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV4_TCP_CAPABILITY | \
>> > TSTORM_ETH_FUNCTION_COMMON_CONFIG_RSS_IPV6_CAPABILITY | \
>> > diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c
>> > index 0c6dba2..613f727 100644
>> > --- a/drivers/net/bnx2x_main.c
>> > +++ b/drivers/net/bnx2x_main.c
>> > @@ -1582,7 +1582,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp,
>> int
>> > budget)
>> > struct sw_rx_bd *rx_buf = NULL;
>> > struct sk_buff *skb;
>> > union eth_rx_cqe *cqe;
>> > - u8 cqe_fp_flags;
>> > + u8 cqe_fp_flags, cqe_fp_status_flags;
>> > u16 len, pad;
>> >
>> > comp_ring_cons = RCQ_BD(sw_comp_cons);
>> > @@ -1598,6 +1598,7 @@ static int bnx2x_rx_int(struct bnx2x_fastpath *fp,
>> int
>> > budget)
>> >
>> > cqe = &fp->rx_comp_ring[comp_ring_cons];
>> > cqe_fp_flags = cqe->fast_path_cqe.type_error_flags;
>> > + cqe_fp_status_flags = cqe->fast_path_cqe.status_flags;
>> >
>> > DP(NETIF_MSG_RX_STATUS, "CQE type %x err %x status %x"
>> > " queue %x vlan %x len %u\n", CQE_TYPE(cqe_fp_flags),
>> > @@ -1727,6 +1728,12 @@ reuse_rx:
>> >
>> > skb->protocol = eth_type_trans(skb, bp->dev);
>> >
>> > + if ((bp->dev->features & ETH_FLAG_RXHASH) &&
>> > + (cqe_fp_status_flags &
>> > + ETH_FAST_PATH_RX_CQE_RSS_HASH_FLG))
>> > + skb->rxhash = le32_to_cpu(
>> > + cqe->fast_path_cqe.rss_hash_result);
>> > +
>> > skb->ip_summed = CHECKSUM_NONE;
>> > if (bp->rx_csum) {
>> > if (likely(BNX2X_RX_CSUM_OK(cqe)))
>> > @@ -5750,10 +5757,10 @@ static void bnx2x_init_internal_func(struct bnx2x
>> > *bp)
>> > u32 offset;
>> > u16 max_agg_size;
>> >
>> > - if (is_multi(bp)) {
>> > - tstorm_config.config_flags = MULTI_FLAGS(bp);
>> > + tstorm_config.config_flags = RSS_FLAGS(bp);
>> > +
>> > + if (is_multi(bp))
>> > tstorm_config.rss_result_mask = MULTI_MASK;
>> > - }
>> >
>> > /* Enable TPA if needed */
>> > if (bp->flags & TPA_ENABLE_FLAG)
>> > @@ -6629,10 +6636,8 @@ static int bnx2x_init_common(struct bnx2x *bp)
>> > bnx2x_init_block(bp, PBF_BLOCK, COMMON_STAGE);
>> >
>> > REG_WR(bp, SRC_REG_SOFT_RST, 1);
>> > - for (i = SRC_REG_KEYRSS0_0; i <= SRC_REG_KEYRSS1_9; i += 4) {
>> > - REG_WR(bp, i, 0xc0cac01a);
>> > - /* TODO: replace with something meaningful */
>> > - }
>> > + for (i = SRC_REG_KEYRSS0_0; i <= SRC_REG_KEYRSS1_9; i += 4)
>> > + REG_WR(bp, i, random32());
>> > bnx2x_init_block(bp, SRCH_BLOCK, COMMON_STAGE);
>> > #ifdef BCM_CNIC
>> > REG_WR(bp, SRC_REG_KEYSEARCH_0, 0x63285672);
>> > @@ -11001,6 +11006,11 @@ static int bnx2x_set_flags(struct net_device *dev,
>> > u32 data)
>> > changed = 1;
>> > }
>> >
>> > + if (data & ETH_FLAG_RXHASH)
>> > + dev->features |= NETIF_F_RXHASH;
>> > + else
>> > + dev->features &= ~NETIF_F_RXHASH;
>> > +
>> > if (changed && netif_running(dev)) {
>> > bnx2x_nic_unload(bp, UNLOAD_NORMAL);
>> > rc = bnx2x_nic_load(bp, LOAD_NORMAL);
>> > --
>> > To unsubscribe from this list: send the line "unsubscribe netdev" in
>> > the body of a message to majordomo@vger.kernel.org
>> > More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe netdev" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
^ permalink raw reply
* Re: [PATCH 1/2] Export firmware assigned labels of network devices to sysfs
From: Domsch, Matt @ 2010-07-07 18:35 UTC (permalink / raw)
To: Greg KH
Cc: K, Narendra, netdev@vger.kernel.org,
linux-hotplug@vger.kernel.org, linux-pci@vger.kernel.org,
Hargrave, Jordan, Rose, Charles, Nijhawan, Vijay
In-Reply-To: <20100707181134.GB4293@kroah.com>
On Wed, Jul 07, 2010 at 01:11:34PM -0500, Greg KH wrote:
> > > Why do you need it? What is calling that function? What am I missing
> > > here?
> >
> > The function 'pci_create_smbiosname_file' below is calling the .test method.
> > For every pdev the function checks if it has a SMBIOS string associated
> > with it or not. If there is no string (and instance) associated, then the
> > attributes 'label' and 'instance' are not created for that pdev.
> > To check for the existance of the string, the .test method is needed and
> > it is not available in 'struct device_attribute'. It provides
> > .show and .store. We need a .show and .test. So we defined
>
> {sigh}
>
> So, you just reinvented the is_visible function in struct
> attribute_group? Please use the infrastructure already available to do
> this, it saves on code and debugging and review time.
I'll take the blame for this. I recommended Narendra use the .test
method, as this is what I did back in 2005 in drivers/firmware/edd.c
which was one of the earliest consumers of the new sysfs code. James
added the is_visible field to attribute groups in 2008, which I
missed (only 3 drivers make use of it, so it was easy to miss). Since
that's the "new" preferred way to do it, we can adjust this patch
accordingly.
Thanks,
Matt
--
Matt Domsch
Technology Strategist
Dell | Office of the CTO
^ 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