提交 bff38771 编写于 作者: A Anton Vorontsov 提交者: David S. Miller

netpoll: Introduce netpoll_carrier_timeout kernel option

Some PHYs require longer timeouts for carrier detection, and
auto-negotiation process may take indefinite amount of time.

It may be inconvenient to force longer timeouts for sane PHYs,
so let's introduce a kernel command line option.

Since we're using module_param(), the option also can be
changed in runtime.
Signed-off-by: NAnton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 34701fde
...@@ -1531,6 +1531,11 @@ and is between 256 and 4096 characters. It is defined in the file ...@@ -1531,6 +1531,11 @@ and is between 256 and 4096 characters. It is defined in the file
symbolic names: lapic and ioapic symbolic names: lapic and ioapic
Example: nmi_watchdog=2 or nmi_watchdog=panic,lapic Example: nmi_watchdog=2 or nmi_watchdog=panic,lapic
netpoll.carrier_timeout=
[NET] Specifies amount of time (in seconds) that
netpoll should wait for a carrier. By default netpoll
waits 4 seconds.
no387 [BUGS=X86-32] Tells the kernel to use the 387 maths no387 [BUGS=X86-32] Tells the kernel to use the 387 maths
emulation library even if a 387 maths coprocessor emulation library even if a 387 maths coprocessor
is present. is present.
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
* Copyright (C) 2002 Red Hat, Inc. * Copyright (C) 2002 Red Hat, Inc.
*/ */
#include <linux/moduleparam.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/string.h> #include <linux/string.h>
...@@ -50,6 +51,9 @@ static atomic_t trapped; ...@@ -50,6 +51,9 @@ static atomic_t trapped;
static void zap_completion_queue(void); static void zap_completion_queue(void);
static void arp_reply(struct sk_buff *skb); static void arp_reply(struct sk_buff *skb);
static unsigned int carrier_timeout = 4;
module_param(carrier_timeout, uint, 0644);
static void queue_process(struct work_struct *work) static void queue_process(struct work_struct *work)
{ {
struct netpoll_info *npinfo = struct netpoll_info *npinfo =
...@@ -732,7 +736,7 @@ int netpoll_setup(struct netpoll *np) ...@@ -732,7 +736,7 @@ int netpoll_setup(struct netpoll *np)
} }
atleast = jiffies + HZ/10; atleast = jiffies + HZ/10;
atmost = jiffies + 4*HZ; atmost = jiffies + carrier_timeout * HZ;
while (!netif_carrier_ok(ndev)) { while (!netif_carrier_ok(ndev)) {
if (time_after(jiffies, atmost)) { if (time_after(jiffies, atmost)) {
printk(KERN_NOTICE printk(KERN_NOTICE
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册