* Re: [PATCH 1/2] alchemy: add au1000-eth platform device
From: Florian Fainelli @ 2009-08-21 16:53 UTC (permalink / raw)
To: Sergei Shtylyov
Cc: Ralf Baechle, linux-mips, Manuel Lauss, David Miller, netdev
In-Reply-To: <200908181801.41602.florian@openwrt.org>
Le Tuesday 18 August 2009 18:01:40 Florian Fainelli, vous avez écrit :
> Le Tuesday 18 August 2009 16:56:37 Sergei Shtylyov, vous avez écrit :
> > Hello.
> >
> > Florian Fainelli wrote:
> > > This patch adds the board code to register a per-board au1000-eth
> > > platform device to be used wit the au1000-eth platform driver in a
> > > subsequent patch. Note that the au1000-eth driver knows about the
> > > default driver settings such that we do not need to pass any
> > > platform_data informations in most cases except db1x00.
> >
> > Sigh, NAK...
> > Please don't register the SoC device per board, do it in
> > alchemy/common/platfrom.c and find a way to pass the board specific
> > platform data from the board file there instead -- something like
> > arch/arm/mach-davinci/usb.c does.
>
> Ok, like I promised, this was the per-board device registration. Do you
> prefer something like this: --
> From fd75b7c7fa3c05c21122c43e43260d2785475a79 Mon Sep 17 00:00:00 2001
> From: Florian Fainelli <florian@openwrt.org>
> Date: Tue, 18 Aug 2009 17:53:21 +0200
> Subject: [PATCH] alchemy: add au1000-eth platform device (v2)
>
> This patch makes the board code register the au1000-eth
> platform device. The au1000-eth platform data can be
> overriden with the au1xxx_override_eth0_cfg function
> like it has to be done for the Bosporus board.
Sergei, any comments on that version? What about you Manuel?
>
> Changes from v1:
> - remove per-board platform.c file
> - add an override function to pass custom eth0 platform_data PHY settings
>
> Signed-off-by: Florian Fainelli <florian@openwrt.org>
> ---
> diff --git a/arch/mips/alchemy/common/platform.c
> b/arch/mips/alchemy/common/platform.c index 117f99f..559294a 100644
> --- a/arch/mips/alchemy/common/platform.c
> +++ b/arch/mips/alchemy/common/platform.c
> @@ -19,6 +19,7 @@
> #include <asm/mach-au1x00/au1xxx.h>
> #include <asm/mach-au1x00/au1xxx_dbdma.h>
> #include <asm/mach-au1x00/au1100_mmc.h>
> +#include <asm/mach-au1x00/au1xxx_eth.h>
>
> #define PORT(_base, _irq) \
> { \
> @@ -331,6 +332,76 @@ static struct platform_device pbdb_smbus_device = {
> };
> #endif
>
> +/* Macro to help defining the Ethernet MAC resources */
> +#define MAC_RES(_base, _enable, _irq) \
> + { \
> + .start = CPHYSADDR(_base), \
> + .end = CPHYSADDR(_base + 0xffff), \
> + .flags = IORESOURCE_MEM, \
> + }, \
> + { \
> + .start = CPHYSADDR(_enable), \
> + .end = CPHYSADDR(_enable + 0x3), \
> + .flags = IORESOURCE_MEM, \
> + }, \
> + { \
> + .start = _irq, \
> + .end = _irq, \
> + .flags = IORESOURCE_IRQ \
> + }
> +
> +static struct resource au1xxx_eth0_resources[] = {
> +#if defined(CONFIG_SOC_AU1000)
> + MAC_RES(AU1000_ETH0_BASE, AU1000_MAC0_ENABLE, AU1000_MAC0_DMA_INT),
> +#elif defined(CONFIG_SOC_AU1100)
> + MAC_RES(AU1100_ETH0_BASE, AU1100_MAC0_ENABLE, AU1100_MAC0_DMA_INT),
> +#elif defined(CONFIG_SOC_AU1550)
> + MAC_RES(AU1550_ETH0_BASE, AU1550_MAC0_ENABLE, AU1550_MAC0_DMA_INT),
> +#elif defined(CONFIG_SOC_AU1500)
> + MAC_RES(AU1500_ETH0_BASE, AU1500_MAC0_ENABLE, AU1500_MAC0_DMA_INT),
> +#endif
> +};
> +
> +static struct resource au1xxx_eth1_resources[] = {
> +#if defined(CONFIG_SOC_AU1000)
> + MAC_RES(AU1000_ETH1_BASE, AU1000_MAC1_ENABLE, AU1000_MAC1_DMA_INT),
> +#elif defined(CONFIG_SOC_AU1550)
> + MAC_RES(AU1550_ETH1_BASE, AU1550_MAC1_ENABLE, AU1550_MAC1_DMA_INT),
> +#elif defined(CONFIG_SOC_AU1500)
> + MAC_RES(AU1500_ETH1_BASE, AU1500_MAC1_ENABLE, AU1500_MAC1_DMA_INT),
> +#endif
> +};
> +
> +static struct au1000_eth_platform_data au1xxx_eth0_platform_data = {
> + .phy1_search_mac0 = 1,
> +};
> +
> +static struct platform_device au1xxx_eth0_device = {
> + .name = "au1000-eth",
> + .id = 0,
> + .num_resources = ARRAY_SIZE(au1xxx_eth0_resources),
> + .resource = au1xxx_eth0_resources,
> + .dev.platform_data = &au1xxx_eth0_platform_data,
> +};
> +
> +#ifndef CONFIG_SOC_AU1100
> +static struct platform_device au1xxx_eth1_device = {
> + .name = "au1000-eth",
> + .id = 1,
> + .num_resources = ARRAY_SIZE(au1xxx_eth1_resources),
> + .resource = au1xxx_eth1_resources,
> +};
> +#endif
> +
> +void __init au1xxx_override_eth0_cfg(struct au1000_eth_platform_data
> *eth_data) +{
> + if (!eth_data)
> + return;
> +
> + memcpy(&au1xxx_eth0_platform_data, eth_data,
> + sizeof(struct au1000_eth_platform_data));
> +}
> +
> static struct platform_device *au1xxx_platform_devices[] __initdata = {
> &au1xx0_uart_device,
> &au1xxx_usb_ohci_device,
> @@ -351,17 +422,25 @@ static struct platform_device
> *au1xxx_platform_devices[] __initdata = { #ifdef SMBUS_PSC_BASE
> &pbdb_smbus_device,
> #endif
> + &au1xxx_eth0_device,
> };
>
> static int __init au1xxx_platform_init(void)
> {
> unsigned int uartclk = get_au1x00_uart_baud_base() * 16;
> - int i;
> + int i, ni;
>
> /* Fill up uartclk. */
> for (i = 0; au1x00_uart_data[i].flags; i++)
> au1x00_uart_data[i].uartclk = uartclk;
>
> + /* Register second MAC if enabled in pinfunc */
> +#ifndef CONFIG_SOC_AU1100
> + ni = (int)((au_readl(SYS_PINFUNC) & (u32)(SYS_PF_NI2)) >> 4);
> + if (!(ni + 1))
> + platform_device_register(&au1xxx_eth1_device);
> +#endif
> +
> return platform_add_devices(au1xxx_platform_devices,
> ARRAY_SIZE(au1xxx_platform_devices));
> }
> diff --git a/arch/mips/alchemy/devboards/db1x00/board_setup.c
> b/arch/mips/alchemy/devboards/db1x00/board_setup.c index de30d8e..4d2d32c
> 100644
> --- a/arch/mips/alchemy/devboards/db1x00/board_setup.c
> +++ b/arch/mips/alchemy/devboards/db1x00/board_setup.c
> @@ -32,6 +32,7 @@
>
> #include <asm/mach-au1x00/au1000.h>
> #include <asm/mach-db1x00/db1x00.h>
> +#include <asm/mach-au1x00/au1xxx_eth.h>
>
> #include <prom.h>
>
> @@ -134,6 +135,22 @@ void __init board_setup(void)
> printk(KERN_INFO "AMD Alchemy Au1100/Db1100 Board\n");
> #endif
> #ifdef CONFIG_MIPS_BOSPORUS
> + struct au1000_eth_platform_data eth0_pdata;
> +
> + /*
> + * Micrel/Kendin 5 port switch attached to MAC0,
> + * MAC0 is associated with PHY address 5 (== WAN port)
> + * MAC1 is not associated with any PHY, since it's connected directly
> + * to the switch.
> + * no interrupts are used
> + */
> + eth0_pdata.phy1_search_mac0 = 0;
> + eth0_pdata.phy_static_config = 1;
> + eth0_pdata.phy_addr = 5;
> + eth0_pdata.phy_busid = 0;
> +
> + au1xxx_override_eth0_cfg(ð0_pdata);
> +
> printk(KERN_INFO "AMD Alchemy Bosporus Board\n");
> #endif
> #ifdef CONFIG_MIPS_MIRAGE
> diff --git a/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h
> b/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h new file mode 100644
> index 0000000..876187e
> --- /dev/null
> +++ b/arch/mips/include/asm/mach-au1x00/au1xxx_eth.h
> @@ -0,0 +1,17 @@
> +#ifndef __AU1X00_ETH_DATA_H
> +#define __AU1X00_ETH_DATA_H
> +
> +/* Platform specific PHY configuration passed to the MAC driver */
> +struct au1000_eth_platform_data {
> + int phy_static_config;
> + int phy_search_highest_addr;
> + int phy1_search_mac0;
> + int phy_addr;
> + int phy_busid;
> + int phy_irq;
> +};
> +
> +void __init au1xxx_override_eth0_cfg(struct au1000_eth_platform_data
> *eth_data); +
> +#endif /* __AU1X00_ETH_DATA_H */
> +
--
Best regards, Florian Fainelli
Email: florian@openwrt.org
Web: http://openwrt.org
IRC: [florian] on irc.freenode.net
-------------------------------
^ permalink raw reply
* Re: Strange network timeouts w/ 2.6.30.5
From: Walt Holman @ 2009-08-21 15:45 UTC (permalink / raw)
To: Krzysztof Halasa; +Cc: David Miller, linux-kernel, netdev
In-Reply-To: <1489093361.01250869377567.JavaMail.root@mail.holmansrus.com>
----- "Krzysztof Halasa" <khc@pm.waw.pl> wrote:
> Walt Holman <walt@holmansrus.com> writes:
>
> > Would something like passing a mem=xx cmdline on x86_64 be
> sufficient to test this?
>
> I think so, though I admit I don't remember using this personally
> since
> the introduction of e820 RAM mapping support.
> Dmesg will show if the memory is limited. For the swiotlb to
> effectively
> disable no RAM > 0x100000000 may be used.
>
> But this test isn't IMHO terribly important at this point - the
> driver
> makes invalid use of the DMA API and it has to change. The test could
> only explain _how_ exactly does it fail, we already know _why_ it
> does.
> --
> Krzysztof Halasa
Just got a chance to test this for confirmation. When limiting the RAM to 2GB, the patched driver appears to work OK.
-Walt
^ permalink raw reply
* Re: Receive side performance issue with multi-10-GigE and NUMA
From: Andrew Gallatin @ 2009-08-21 15:36 UTC (permalink / raw)
To: Neil Horman; +Cc: Bill Fink, Linux Network Developers, brice
In-Reply-To: <20090821152341.GA2998@localhost.localdomain>
Neil Horman wrote:
> On Fri, Aug 21, 2009 at 12:14:21AM -0400, Bill Fink wrote:
>> On Thu, 20 Aug 2009, Neil Horman wrote:
>>
>>> On Thu, Aug 20, 2009 at 03:50:44AM -0400, Bill Fink wrote:
>>>
>>>> When I tried an actual nuttcp performance test, even when rate limiting
>>>> to just 1 Mbps, I immediately got a kernel oops. I tried to get a
>>>> crashdump via kexec/kdump, but the kexec kernel, instead of just
>>>> generating a crashdump, fully booted the new kernel, which was
>>>> extremely sluggish until I rebooted it through a BIOS re-init,
>>>> and never produced a crashdump. I tried this several times and
>>>> an immediate kernel oops was always the result (with either a TCP
>>>> or UDP test). A ping test of 1000 9000-byte packets with an interval
>>>> of 0.001 seconds (which is 72 Mbps for 1 second) on the other hand
>>>> worked just fine.
>>> The sluggishness is expected, since the kdump kernel operates out of such
>>> limited memory. don't know why you booted to a full system rather than did a
>>> crash recovery. Don't suppose you got a backtrace did you?
>> There was a backtrace on the screen but I didn't have a chance to
>> record it. BTW did anyone ever think to print the backtrace in
>> reverse (first to some reserved memory and then output to the display)
>> so the more interesting parts wouldn't have scrolled off the top of
>> the screen?
>>
> The real solution is to use a console to which the output doesn't scroll off the
> screen. Normally people use a serial console they can log, or a RAC card that
> they can record. Even on a regular vga monitor in text mode, you can set up the
> vt iirc to allow for scrolling.
Indeed. Another option when setting up a serial console is not practical
is netconsole. I've captured a few panics this way on machines like
macs, with no serial port support (at the time).
Drew
^ permalink raw reply
* Re: [PATCH 2/2] drivers/net: fixed drivers that support netpoll use ndo_start_xmit()
From: Matt Mackall @ 2009-08-21 15:26 UTC (permalink / raw)
To: DDD; +Cc: David Miller, Nicolas Pitre, lkml, netdev, Jason Wessel
In-Reply-To: <1250861693.24178.22.camel@dengdd-desktop>
On Fri, 2009-08-21 at 21:34 +0800, DDD wrote:
> The NETPOLL API requires that interrupts remain disabled in
> netpoll_send_skb(). The use of "A functions set" in the NETPOLL API
> callbacks causes the interrupts to get enabled and can lead to kernel
> instability.
>
> The solution is to use "B functions set" to prevent the irqs from
> getting enabled while in netpoll_send_skb().
>
> A functions set:
> local_irq_disable()/local_irq_enable()
> spin_lock_irq()/spin_unlock_irq()
> spin_trylock_irq()/spin_unlock_irq()
>
> B functions set:
> local_irq_save()/local_irq_restore()
> spin_lock_irqsave()/spin_unlock_irqrestore()
> spin_trylock_irqsave()/spin_unlock_irqrestore()
>
> Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
Both of these look good to me, thanks.
Acked-by: Matt Mackall <mpm@selenic.com>
--
http://selenic.com : development and support for Mercurial and Linux
^ permalink raw reply
* Re: Receive side performance issue with multi-10-GigE and NUMA
From: Neil Horman @ 2009-08-21 15:23 UTC (permalink / raw)
To: Bill Fink; +Cc: Linux Network Developers, brice, gallatin
In-Reply-To: <20090821001421.214a560b.billfink@mindspring.com>
On Fri, Aug 21, 2009 at 12:14:21AM -0400, Bill Fink wrote:
> On Thu, 20 Aug 2009, Neil Horman wrote:
>
> > On Thu, Aug 20, 2009 at 03:50:44AM -0400, Bill Fink wrote:
> >
> > > When I tried an actual nuttcp performance test, even when rate limiting
> > > to just 1 Mbps, I immediately got a kernel oops. I tried to get a
> > > crashdump via kexec/kdump, but the kexec kernel, instead of just
> > > generating a crashdump, fully booted the new kernel, which was
> > > extremely sluggish until I rebooted it through a BIOS re-init,
> > > and never produced a crashdump. I tried this several times and
> > > an immediate kernel oops was always the result (with either a TCP
> > > or UDP test). A ping test of 1000 9000-byte packets with an interval
> > > of 0.001 seconds (which is 72 Mbps for 1 second) on the other hand
> > > worked just fine.
> >
> > The sluggishness is expected, since the kdump kernel operates out of such
> > limited memory. don't know why you booted to a full system rather than did a
> > crash recovery. Don't suppose you got a backtrace did you?
>
> There was a backtrace on the screen but I didn't have a chance to
> record it. BTW did anyone ever think to print the backtrace in
> reverse (first to some reserved memory and then output to the display)
> so the more interesting parts wouldn't have scrolled off the top of
> the screen?
>
The real solution is to use a console to which the output doesn't scroll off the
screen. Normally people use a serial console they can log, or a RAC card that
they can record. Even on a regular vga monitor in text mode, you can set up the
vt iirc to allow for scrolling.
Neil
> -Bill
>
^ permalink raw reply
* [PATCH net-next-2.6] fib_trie: resize rework
From: Robert Olsson @ 2009-08-21 14:10 UTC (permalink / raw)
To: Jens Laas; +Cc: netdev, robert
In-Reply-To: <alpine.LNX.2.00.0908211318070.28188@jens.its.uu.se>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=unknown, Size: 7039 bytes --]
Jens Laas writes:
> Here is rework and cleanup of the resize function.
>
> Some bugs we had. We were using ->parent when we should use
> node_parent(). Also we used ->parent which is not assigned by
> inflate in inflate loop.
>
> Also a fix to set thresholds to power 2 to fit halve
> and double strategy.
>
> max_resize is renamed to max_work which better indicates
> it's function.
>
> Reaching max_work is not an error, so warning is removed.
> max_work only limits amount of work done per resize.
> (limits CPU-usage, outstanding memory etc).
>
> The clean-up makes it relatively easy to add fixed sized
> root-nodes if we would like to decrease the memory pressure
> on routers with large routing tables and dynamic routing.
> If we'll need that...
>
> Its been tested with 280k routes.
>
> Work done together with Robert Olsson.
>
> Signed-off-by: Jens Låås <jens.laas@its.uu.se>
Right we think is a step forward. No performance differences seen
either for lookup or insert.
Signed-off-by: Robert Olsson <robert.olsson@its.uu.se>
Cheers.
--ro
PS.
We see ~7 Gbit/s simplex routing w/o route cache using packet distribution
seen on core links. Using multiQ of course
> ---
> net/ipv4/fib_trie.c | 95 ++++++++++++--------------------------------------
> 1 files changed, 23 insertions(+), 72 deletions(-)
>
> diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
> index fe3c846..291bdf5 100644
> --- a/net/ipv4/fib_trie.c
> +++ b/net/ipv4/fib_trie.c
> @@ -48,7 +48,7 @@
> * Patrick McHardy <kaber@trash.net>
> */
>
> -#define VERSION "0.408"
> +#define VERSION "0.409"
>
> #include <asm/uaccess.h>
> #include <asm/system.h>
> @@ -325,10 +325,7 @@ static inline void check_tnode(const struct tnode *tn)
> static const int halve_threshold = 25;
> static const int inflate_threshold = 50;
> static const int halve_threshold_root = 15;
> -static const int inflate_threshold_root = 25;
> -
> -static int inflate_threshold_root_fix;
> -#define INFLATE_FIX_MAX 10 /* a comment in resize() */
> +static const int inflate_threshold_root = 30;
>
> static void __alias_free_mem(struct rcu_head *head)
> {
> @@ -516,14 +513,14 @@ static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n,
> rcu_assign_pointer(tn->child[i], n);
> }
>
> +#define MAX_WORK 10
> static struct node *resize(struct trie *t, struct tnode *tn)
> {
> int i;
> - int err = 0;
> struct tnode *old_tn;
> int inflate_threshold_use;
> int halve_threshold_use;
> - int max_resize;
> + int max_work;
>
> if (!tn)
> return NULL;
> @@ -538,18 +535,7 @@ static struct node *resize(struct trie *t, struct tnode *tn)
> }
> /* One child */
> if (tn->empty_children == tnode_child_length(tn) - 1)
> - for (i = 0; i < tnode_child_length(tn); i++) {
> - struct node *n;
> -
> - n = tn->child[i];
> - if (!n)
> - continue;
> -
> - /* compress one level */
> - node_set_parent(n, NULL);
> - tnode_free_safe(tn);
> - return n;
> - }
> + goto one_child;
> /*
> * Double as long as the resulting node has a number of
> * nonempty nodes that are above the threshold.
> @@ -618,15 +604,17 @@ static struct node *resize(struct trie *t, struct tnode *tn)
>
> /* Keep root node larger */
>
> - if (!tn->parent)
> - inflate_threshold_use = inflate_threshold_root +
> - inflate_threshold_root_fix;
> - else
> + if (!node_parent((struct node*) tn)) {
> + inflate_threshold_use = inflate_threshold_root;
> + halve_threshold_use = halve_threshold_root;
> + }
> + else {
> inflate_threshold_use = inflate_threshold;
> + halve_threshold_use = halve_threshold;
> + }
>
> - err = 0;
> - max_resize = 10;
> - while ((tn->full_children > 0 && max_resize-- &&
> + max_work = MAX_WORK;
> + while ((tn->full_children > 0 && max_work-- &&
> 50 * (tn->full_children + tnode_child_length(tn)
> - tn->empty_children)
> >= inflate_threshold_use * tnode_child_length(tn))) {
> @@ -643,47 +631,19 @@ static struct node *resize(struct trie *t, struct tnode *tn)
> }
> }
>
> - if (max_resize < 0) {
> - if (!tn->parent) {
> - /*
> - * It was observed that during large updates even
> - * inflate_threshold_root = 35 might be needed to avoid
> - * this warning; but it should be temporary, so let's
> - * try to handle this automatically.
> - */
> - if (inflate_threshold_root_fix < INFLATE_FIX_MAX)
> - inflate_threshold_root_fix++;
> - else
> - pr_warning("Fix inflate_threshold_root."
> - " Now=%d size=%d bits fix=%d\n",
> - inflate_threshold_root, tn->bits,
> - inflate_threshold_root_fix);
> - } else {
> - pr_warning("Fix inflate_threshold."
> - " Now=%d size=%d bits\n",
> - inflate_threshold, tn->bits);
> - }
> - } else if (max_resize > 3 && !tn->parent && inflate_threshold_root_fix)
> - inflate_threshold_root_fix--;
> -
> check_tnode(tn);
>
> + /* Return if at least one inflate is run */
> + if( max_work != MAX_WORK)
> + return (struct node *) tn;
> +
> /*
> * Halve as long as the number of empty children in this
> * node is above threshold.
> */
>
> -
> - /* Keep root node larger */
> -
> - if (!tn->parent)
> - halve_threshold_use = halve_threshold_root;
> - else
> - halve_threshold_use = halve_threshold;
> -
> - err = 0;
> - max_resize = 10;
> - while (tn->bits > 1 && max_resize-- &&
> + max_work = MAX_WORK;
> + while (tn->bits > 1 && max_work-- &&
> 100 * (tnode_child_length(tn) - tn->empty_children) <
> halve_threshold_use * tnode_child_length(tn)) {
>
> @@ -698,19 +658,10 @@ static struct node *resize(struct trie *t, struct tnode *tn)
> }
> }
>
> - if (max_resize < 0) {
> - if (!tn->parent)
> - pr_warning("Fix halve_threshold_root."
> - " Now=%d size=%d bits\n",
> - halve_threshold_root, tn->bits);
> - else
> - pr_warning("Fix halve_threshold."
> - " Now=%d size=%d bits\n",
> - halve_threshold, tn->bits);
> - }
>
> /* Only one child remains */
> - if (tn->empty_children == tnode_child_length(tn) - 1)
> + if (tn->empty_children == tnode_child_length(tn) - 1) {
> +one_child:
> for (i = 0; i < tnode_child_length(tn); i++) {
> struct node *n;
>
> @@ -724,7 +675,7 @@ static struct node *resize(struct trie *t, struct tnode *tn)
> tnode_free_safe(tn);
> return n;
> }
> -
> + }
> return (struct node *) tn;
> }
>
> --
> 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
* [RFC][PATCH] smc91x: let smc91x work well with netpoll
From: DDD @ 2009-08-21 13:40 UTC (permalink / raw)
To: Nicolas Pitre, Matt Mackall, David Miller; +Cc: lkml, netdev, Jason Wessel
In-Reply-To: <1250861616.24178.20.camel@dengdd-desktop>
This patch changes too much and I didn't have the environment to test, so it is unverified patch.
That's why I separate it from my previous patch, and send it solely as a RFC patch.
Hi Nicolas,
Given that you are the maintainer of "smc91x" driver since 2004. Could you say somethings about this
patch? Your input on this patch is greatly appreciated. :-)
Thank you very much,
Dongdong
Patch Note:
@@ -520,21 +522,21
- local_irq_disable(); \
+ local_irq_save(flags); \
__ret = spin_trylock(lock); \
if (!__ret) \
- local_irq_enable(); \
+ local_irq_restore(flags); \
Here, for "__ret = spin_trylock(lock)", I didn't use
spin_trylock_irqsave() to replace spin_trylock(), because
the current irq state have got by local_irq_save(flags).
---
drivers/net/smc91x.c | 40 ++++++++++++++++++++++------------------
1 files changed, 22 insertions(+), 18 deletions(-)
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c
index 1c70e99..7cabea1 100644
--- a/drivers/net/smc91x.c
+++ b/drivers/net/smc91x.c
@@ -196,21 +196,23 @@ static void PRINT_PKT(u_char *buf, int length)
/* this enables an interrupt in the interrupt mask register */
#define SMC_ENABLE_INT(lp, x) do { \
unsigned char mask; \
- spin_lock_irq(&lp->lock); \
+ unsigned long smc_enable_flags; \
+ spin_lock_irqsave(&lp->lock, smc_int_flags); \
mask = SMC_GET_INT_MASK(lp); \
mask |= (x); \
SMC_SET_INT_MASK(lp, mask); \
- spin_unlock_irq(&lp->lock); \
+ spin_unlock_irqrestore(&lp->lock, smc_int_flags); \
} while (0)
/* this disables an interrupt from the interrupt mask register */
#define SMC_DISABLE_INT(lp, x) do { \
unsigned char mask; \
- spin_lock_irq(&lp->lock); \
+ unsigned long smc_disable_flags; \
+ spin_lock_irqsave(&lp->lock, smc_disable_flags); \
mask = SMC_GET_INT_MASK(lp); \
mask &= ~(x); \
SMC_SET_INT_MASK(lp, mask); \
- spin_unlock_irq(&lp->lock); \
+ spin_unlock_irqrestore(&lp->lock, smc_disable_flags); \
} while (0)
/*
@@ -520,21 +522,21 @@ static inline void smc_rcv(struct net_device *dev)
* any other concurrent access and C would always interrupt B. But life
* isn't that easy in a SMP world...
*/
-#define smc_special_trylock(lock) \
+#define smc_special_trylock(lock, flags) \
({ \
int __ret; \
- local_irq_disable(); \
+ local_irq_save(flags); \
__ret = spin_trylock(lock); \
if (!__ret) \
- local_irq_enable(); \
+ local_irq_restore(flags); \
__ret; \
})
-#define smc_special_lock(lock) spin_lock_irq(lock)
-#define smc_special_unlock(lock) spin_unlock_irq(lock)
+#define smc_special_lock(lock, flags) spin_lock_irq(lock, flags)
+#define smc_special_unlock(lock, flags) spin_unlock_irqrestore(lock, flags)
#else
-#define smc_special_trylock(lock) (1)
-#define smc_special_lock(lock) do { } while (0)
-#define smc_special_unlock(lock) do { } while (0)
+#define smc_special_trylock(lock, flags) (1)
+#define smc_special_lock(lock, flags) do { } while (0)
+#define smc_special_unlock(lock, flags) do { } while (0)
#endif
/*
@@ -548,10 +550,11 @@ static void smc_hardware_send_pkt(unsigned long data)
struct sk_buff *skb;
unsigned int packet_no, len;
unsigned char *buf;
+ unsigned long flags;
DBG(3, "%s: %s\n", dev->name, __func__);
- if (!smc_special_trylock(&lp->lock)) {
+ if (!smc_special_trylock(&lp->lock, flags)) {
netif_stop_queue(dev);
tasklet_schedule(&lp->tx_task);
return;
@@ -559,7 +562,7 @@ static void smc_hardware_send_pkt(unsigned long data)
skb = lp->pending_tx_skb;
if (unlikely(!skb)) {
- smc_special_unlock(&lp->lock);
+ smc_special_unlock(&lp->lock, flags);
return;
}
lp->pending_tx_skb = NULL;
@@ -569,7 +572,7 @@ static void smc_hardware_send_pkt(unsigned long data)
printk("%s: Memory allocation failed.\n", dev->name);
dev->stats.tx_errors++;
dev->stats.tx_fifo_errors++;
- smc_special_unlock(&lp->lock);
+ smc_special_unlock(&lp->lock, flags);
goto done;
}
@@ -608,7 +611,7 @@ static void smc_hardware_send_pkt(unsigned long data)
/* queue the packet for TX */
SMC_SET_MMU_CMD(lp, MC_ENQUEUE);
- smc_special_unlock(&lp->lock);
+ smc_special_unlock(&lp->lock, flags);
dev->trans_start = jiffies;
dev->stats.tx_packets++;
@@ -633,6 +636,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct smc_local *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base;
unsigned int numPages, poll_count, status;
+ unsigned long flags;
DBG(3, "%s: %s\n", dev->name, __func__);
@@ -658,7 +662,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
return 0;
}
- smc_special_lock(&lp->lock);
+ smc_special_lock(&lp->lock, flags);
/* now, try to allocate the memory */
SMC_SET_MMU_CMD(lp, MC_ALLOC | numPages);
@@ -676,7 +680,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
} while (--poll_count);
- smc_special_unlock(&lp->lock);
+ smc_special_unlock(&lp->lock, flags);
lp->pending_tx_skb = skb;
if (!poll_count) {
--
1.6.0.4
^ permalink raw reply related
* [PATCH 2/2] drivers/net: fixed drivers that support netpoll use ndo_start_xmit()
From: DDD @ 2009-08-21 13:34 UTC (permalink / raw)
To: Matt Mackall, David Miller, Nicolas Pitre; +Cc: lkml, netdev, Jason Wessel
In-Reply-To: <1250861616.24178.20.camel@dengdd-desktop>
The NETPOLL API requires that interrupts remain disabled in
netpoll_send_skb(). The use of "A functions set" in the NETPOLL API
callbacks causes the interrupts to get enabled and can lead to kernel
instability.
The solution is to use "B functions set" to prevent the irqs from
getting enabled while in netpoll_send_skb().
A functions set:
local_irq_disable()/local_irq_enable()
spin_lock_irq()/spin_unlock_irq()
spin_trylock_irq()/spin_unlock_irq()
B functions set:
local_irq_save()/local_irq_restore()
spin_lock_irqsave()/spin_unlock_irqrestore()
spin_trylock_irqsave()/spin_unlock_irqrestore()
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
---
drivers/net/fec_mpc52xx.c | 5 +++--
drivers/net/ixp2000/ixpdev.c | 5 +++--
drivers/net/macb.c | 7 ++++---
drivers/net/mlx4/en_tx.c | 5 +++--
4 files changed, 13 insertions(+), 9 deletions(-)
diff --git a/drivers/net/fec_mpc52xx.c b/drivers/net/fec_mpc52xx.c
index cc78633..c40113f 100644
--- a/drivers/net/fec_mpc52xx.c
+++ b/drivers/net/fec_mpc52xx.c
@@ -309,6 +309,7 @@ static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);
struct bcom_fec_bd *bd;
+ unsigned long flags;
if (bcom_queue_full(priv->tx_dmatsk)) {
if (net_ratelimit())
@@ -316,7 +317,7 @@ static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev)
return NETDEV_TX_BUSY;
}
- spin_lock_irq(&priv->lock);
+ spin_lock_irqsave(&priv->lock, flags);
dev->trans_start = jiffies;
bd = (struct bcom_fec_bd *)
@@ -332,7 +333,7 @@ static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
}
- spin_unlock_irq(&priv->lock);
+ spin_unlock_irqrestore(&priv->lock, flags);
return NETDEV_TX_OK;
}
diff --git a/drivers/net/ixp2000/ixpdev.c b/drivers/net/ixp2000/ixpdev.c
index 2a0174b..92fb823 100644
--- a/drivers/net/ixp2000/ixpdev.c
+++ b/drivers/net/ixp2000/ixpdev.c
@@ -41,6 +41,7 @@ static int ixpdev_xmit(struct sk_buff *skb, struct net_device *dev)
struct ixpdev_priv *ip = netdev_priv(dev);
struct ixpdev_tx_desc *desc;
int entry;
+ unsigned long flags;
if (unlikely(skb->len > PAGE_SIZE)) {
/* @@@ Count drops. */
@@ -63,11 +64,11 @@ static int ixpdev_xmit(struct sk_buff *skb, struct net_device *dev)
dev->trans_start = jiffies;
- local_irq_disable();
+ local_irq_save(flags);
ip->tx_queue_entries++;
if (ip->tx_queue_entries == TX_BUF_COUNT_PER_CHAN)
netif_stop_queue(dev);
- local_irq_enable();
+ local_irq_restore(flags);
return 0;
}
diff --git a/drivers/net/macb.c b/drivers/net/macb.c
index 5b5c253..e3601cf 100644
--- a/drivers/net/macb.c
+++ b/drivers/net/macb.c
@@ -620,6 +620,7 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
dma_addr_t mapping;
unsigned int len, entry;
u32 ctrl;
+ unsigned long flags;
#ifdef DEBUG
int i;
@@ -635,12 +636,12 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
#endif
len = skb->len;
- spin_lock_irq(&bp->lock);
+ spin_lock_irqsave(&bp->lock, flags);
/* This is a hard error, log it. */
if (TX_BUFFS_AVAIL(bp) < 1) {
netif_stop_queue(dev);
- spin_unlock_irq(&bp->lock);
+ spin_unlock_irqrestore(&bp->lock, flags);
dev_err(&bp->pdev->dev,
"BUG! Tx Ring full when queue awake!\n");
dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n",
@@ -674,7 +675,7 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (TX_BUFFS_AVAIL(bp) < 1)
netif_stop_queue(dev);
- spin_unlock_irq(&bp->lock);
+ spin_unlock_irqrestore(&bp->lock, flags);
dev->trans_start = jiffies;
diff --git a/drivers/net/mlx4/en_tx.c b/drivers/net/mlx4/en_tx.c
index 5a88b3f..0077d37 100644
--- a/drivers/net/mlx4/en_tx.c
+++ b/drivers/net/mlx4/en_tx.c
@@ -435,6 +435,7 @@ static struct mlx4_en_tx_desc *mlx4_en_bounce_to_desc(struct mlx4_en_priv *priv,
static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind)
{
+ unsigned long flags;
struct mlx4_en_cq *cq = &priv->tx_cq[tx_ind];
struct mlx4_en_tx_ring *ring = &priv->tx_ring[tx_ind];
@@ -445,9 +446,9 @@ static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind)
/* Poll the CQ every mlx4_en_TX_MODER_POLL packets */
if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0)
- if (spin_trylock_irq(&ring->comp_lock)) {
+ if (spin_trylock_irqsave(&ring->comp_lock, flags)) {
mlx4_en_process_tx_cq(priv->dev, cq);
- spin_unlock_irq(&ring->comp_lock);
+ spin_unlock_irqrestore(&ring->comp_lock, flags);
}
}
--
1.6.0.4
^ permalink raw reply related
* Re: [PATCH] Fix Micrel KSZ8842 Kconfig description
From: Richard Röjfors @ 2009-08-21 13:06 UTC (permalink / raw)
To: Andreas Mohr; +Cc: David Miller, netdev
In-Reply-To: <20090821104606.GA13440@rhlx01.hs-esslingen.de>
Andreas Mohr wrote:
> Hi,
>
> On Fri, Aug 21, 2009 at 12:36:49PM +0200, Richard Röjfors wrote:
>> Andreas Mohr wrote:
>>> Hi,
>>>
>>> when doing a "make oldconfig" recently, non-descriptive item "Micrel KSZ8842"
>>> came up, and when I hit "?" to get more info, all I got was a tight-lipped
>>> "This platform driver is for Micrel KSZ8842 chip.".
>> I see your pain
>
> Thanks, and very fast reply too :)
>
>> Remove "PCI-based"
>>
>> This is a platform device, it is not PCI based.
>> The KS8842 can sit behind PCI, ISA or VLB, this driver basically
>> supports the ISA mappings.
>>
>> --Richard
>
> OK, I had added that because manufacturer specifications seemed to suggest
> PCI use only. "platform device" should have been a warning sign I guess...
>
>
> Signed-off-by: Andreas Mohr <andi@lisas.de>
Looks good to me
Acked-by: Richard Röjfors <richard.rojfors.ext@mocean-labs.com>
>
> --- linux-2.6.31-rc6/drivers/net/Kconfig.orig 2009-08-21 12:00:31.000000000 +0200
> +++ linux-2.6.31-rc6/drivers/net/Kconfig 2009-08-21 12:41:48.000000000 +0200
> @@ -1727,7 +1727,8 @@ config KS8842
> tristate "Micrel KSZ8842"
> depends on HAS_IOMEM
> help
> - This platform driver is for Micrel KSZ8842 chip.
> + This platform driver is for Micrel KSZ8842 / KS8842
> + 2-port ethernet switch chip (managed, VLAN, QoS).
>
> config KS8851
> tristate "Micrel KS8851 SPI"
> --
> 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
* [PATCH 1/2] netpoll: warning for ndo_start_xmit returns with interrupts enabled
From: DDD @ 2009-08-21 13:33 UTC (permalink / raw)
To: Matt Mackall, David Miller, Nicolas Pitre; +Cc: lkml, netdev, Jason Wessel
WARN_ONCE for ndo_start_xmit() enable interrupts in netpoll_send_skb(),
because the NETPOLL API requires that interrupts remain disabled in
netpoll_send_skb().
Signed-off-by: Dongdong Deng <dongdong.deng@windriver.com>
---
net/core/netpoll.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/net/core/netpoll.c b/net/core/netpoll.c
index df30feb..1b76eb1 100644
--- a/net/core/netpoll.c
+++ b/net/core/netpoll.c
@@ -319,6 +319,11 @@ static void netpoll_send_skb(struct netpoll *np, struct sk_buff *skb)
udelay(USEC_PER_POLL);
}
+
+ WARN_ONCE(!irqs_disabled(),
+ "netpoll_send_skb(): %s enabled interrupts in poll (%pF)\n",
+ dev->name, ops->ndo_start_xmit);
+
local_irq_restore(flags);
}
--
1.6.0.4
^ permalink raw reply related
* Re: [PATCHv3 2/2] vhost_net: a kernel-level virtio server
From: Gleb Natapov @ 2009-08-21 13:20 UTC (permalink / raw)
To: Michael S. Tsirkin
Cc: Arnd Bergmann, virtualization, netdev, kvm, linux-kernel, mingo,
linux-mm, akpm, hpa, gregory.haskins, Or Gerlitz
In-Reply-To: <20090820133817.GA7834@redhat.com>
On Thu, Aug 20, 2009 at 04:38:17PM +0300, Michael S. Tsirkin wrote:
> On Thu, Aug 20, 2009 at 03:10:54PM +0200, Arnd Bergmann wrote:
> > On Thursday 20 August 2009, Michael S. Tsirkin wrote:
> > > On Wed, Aug 19, 2009 at 05:27:07PM +0200, Arnd Bergmann wrote:
> > > > On Wednesday 19 August 2009, Michael S. Tsirkin wrote:
> > > > > On Wed, Aug 19, 2009 at 03:46:44PM +0200, Arnd Bergmann wrote:
> > > > > > On Wednesday 19 August 2009, Michael S. Tsirkin wrote:
> > > > > >
> > > > > > Leaving that aside for now, you could replace VHOST_NET_SET_SOCKET,
> > > > > > VHOST_SET_OWNER, VHOST_RESET_OWNER
> > > > >
> > > > > SET/RESET OWNER is still needed: otherwise if you share a descriptor
> > > > > with another process, it can corrupt your memory.
> > > >
> > > > How? The point of using user threads is that you only ever access the
> > > > address space of the thread that called the ioctl.
> > >
> > > Think about this example with processes A and B sharing an fd:
> > > A does SET_USED_ADDRESS
> > > B does SET_USED_ADDRESS
> > > A does VHOST_NET_SPLICE
> > > See how stuff gets written into a random place in memory of A?
> >
> > Yes, I didn't think of that. It doesn't seem like a big problem
> > though, because it's a clear misuse of the API (I guess your
> > current code returns an error for one of the SET_USED_ADDRESS
> > ioctls), so I would see it as a classic garbage-in garbage-out
> > case.
> >
> > It may even work in the case that the sharing of the fd resulted
> > from a fork, where the address contains the same buffer in both
> > processes. I can't think of a reason why you would want to use
> > it like that though.
>
> It doesn't matter that I don't want this: allowing 1 process corrupt
> another's memory is a security issue. Once you get an fd, you want to
> be able to use it without worrying that a bug in another process will
> crash yours.
>
If B's SET_USED_ADDRESS fails how one process can corrupt a memory of
other process?
--
Gleb.
^ permalink raw reply
* Re: Abour linux driver supports BCM4325
From: Dan Williams @ 2009-08-21 13:13 UTC (permalink / raw)
To: feng tian; +Cc: netdev
In-Reply-To: <f42a38140908202322ua3d4486meae6653044465583@mail.gmail.com>
On Fri, 2009-08-21 at 14:22 +0800, feng tian wrote:
> Dear All,
>
> We are working on a project which supports the BCM4325 linux wireless
> driver. The interface between the BCM chip and SOC(pxa310) is SDIO.
> I did some searches online and found that there is no available driver
> for this chip. Do I have to implement this myself? Is there anyone can
> provide us some related materials? Thanks very much.
You'll probably want to ask on the linux-wireless list where the
wireless people hang out. Partial answer: there is already a driver
(b43) for many of broadcom 802.11 devices, including some of the
"LP-PHY" devices. This driver may or may not be suitable for the 4325
depending on the 4325's firmware interface. The b43 driver is not yet
capable of using SDIO to communicate with the wifi chip, but that
appears to be what you are working on. So I'd suggest posting to the
linux-wireless mailing list and seeing what the b43 driver people say.
http://linuxwireless.org/en/developers/MailingLists
Dan
^ permalink raw reply
* Re: sd8686 linux system hang: not always
From: Dan Williams @ 2009-08-21 13:04 UTC (permalink / raw)
To: Benoît Vaillant; +Cc: netdev
In-Reply-To: <20090820204051.GA24491@kaos.fbx.proxad.net>
On Thu, 2009-08-20 at 22:40 +0200, Benoît Vaillant wrote:
> On Wed, Aug 19, 2009 at 02:39:57PM -0500, Dan Williams wrote:
> > On Wed, 2009-08-19 at 20:56 +0200, Benoît Vaillant wrote:
> > > /*
> > > Just a bit of context information:
> > > I'm using an MID (quite close to an Aigo, although bios differs,
> > > probably some hardware too, yet I've not checked much on that). I'm
> > > trying to use my Marvell card to get wifi access on a debian
> > > installation. The other OS installed (midinux) successfully gets a
> > > connection using the 8686_v9 mobilin driver, so I'd not go for any
> > > hardware issue. This driver failing to compile 'out of the box' on
> > > fresh kernels, I thought getting the libertas module working would be
> > > a better way to get through.
> > > */
> > > <snip>
> >
> > Just for context, what SDIO controller are you using on this platform?
>
> Sure, i can provide that!
>
> lspci claims i's an:
> 00:e1.0 SD Host controler: Intel Corporation System Controller Hub (SCH Poulsbo) SDIO Controller #1 (rev 06)
> 00:e1.1 SD Host controler: Intel Corporation System Controller Hub (SCH Poulsbo) SDIO Controller #2 (rev 06)
>
> Complete `lspci -vvv` is attached.
>
> Could this lead to anything already known which i have might missed?
Well, besides the fact that the Poulsbo SDHC driver hasn't actually
passed review for the kernel yet... That doesn't mean the Poulsbo
driver isn't a fine driver, but if Pierre hasn't acked it, I don't
really trust it. The largest # of problems people have had with
Libertas SDIO have been with the host controller with things like
transfer widths, clocking, interrupt vs. polled mode, chunk size, etc.
When the SDHC driver and hardware they are using actually starts working
well, then libertas actually starts working well.
So I don't mean to brush you off, but we know the chip works pretty well
with the Ricoh line (which I'm typing this on right now with an sd8686)
and a few other embedded-type controllers. So I'd start diving down
into the SDHC driver code for Poulsbo and try to figure out what's going
on there and in the MMC layer.
Dan
^ permalink raw reply
* [PATCH net-next-2.6] fib_trie: resize rework
From: Jens Laas @ 2009-08-21 11:19 UTC (permalink / raw)
To: netdev
Here is rework and cleanup of the resize function.
Some bugs we had. We were using ->parent when we should use
node_parent(). Also we used ->parent which is not assigned by
inflate in inflate loop.
Also a fix to set thresholds to power 2 to fit halve
and double strategy.
max_resize is renamed to max_work which better indicates
it's function.
Reaching max_work is not an error, so warning is removed.
max_work only limits amount of work done per resize.
(limits CPU-usage, outstanding memory etc).
The clean-up makes it relatively easy to add fixed sized
root-nodes if we would like to decrease the memory pressure
on routers with large routing tables and dynamic routing.
If we'll need that...
Its been tested with 280k routes.
Work done together with Robert Olsson.
Signed-off-by: Jens Låås <jens.laas@its.uu.se>
---
net/ipv4/fib_trie.c | 95 ++++++++++++--------------------------------------
1 files changed, 23 insertions(+), 72 deletions(-)
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c
index fe3c846..291bdf5 100644
--- a/net/ipv4/fib_trie.c
+++ b/net/ipv4/fib_trie.c
@@ -48,7 +48,7 @@
* Patrick McHardy <kaber@trash.net>
*/
-#define VERSION "0.408"
+#define VERSION "0.409"
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -325,10 +325,7 @@ static inline void check_tnode(const struct tnode *tn)
static const int halve_threshold = 25;
static const int inflate_threshold = 50;
static const int halve_threshold_root = 15;
-static const int inflate_threshold_root = 25;
-
-static int inflate_threshold_root_fix;
-#define INFLATE_FIX_MAX 10 /* a comment in resize() */
+static const int inflate_threshold_root = 30;
static void __alias_free_mem(struct rcu_head *head)
{
@@ -516,14 +513,14 @@ static void tnode_put_child_reorg(struct tnode *tn, int i, struct node *n,
rcu_assign_pointer(tn->child[i], n);
}
+#define MAX_WORK 10
static struct node *resize(struct trie *t, struct tnode *tn)
{
int i;
- int err = 0;
struct tnode *old_tn;
int inflate_threshold_use;
int halve_threshold_use;
- int max_resize;
+ int max_work;
if (!tn)
return NULL;
@@ -538,18 +535,7 @@ static struct node *resize(struct trie *t, struct tnode *tn)
}
/* One child */
if (tn->empty_children == tnode_child_length(tn) - 1)
- for (i = 0; i < tnode_child_length(tn); i++) {
- struct node *n;
-
- n = tn->child[i];
- if (!n)
- continue;
-
- /* compress one level */
- node_set_parent(n, NULL);
- tnode_free_safe(tn);
- return n;
- }
+ goto one_child;
/*
* Double as long as the resulting node has a number of
* nonempty nodes that are above the threshold.
@@ -618,15 +604,17 @@ static struct node *resize(struct trie *t, struct tnode *tn)
/* Keep root node larger */
- if (!tn->parent)
- inflate_threshold_use = inflate_threshold_root +
- inflate_threshold_root_fix;
- else
+ if (!node_parent((struct node*) tn)) {
+ inflate_threshold_use = inflate_threshold_root;
+ halve_threshold_use = halve_threshold_root;
+ }
+ else {
inflate_threshold_use = inflate_threshold;
+ halve_threshold_use = halve_threshold;
+ }
- err = 0;
- max_resize = 10;
- while ((tn->full_children > 0 && max_resize-- &&
+ max_work = MAX_WORK;
+ while ((tn->full_children > 0 && max_work-- &&
50 * (tn->full_children + tnode_child_length(tn)
- tn->empty_children)
>= inflate_threshold_use * tnode_child_length(tn))) {
@@ -643,47 +631,19 @@ static struct node *resize(struct trie *t, struct tnode *tn)
}
}
- if (max_resize < 0) {
- if (!tn->parent) {
- /*
- * It was observed that during large updates even
- * inflate_threshold_root = 35 might be needed to avoid
- * this warning; but it should be temporary, so let's
- * try to handle this automatically.
- */
- if (inflate_threshold_root_fix < INFLATE_FIX_MAX)
- inflate_threshold_root_fix++;
- else
- pr_warning("Fix inflate_threshold_root."
- " Now=%d size=%d bits fix=%d\n",
- inflate_threshold_root, tn->bits,
- inflate_threshold_root_fix);
- } else {
- pr_warning("Fix inflate_threshold."
- " Now=%d size=%d bits\n",
- inflate_threshold, tn->bits);
- }
- } else if (max_resize > 3 && !tn->parent && inflate_threshold_root_fix)
- inflate_threshold_root_fix--;
-
check_tnode(tn);
+ /* Return if at least one inflate is run */
+ if( max_work != MAX_WORK)
+ return (struct node *) tn;
+
/*
* Halve as long as the number of empty children in this
* node is above threshold.
*/
-
- /* Keep root node larger */
-
- if (!tn->parent)
- halve_threshold_use = halve_threshold_root;
- else
- halve_threshold_use = halve_threshold;
-
- err = 0;
- max_resize = 10;
- while (tn->bits > 1 && max_resize-- &&
+ max_work = MAX_WORK;
+ while (tn->bits > 1 && max_work-- &&
100 * (tnode_child_length(tn) - tn->empty_children) <
halve_threshold_use * tnode_child_length(tn)) {
@@ -698,19 +658,10 @@ static struct node *resize(struct trie *t, struct tnode *tn)
}
}
- if (max_resize < 0) {
- if (!tn->parent)
- pr_warning("Fix halve_threshold_root."
- " Now=%d size=%d bits\n",
- halve_threshold_root, tn->bits);
- else
- pr_warning("Fix halve_threshold."
- " Now=%d size=%d bits\n",
- halve_threshold, tn->bits);
- }
/* Only one child remains */
- if (tn->empty_children == tnode_child_length(tn) - 1)
+ if (tn->empty_children == tnode_child_length(tn) - 1) {
+one_child:
for (i = 0; i < tnode_child_length(tn); i++) {
struct node *n;
@@ -724,7 +675,7 @@ static struct node *resize(struct trie *t, struct tnode *tn)
tnode_free_safe(tn);
return n;
}
-
+ }
return (struct node *) tn;
}
^ permalink raw reply related
* Re: [PATCH] Fix Micrel KSZ8842 Kconfig description
From: Richard Röjfors @ 2009-08-21 10:36 UTC (permalink / raw)
To: Andreas Mohr; +Cc: David Miller, netdev
In-Reply-To: <20090821102033.GA26577@rhlx01.hs-esslingen.de>
Andreas Mohr wrote:
> Hi,
>
> when doing a "make oldconfig" recently, non-descriptive item "Micrel KSZ8842"
> came up, and when I hit "?" to get more info, all I got was a tight-lipped
> "This platform driver is for Micrel KSZ8842 chip.".
I see your pain
>
> Thanks,
>
> Andreas Mohr
>
> Signed-off-by: Andreas Mohr <andi@lisas.de>
>
> --- linux-2.6.31-rc6/drivers/net/Kconfig.orig 2009-08-21 12:00:31.000000000 +0200
> +++ linux-2.6.31-rc6/drivers/net/Kconfig 2009-08-21 12:09:13.000000000 +0200
> @@ -1727,7 +1727,8 @@ config KS8842
> tristate "Micrel KSZ8842"
> depends on HAS_IOMEM
> help
> - This platform driver is for Micrel KSZ8842 chip.
> + This platform driver is for Micrel KSZ8842 / KS8842
> + 2-port ethernet switch chip (managed, VLAN, QoS, PCI-based).
Remove "PCI-based"
This is a platform device, it is not PCI based.
The KS8842 can sit behind PCI, ISA or VLB, this driver basically
supports the ISA mappings.
--Richard
^ permalink raw reply
* Re: Kernel oops on setting sky2 interfaces down
From: Mike McCormack @ 2009-08-21 11:03 UTC (permalink / raw)
To: Rene Mayrhofer; +Cc: Stephen Hemminger, netdev, Richard Leitner
In-Reply-To: <200908202237.43776.rene.mayrhofer@gibraltar.at>
2009/8/21 Rene Mayrhofer <rene.mayrhofer@gibraltar.at>:
> I've also tried the net-next-2.6 version of sky2.[ch] as of yesterday without
> Mike's "bandaid" patches. With that version (the last one in branch
> gibraltar-3.0 at https://www.gibraltar.at/git/linux-2.6-gibraltar.git), I
> managed to successfully do a networking restart (with "light" traffic on one
> interface), leaving the interfaces functional after the restart. This worked
> even twice in a row, so mabye we are onto something here. This is certainly an
> improvement over the version with Mike's last patch (from yesterday) applied,
> which left the interfaces broken after a restart (and with the quoted errors
> on a rmmod/modprobe sky2).
>
> However, after doing a ping -f on one of the (GBit) interfaces to another host
> on the same switch for a few seconds and then executing networking restart,
> the result was an immediate reboot of the box without any oops being printed
> to the (serial) console beforehand.
How about trying to remove the skge module, then running tests on the
sky2 interfaces only? This way you might be able isolate the
remaining problems to sky2 or skge...?
thanks,
Mike
^ permalink raw reply
* Re: [PATCH] Fix Micrel KSZ8842 Kconfig description
From: Andreas Mohr @ 2009-08-21 10:46 UTC (permalink / raw)
To: Richard Röjfors; +Cc: Andreas Mohr, David Miller, netdev
In-Reply-To: <4A8E78C1.20409@mocean-labs.com>
Hi,
On Fri, Aug 21, 2009 at 12:36:49PM +0200, Richard Röjfors wrote:
> Andreas Mohr wrote:
>> Hi,
>>
>> when doing a "make oldconfig" recently, non-descriptive item "Micrel KSZ8842"
>> came up, and when I hit "?" to get more info, all I got was a tight-lipped
>> "This platform driver is for Micrel KSZ8842 chip.".
>
> I see your pain
Thanks, and very fast reply too :)
> Remove "PCI-based"
>
> This is a platform device, it is not PCI based.
> The KS8842 can sit behind PCI, ISA or VLB, this driver basically
> supports the ISA mappings.
>
> --Richard
OK, I had added that because manufacturer specifications seemed to suggest
PCI use only. "platform device" should have been a warning sign I guess...
Signed-off-by: Andreas Mohr <andi@lisas.de>
--- linux-2.6.31-rc6/drivers/net/Kconfig.orig 2009-08-21 12:00:31.000000000 +0200
+++ linux-2.6.31-rc6/drivers/net/Kconfig 2009-08-21 12:41:48.000000000 +0200
@@ -1727,7 +1727,8 @@ config KS8842
tristate "Micrel KSZ8842"
depends on HAS_IOMEM
help
- This platform driver is for Micrel KSZ8842 chip.
+ This platform driver is for Micrel KSZ8842 / KS8842
+ 2-port ethernet switch chip (managed, VLAN, QoS).
config KS8851
tristate "Micrel KS8851 SPI"
^ permalink raw reply
* [PATCH] Fix Micrel KSZ8842 Kconfig description
From: Andreas Mohr @ 2009-08-21 10:20 UTC (permalink / raw)
To: David Miller; +Cc: Richard Rojfors, netdev
Hi,
when doing a "make oldconfig" recently, non-descriptive item "Micrel KSZ8842"
came up, and when I hit "?" to get more info, all I got was a tight-lipped
"This platform driver is for Micrel KSZ8842 chip.".
I don't need to know whether this is a platform driver or not, I want to
know _what_ the h*ll this thing does, to quickly decide
(and then get on with handling the other 150 upcoming config items)
whether the machine I'm running oldconfig on might actually have this
particular metal-pinned beast soldered somewhere or not.
Thanks,
Andreas Mohr
Signed-off-by: Andreas Mohr <andi@lisas.de>
--- linux-2.6.31-rc6/drivers/net/Kconfig.orig 2009-08-21 12:00:31.000000000 +0200
+++ linux-2.6.31-rc6/drivers/net/Kconfig 2009-08-21 12:09:13.000000000 +0200
@@ -1727,7 +1727,8 @@ config KS8842
tristate "Micrel KSZ8842"
depends on HAS_IOMEM
help
- This platform driver is for Micrel KSZ8842 chip.
+ This platform driver is for Micrel KSZ8842 / KS8842
+ 2-port ethernet switch chip (managed, VLAN, QoS, PCI-based).
config KS8851
tristate "Micrel KS8851 SPI"
^ permalink raw reply
* Re: Strange network timeouts w/ 2.6.30.5
From: Krzysztof Halasa @ 2009-08-21 9:44 UTC (permalink / raw)
To: Walt Holman; +Cc: David Miller, linux-kernel, netdev
In-Reply-To: <322550336.131250806883202.JavaMail.root@mail.holmansrus.com>
Walt Holman <walt@holmansrus.com> writes:
> Would something like passing a mem=xx cmdline on x86_64 be sufficient to test this?
I think so, though I admit I don't remember using this personally since
the introduction of e820 RAM mapping support.
Dmesg will show if the memory is limited. For the swiotlb to effectively
disable no RAM > 0x100000000 may be used.
But this test isn't IMHO terribly important at this point - the driver
makes invalid use of the DMA API and it has to change. The test could
only explain _how_ exactly does it fail, we already know _why_ it does.
--
Krzysztof Halasa
^ permalink raw reply
* Re: [PATCH,v3] Re: e1000e: why does pci_enable_pcie_error_reporting() fail on my hp2510p?
From: Frans Pop @ 2009-08-21 7:39 UTC (permalink / raw)
To: Jens Rosenboom
Cc: Danny Feng, Netdev, linux-kernel, Jeff Kirsher, David Miller
In-Reply-To: <1250838372.9489.8.camel@fnki-nb00130>
On Friday 21 August 2009, Jens Rosenboom wrote:
> While you're at it, why don't you also remove the "err =" here, which
> allows you to drop the variable from that function completely? This
> applies to all three *_remove() functions.
Argh! Sloppy. Shouldn't do this kind of thing before breakfast :-/
Thanks. Hope this version will pass muster.
From: Frans Pop <elendil@planet.nl>
Subject: net: Don't report an error if devices don't support AER
The only error returned by pci_{en,dis}able_pcie_error_reporting() is
-EIO which simply means that Advanced Error Reporting is not supported.
There is no need to report that, so remove the error check from e1001e,
igb and ixgbe.
Signed-off-by: Frans Pop <elendil@planet.nl>
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index fa92a68..2d421da 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -4983,12 +4983,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
goto err_pci_reg;
/* AER (Advanced Error Reporting) hooks */
- err = pci_enable_pcie_error_reporting(pdev);
- if (err) {
- dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed "
- "0x%x\n", err);
- /* non-fatal, continue */
- }
+ pci_enable_pcie_error_reporting(pdev);
pci_set_master(pdev);
/* PCI config space info */
@@ -5264,7 +5259,6 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct e1000_adapter *adapter = netdev_priv(netdev);
- int err;
/*
* flush_scheduled work may reschedule our watchdog task, so
@@ -5300,10 +5294,7 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
free_netdev(netdev);
/* AER disable */
- err = pci_disable_pcie_error_reporting(pdev);
- if (err)
- dev_err(&pdev->dev,
- "pci_disable_pcie_error_reporting failed 0x%x\n", err);
+ pci_disable_pcie_error_reporting(pdev);
pci_disable_device(pdev);
}
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index adb09d3..f4393df 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1232,12 +1232,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
if (err)
goto err_pci_reg;
- err = pci_enable_pcie_error_reporting(pdev);
- if (err) {
- dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed "
- "0x%x\n", err);
- /* non-fatal, continue */
- }
+ pci_enable_pcie_error_reporting(pdev);
pci_set_master(pdev);
pci_save_state(pdev);
@@ -1613,7 +1608,6 @@ static void __devexit igb_remove(struct pci_dev *pdev)
struct net_device *netdev = pci_get_drvdata(pdev);
struct igb_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
- int err;
/* flush_scheduled work may reschedule our watchdog task, so
* explicitly disable watchdog tasks from being rescheduled */
@@ -1667,10 +1661,7 @@ static void __devexit igb_remove(struct pci_dev *pdev)
free_netdev(netdev);
- err = pci_disable_pcie_error_reporting(pdev);
- if (err)
- dev_err(&pdev->dev,
- "pci_disable_pcie_error_reporting failed 0x%x\n", err);
+ pci_disable_pcie_error_reporting(pdev);
pci_disable_device(pdev);
}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 77b0381..6520496 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -5430,12 +5430,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
goto err_pci_reg;
}
- err = pci_enable_pcie_error_reporting(pdev);
- if (err) {
- dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed "
- "0x%x\n", err);
- /* non-fatal, continue */
- }
+ pci_enable_pcie_error_reporting(pdev);
pci_set_master(pdev);
pci_save_state(pdev);
@@ -5743,7 +5738,6 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
{
struct net_device *netdev = pci_get_drvdata(pdev);
struct ixgbe_adapter *adapter = netdev_priv(netdev);
- int err;
set_bit(__IXGBE_DOWN, &adapter->state);
/* clear the module not found bit to make sure the worker won't
@@ -5794,10 +5788,7 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
free_netdev(netdev);
- err = pci_disable_pcie_error_reporting(pdev);
- if (err)
- dev_err(&pdev->dev,
- "pci_disable_pcie_error_reporting failed 0x%x\n", err);
+ pci_disable_pcie_error_reporting(pdev);
pci_disable_device(pdev);
}
^ permalink raw reply related
* Re: [PATCH,v2] Re: e1000e: why does pci_enable_pcie_error_reporting() fail on my hp2510p?
From: Jens Rosenboom @ 2009-08-21 7:06 UTC (permalink / raw)
To: Frans Pop; +Cc: Danny Feng, Netdev, linux-kernel, Jeff Kirsher, David Miller
In-Reply-To: <200908210848.39377.elendil@planet.nl>
On Fri, 2009-08-21 at 08:48 +0200, Frans Pop wrote:
[...]
> @@ -5301,9 +5296,6 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
>
> /* AER disable */
> err = pci_disable_pcie_error_reporting(pdev);
> - if (err)
> - dev_err(&pdev->dev,
> - "pci_disable_pcie_error_reporting failed 0x%x\n", err);
>
> pci_disable_device(pdev);
> }
While you're at it, why don't you also remove the "err =" here, which
allows you to drop the variable from that function completely? This
applies to all three *_remove() functions.
^ permalink raw reply
* [PATCH] sctp: fix the check for path failure detection
From: Chunbo Luo @ 2009-08-21 7:04 UTC (permalink / raw)
To: davem; +Cc: netdev, linux-sctp, linux-kernel, chunbo.luo
The transport is marked DOWN immediately after sending the max+1 HB,
which is equal to not sending the max+1 HB at all. We should wait
a next period and make sure the last HB is not acknowledged.
Signed-off-by: Chunbo Luo <chunbo.luo@windriver.com>
---
include/net/sctp/command.h | 1 +
net/sctp/sm_sideeffect.c | 39 ++++++++++++++++++++++++++++-----------
net/sctp/sm_statefuns.c | 16 ++++++++++++++--
3 files changed, 43 insertions(+), 13 deletions(-)
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 3b96680..256effd 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -77,6 +77,7 @@ typedef enum {
SCTP_CMD_HB_TIMERS_START, /* Start the heartbeat timers. */
SCTP_CMD_HB_TIMER_UPDATE, /* Update a heartbeat timers. */
SCTP_CMD_HB_TIMERS_STOP, /* Stop the heartbeat timers. */
+ SCTP_CMD_PATH_FAILURE_DETECTION,/* Path failure detection. */
SCTP_CMD_TRANSPORT_HB_SENT, /* Reset the status of a transport. */
SCTP_CMD_TRANSPORT_IDLE, /* Do manipulations on idle transport */
SCTP_CMD_TRANSPORT_ON, /* Mark the transport as active. */
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
index 86426aa..db299c6 100644
--- a/net/sctp/sm_sideeffect.c
+++ b/net/sctp/sm_sideeffect.c
@@ -432,7 +432,25 @@ sctp_timer_event_t *sctp_timer_events[SCTP_NUM_TIMEOUT_TYPES] = {
* mark the destination transport address as inactive, and a
* notification SHOULD be sent to the upper layer.
*
+ * transport error counter is incremented in sctp_do_8_2_transport_strike
*/
+static void sctp_cmd_path_failure_detection(struct sctp_association *asoc,
+ struct sctp_transport *transport)
+{
+ if (transport->error_count > transport->pathmaxrxt) {
+ SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p",
+ " transport IP: port:%d failed.\n",
+ asoc,
+ (&transport->ipaddr),
+ ntohs(transport->ipaddr.v4.sin_port));
+ sctp_assoc_control_transport(asoc, transport,
+ SCTP_TRANSPORT_DOWN,
+ SCTP_FAILED_THRESHOLD);
+ }
+}
+
+
+ /* Mark a strike against a transport */
static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
struct sctp_transport *transport,
int is_hb)
@@ -446,17 +464,11 @@ static void sctp_do_8_2_transport_strike(struct sctp_association *asoc,
if (transport->state != SCTP_UNCONFIRMED)
asoc->overall_error_count++;
- if (transport->state != SCTP_INACTIVE &&
- (transport->error_count++ >= transport->pathmaxrxt)) {
- SCTP_DEBUG_PRINTK_IPADDR("transport_strike:association %p",
- " transport IP: port:%d failed.\n",
- asoc,
- (&transport->ipaddr),
- ntohs(transport->ipaddr.v4.sin_port));
- sctp_assoc_control_transport(asoc, transport,
- SCTP_TRANSPORT_DOWN,
- SCTP_FAILED_THRESHOLD);
- }
+ /* The check for transport's error counter exceeding the threshold
+ * is done in the state function.
+ */
+ if (transport->state != SCTP_INACTIVE)
+ transport->error_count++;
/* E2) For the destination address for which the timer
* expires, set RTO <- RTO * 2 ("back off the timer"). The
@@ -1464,6 +1476,11 @@ static int sctp_cmd_interpreter(sctp_event_t event_type,
0);
break;
+ case SCTP_CMD_PATH_FAILURE_DETECTION:
+ t = cmd->obj.transport;
+ sctp_cmd_path_failure_detection(asoc, t);
+ break;
+
case SCTP_CMD_TRANSPORT_IDLE:
t = cmd->obj.transport;
sctp_transport_lower_cwnd(t, SCTP_LOWER_CWND_INACTIVE);
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
index 7288192..f4c05fd 100644
--- a/net/sctp/sm_statefuns.c
+++ b/net/sctp/sm_statefuns.c
@@ -981,6 +981,9 @@ sctp_disposition_t sctp_sf_sendbeat_8_3(const struct sctp_endpoint *ep,
*/
if (transport->param_flags & SPP_HB_ENABLE) {
+ /* Do the path failure detection before send beat */
+ sctp_add_cmd_sf(commands, SCTP_CMD_PATH_FAILURE_DETECTION,
+ SCTP_TRANSPORT(transport));
if (SCTP_DISPOSITION_NOMEM ==
sctp_sf_heartbeat(ep, asoc, type, arg,
commands))
@@ -5229,6 +5232,8 @@ sctp_disposition_t sctp_sf_do_6_3_3_rtx(const struct sctp_endpoint *ep,
*/
/* Do some failure management (Section 8.2). */
+ sctp_add_cmd_sf(commands, SCTP_CMD_PATH_FAILURE_DETECTION,
+ SCTP_TRANSPORT(transport));
sctp_add_cmd_sf(commands, SCTP_CMD_STRIKE, SCTP_TRANSPORT(transport));
/* NB: Rules E4 and F1 are implicit in R1. */
@@ -5436,9 +5441,13 @@ sctp_disposition_t sctp_sf_t2_timer_expire(const struct sctp_endpoint *ep,
* If we remove the transport an SHUTDOWN was last sent to, don't
* do failure management.
*/
- if (asoc->shutdown_last_sent_to)
+ if (asoc->shutdown_last_sent_to) {
+ sctp_add_cmd_sf(commands, SCTP_CMD_PATH_FAILURE_DETECTION,
+ SCTP_TRANSPORT(asoc->shutdown_last_sent_to));
+
sctp_add_cmd_sf(commands, SCTP_CMD_STRIKE,
SCTP_TRANSPORT(asoc->shutdown_last_sent_to));
+ }
/* Set the transport for the SHUTDOWN/ACK chunk and the timeout for
* the T2-shutdown timer.
@@ -5475,9 +5484,12 @@ sctp_disposition_t sctp_sf_t4_timer_expire(
* detection on the appropriate destination address as defined in
* RFC2960 [5] section 8.1 and 8.2.
*/
- if (transport)
+ if (transport) {
+ sctp_add_cmd_sf(commands, SCTP_CMD_PATH_FAILURE_DETECTION,
+ SCTP_TRANSPORT(transport));
sctp_add_cmd_sf(commands, SCTP_CMD_STRIKE,
SCTP_TRANSPORT(transport));
+ }
/* Reconfig T4 timer and transport. */
sctp_add_cmd_sf(commands, SCTP_CMD_SETUP_T4, SCTP_CHUNK(chunk));
--
1.6.0.3
^ permalink raw reply related
* Re: [PATCH,v2] Re: e1000e: why does pci_enable_pcie_error_reporting() fail on my hp2510p?
From: Jeff Kirsher @ 2009-08-21 7:01 UTC (permalink / raw)
To: David Miller; +Cc: elendil, dfeng, netdev, linux-kernel
In-Reply-To: <20090820.235219.74114618.davem@davemloft.net>
On Thu, Aug 20, 2009 at 23:52, David Miller<davem@davemloft.net> wrote:
> From: Frans Pop <elendil@planet.nl>
> Date: Fri, 21 Aug 2009 08:48:38 +0200
>
>> From: Frans Pop <elendil@planet.nl>
>> Subject: net: Don't report an error if devices don't support AER
>>
>> The only error returned by pci_{en,dis}able_pcie_error_reporting() is
>> -EIO which simply means that Advanced Error Reporting is not supported.
>> There is no need to report that, so remove the error check from e1001e,
>> igb and ixgbe.
>>
>> Signed-off-by: Frans Pop <elendil@planet.nl>
>
> Intel folks, just let me know what you want me to do with this,
> if anything.
>
> Thanks.
> --
I will add it to my queue of patches. I would like to have Emil touch
test this patch at least before pushing the patch to Dave.
--
Cheers,
Jeff
^ permalink raw reply
* Re: [PATCH,v2] Re: e1000e: why does pci_enable_pcie_error_reporting() fail on my hp2510p?
From: David Miller @ 2009-08-21 6:52 UTC (permalink / raw)
To: elendil; +Cc: dfeng, netdev, linux-kernel, jeffrey.t.kirsher
In-Reply-To: <200908210848.39377.elendil@planet.nl>
From: Frans Pop <elendil@planet.nl>
Date: Fri, 21 Aug 2009 08:48:38 +0200
> From: Frans Pop <elendil@planet.nl>
> Subject: net: Don't report an error if devices don't support AER
>
> The only error returned by pci_{en,dis}able_pcie_error_reporting() is
> -EIO which simply means that Advanced Error Reporting is not supported.
> There is no need to report that, so remove the error check from e1001e,
> igb and ixgbe.
>
> Signed-off-by: Frans Pop <elendil@planet.nl>
Intel folks, just let me know what you want me to do with this,
if anything.
Thanks.
^ permalink raw reply
* [PATCH,v2] Re: e1000e: why does pci_enable_pcie_error_reporting() fail on my hp2510p?
From: Frans Pop @ 2009-08-21 6:48 UTC (permalink / raw)
To: Danny Feng; +Cc: Netdev, linux-kernel, Jeff Kirsher, David Miller
In-Reply-To: <4A8E3FC1.50201@redhat.com>
On Friday 21 August 2009, Danny Feng wrote:
> You may also need to silence pci_disable_pcie_error_reporting,
> otherwise rmmod/shutdown, you will get
>
> e1000e 0000:00:19.0: pci_disable_pcie_error_reporting failed
Yes, thanks. Exactly the same thing there. Updated patch below.
From: Frans Pop <elendil@planet.nl>
Subject: net: Don't report an error if devices don't support AER
The only error returned by pci_{en,dis}able_pcie_error_reporting() is
-EIO which simply means that Advanced Error Reporting is not supported.
There is no need to report that, so remove the error check from e1001e,
igb and ixgbe.
Signed-off-by: Frans Pop <elendil@planet.nl>
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c
index fa92a68..d67798f 100644
--- a/drivers/net/e1000e/netdev.c
+++ b/drivers/net/e1000e/netdev.c
@@ -4983,12 +4983,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
goto err_pci_reg;
/* AER (Advanced Error Reporting) hooks */
- err = pci_enable_pcie_error_reporting(pdev);
- if (err) {
- dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed "
- "0x%x\n", err);
- /* non-fatal, continue */
- }
+ pci_enable_pcie_error_reporting(pdev);
pci_set_master(pdev);
/* PCI config space info */
@@ -5301,9 +5296,6 @@ static void __devexit e1000_remove(struct pci_dev *pdev)
/* AER disable */
err = pci_disable_pcie_error_reporting(pdev);
- if (err)
- dev_err(&pdev->dev,
- "pci_disable_pcie_error_reporting failed 0x%x\n", err);
pci_disable_device(pdev);
}
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index adb09d3..1533d6f 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1232,12 +1232,7 @@ static int __devinit igb_probe(struct pci_dev *pdev,
if (err)
goto err_pci_reg;
- err = pci_enable_pcie_error_reporting(pdev);
- if (err) {
- dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed "
- "0x%x\n", err);
- /* non-fatal, continue */
- }
+ pci_enable_pcie_error_reporting(pdev);
pci_set_master(pdev);
pci_save_state(pdev);
@@ -1668,9 +1663,6 @@ static void __devexit igb_remove(struct pci_dev *pdev)
free_netdev(netdev);
err = pci_disable_pcie_error_reporting(pdev);
- if (err)
- dev_err(&pdev->dev,
- "pci_disable_pcie_error_reporting failed 0x%x\n", err);
pci_disable_device(pdev);
}
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 77b0381..777556d 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -5430,12 +5430,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
goto err_pci_reg;
}
- err = pci_enable_pcie_error_reporting(pdev);
- if (err) {
- dev_err(&pdev->dev, "pci_enable_pcie_error_reporting failed "
- "0x%x\n", err);
- /* non-fatal, continue */
- }
+ pci_enable_pcie_error_reporting(pdev);
pci_set_master(pdev);
pci_save_state(pdev);
@@ -5795,9 +5790,6 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
free_netdev(netdev);
err = pci_disable_pcie_error_reporting(pdev);
- if (err)
- dev_err(&pdev->dev,
- "pci_disable_pcie_error_reporting failed 0x%x\n", err);
pci_disable_device(pdev);
}
^ 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