Netdev List
 help / color / mirror / Atom feed
* r8169 ethernet hangs after a pm-suspend (and resume)
From: Alex Bennee @ 2009-09-09  7:13 UTC (permalink / raw)
  To: lkml, Francois Romieu, netdev

Hi,

I've just recently gotten suspend working on my system. Unfortunately
after the resume event I loose access to the network.
As far as the system is concerned the network is configured properly
but every attempt to ping local nodes fails with "Host not reachable".

If also seen an oops or two but I don't know id that is related:

[  289.816066] ------------[ cut here ]------------
[  289.816077] WARNING: at net/sched/sch_generic.c:246
dev_watchdog+0x132/0x1da()
[  289.816080] Hardware name: System Product Name
[  289.816083] NETDEV WATCHDOG: eth0 (r8169): transmit queue 0 timed
out
[  289.816085] Modules linked in: nls_iso8859_1 nls_cp437 vfat fat
joydev usb_storage usbhid usb_libusual bridge stp llc bnep rfcomm
l2cap bluetooth ipv6 snd_pcm_oss snd_mixer_oss snd_seq_oss
snd_seq_midi_event snd_seq snd_seq_device kvm_intel kvm acpi_cpufreq
snd_hda_codec_analog uhci_hcd usbcore snd_hda_intel snd_hda_codec
firewire_ohci snd_hwdep snd_pcm snd_timer snd firewire_core crc_itu_t
soundcore snd_page_alloc ide_cd_mod pcspkr evdev cdrom thermal
processor nls_base unix [last unloaded: ehci_hcd]
[  289.816135] Pid: 0, comm: swapper Not tainted
2.6.31-rc9-ajb-00012-g3ff323f-dirty #84
[  289.816138] Call Trace:
[  289.816140]  <IRQ>  [<ffffffff812aef27>] ? dev_watchdog+0x132/0x1da
[  289.816152]  [<ffffffff8103eb72>] warn_slowpath_common+0x7c/0xa9
[  289.816157]  [<ffffffff8103ec1e>] warn_slowpath_fmt+0x69/0x6b
[  289.816165]  [<ffffffffa0124cbb>] ? uhci_scan_schedule+0x194/0x86a
[uhci_hcd]
[  289.816169]  [<ffffffff81048fbc>] ? lock_timer_base+0x2b/0x4f
[  289.816174]  [<ffffffff81049699>] ? mod_timer+0x111/0x123
[  289.816180]  [<ffffffffa0125d9a>] ?
uhci_hub_status_data+0x16e/0x17d [uhci_hcd]
[  289.816185]  [<ffffffff8129d98d>] ? netdev_drivername+0x48/0x4f
[  289.816189]  [<ffffffff812aef27>] dev_watchdog+0x132/0x1da
[  289.816211]  [<ffffffffa00f0233>] ?
usb_hcd_poll_rh_status+0x144/0x153 [usbcore]
[  289.816215]  [<ffffffff812aedf5>] ? dev_watchdog+0x0/0x1da
[  289.816220]  [<ffffffff81048d76>] run_timer_softirq+0x198/0x20d
[  289.816226]  [<ffffffff8101d0c6>] ? lapic_next_event+0x1d/0x21
[  289.816231]  [<ffffffff8104464f>] __do_softirq+0xd6/0x19a
[  289.816235]  [<ffffffff8100c19c>] call_softirq+0x1c/0x28
[  289.816239]  [<ffffffff8100d51d>] do_softirq+0x39/0x77
[  289.816243]  [<ffffffff8104430c>] irq_exit+0x44/0x7e
[  289.816248]  [<ffffffff8130b164>]
smp_apic_timer_interrupt+0x8d/0x9b
[  289.816253]  [<ffffffff8100bb73>] apic_timer_interrupt+0x13/0x20
[  289.816256]  <EOI>  [<ffffffff810117ac>] ? mwait_idle+0xb9/0xf0
[  289.816264]  [<ffffffff81309645>] ?
atomic_notifier_call_chain+0x13/0x15
[  289.816268]  [<ffffffff8100a30a>] ? cpu_idle+0x57/0x98
[  289.816273]  [<ffffffff812f5422>] ? rest_init+0x66/0x68
[  289.816278]  [<ffffffff815319da>] ? start_kernel+0x343/0x34e
[  289.816283]  [<ffffffff8153103a>] ?
x86_64_start_reservations+0xaa/0xae
[  289.816287]  [<ffffffff8153111f>] ? x86_64_start_kernel+0xe1/0xe8
[  289.816290] ---[ end trace 01c3a2a7a5f34536 ]---
[  290.635368] r8169: eth0: link up
[  314.635844] r8169: eth0: link up

I'm currently running 2.6.31-rc9-ajb-00012-g3ff323f-dirty and am
willing to test any patches that might be going.

My card is:
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd.
RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)
	Subsystem: ASUSTeK Computer Inc. Device 81aa
	Flags: bus master, fast devsel, latency 0, IRQ 25
	I/O ports at e800 [size=256]
	Memory at dffff000 (64-bit, non-prefetchable) [size=4K]
	Memory at deff0000 (64-bit, prefetchable) [size=64K]
	Expansion ROM at dffc0000 [disabled] [size=128K]
	Capabilities: [40] Power Management version 2
	Capabilities: [50] Message Signalled Interrupts: Mask- 64bit- Count=1/1 Enable+
	Capabilities: [70] Express Endpoint, MSI 08
	Capabilities: [b0] MSI-X: Enable- Mask- TabSize=2
	Capabilities: [d0] Vital Product Data <?>
	Kernel driver in use: r8169


-- 
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk

^ permalink raw reply

* Re: [PATCH] net: Fix sock_wfree() race
From: Jike Song @ 2009-09-09  7:14 UTC (permalink / raw)
  To: Eric Dumazet, Linux Kernel Mailing List, netdev, David Miller,
	Parag Warudkar <parag.lkml
In-Reply-To: <4AA6DF7B.7060105@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3580 bytes --]

On Wed, Sep 9, 2009 at 6:49 AM, Eric Dumazet<eric.dumazet@gmail.com> wrote:
> Eric Dumazet a écrit :
>> Jike Song a écrit :
>>> On Tue, Sep 8, 2009 at 3:38 PM, Eric Dumazet<eric.dumazet@gmail.com> wrote:
>>>> We decrement a refcnt while object already freed.
>>>>
>>>> (SLUB DEBUG poisons the zone with 0x6B pattern)
>>>>
>>>> You might add this patch to trigger a WARN_ON when refcnt >= 0x60000000U
>>>> in sk_free() : We'll see the path trying to delete an already freed sock
>>>>
>>>> diff --git a/net/core/sock.c b/net/core/sock.c
>>>> index 7633422..1cb85ff 100644
>>>> --- a/net/core/sock.c
>>>> +++ b/net/core/sock.c
>>>> @@ -1058,6 +1058,7 @@ static void __sk_free(struct sock *sk)
>>>>
>>>>  void sk_free(struct sock *sk)
>>>>  {
>>>> +       WARN_ON(atomic_read(&sk->sk_wmem_alloc) >= 0x60000000U);
>>>>        /*
>>>>         * We substract one from sk_wmem_alloc and can know if
>>>>        * some packets are still in some tx queue.
>>>>
>>>>
>>> The output of dmesg with this patch appllied is attached.
>>>
>>>
>>
>> Unfortunatly this WARN_ON was not triggered,
>> maybe freeing comes from sock_wfree()
>>
>> Could you try this patch instead ?
>>
>> Thanks
>>
>> diff --git a/net/core/sock.c b/net/core/sock.c
>> index 7633422..30469dc 100644
>> --- a/net/core/sock.c
>> +++ b/net/core/sock.c
>> @@ -1058,6 +1058,7 @@ static void __sk_free(struct sock *sk)
>>
>>  void sk_free(struct sock *sk)
>>  {
>> +     WARN_ON(atomic_read(&sk->sk_wmem_alloc) >= 0x60000000U);
>>       /*
>>        * We substract one from sk_wmem_alloc and can know if
>>       * some packets are still in some tx queue.
>> @@ -1220,6 +1221,7 @@ void sock_wfree(struct sk_buff *skb)
>>       struct sock *sk = skb->sk;
>>       int res;
>>
>> +     WARN_ON(atomic_read(&sk->sk_wmem_alloc) >= 0x60000000U);
>>       /* In case it might be waiting for more memory. */
>>       res = atomic_sub_return(skb->truesize, &sk->sk_wmem_alloc);
>>       if (!sock_flag(sk, SOCK_USE_WRITE_QUEUE))
>>
>
>
> David, I believe problem could come from a race in sock_wfree()
>
> It used to have two atomic ops.
>
> One doing the atomic_sub(skb->truesize, &sk->sk_wmem_alloc);
> then one sock_put() doing the atomic_dec_and_test(&sk->sk_refcnt)
>
> Now, if two cpus are both :
>
> CPU 1 calling sock_wfree()
> CPU 2 calling the 'final' sock_put(),
> CPU 1 doing sock_wfree() might call sk->sk_write_space(sk)
> while CPU 2 is already freeing the socket.
>
>
> Please note I did not test this patch, its very late here and I should get some sleep now...
>
> Thanks
>
> [PATCH] net: Fix sock_wfree() race
>
> Commit 2b85a34e911bf483c27cfdd124aeb1605145dc80
> (net: No more expensive sock_hold()/sock_put() on each tx)
> opens a window in sock_wfree() where another cpu
> might free the socket we are working on.
>
> Fix is to call sk->sk_write_space(sk) only
> while still holding a reference on sk.
>
> Since doing this call is done before the
> atomic_sub(truesize, &sk->sk_wmem_alloc), we should pass truesize as
> a bias for possible sk_wmem_alloc evaluations.
>
> Reported-by: Jike Song <albcamus@gmail.com>
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Eric, I'm unable to apply this patch neatly.  I applied it by hand,
and did some change necessary. This patch for test is attached.

With this patch applied, when run vncviewer, the kerneloops service
still reports kernel failure. But I can't see any in dmesg output.


-- 
Thanks,
Jike

[-- Attachment #2: my.patch --]
[-- Type: application/octet-stream, Size: 12139 bytes --]

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 42b6c63..d1040fe 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -843,11 +843,11 @@ static struct rtnl_link_ops tun_link_ops __read_mostly = {
 	.validate	= tun_validate,
 };
 
-static void tun_sock_write_space(struct sock *sk)
+static void tun_sock_write_space(struct sock *sk, unsigned int bias)
 {
 	struct tun_struct *tun;
 
-	if (!sock_writeable(sk))
+	if (!sock_writeable_bias(sk, bias))
 		return;
 
 	if (!test_and_clear_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags))
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index 04dba23..f80ebff 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -23,7 +23,7 @@ struct svc_sock {
 	/* We keep the old state_change and data_ready CB's here */
 	void			(*sk_ostate)(struct sock *);
 	void			(*sk_odata)(struct sock *, int bytes);
-	void			(*sk_owspace)(struct sock *);
+	void			(*sk_owspace)(struct sock *, unsigned int bias);
 
 	/* private TCP part */
 	u32			sk_reclen;	/* length of record */
diff --git a/include/net/sock.h b/include/net/sock.h
index 950409d..5fee407 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -296,7 +296,7 @@ struct sock {
 	/* XXX 4 bytes hole on 64 bit */
 	void			(*sk_state_change)(struct sock *sk);
 	void			(*sk_data_ready)(struct sock *sk, int bytes);
-	void			(*sk_write_space)(struct sock *sk);
+	void			(*sk_write_space)(struct sock *sk, unsigned int bias);
 	void			(*sk_error_report)(struct sock *sk);
   	int			(*sk_backlog_rcv)(struct sock *sk,
 						  struct sk_buff *skb);  
@@ -554,7 +554,7 @@ static inline int sk_stream_wspace(struct sock *sk)
 	return sk->sk_sndbuf - sk->sk_wmem_queued;
 }
 
-extern void sk_stream_write_space(struct sock *sk);
+extern void sk_stream_write_space(struct sock *sk, unsigned int bias);
 
 static inline int sk_stream_memory_free(struct sock *sk)
 {
@@ -1433,6 +1433,11 @@ static inline int sock_writeable(const struct sock *sk)
 	return atomic_read(&sk->sk_wmem_alloc) < (sk->sk_sndbuf >> 1);
 }
 
+static inline int sock_writeable_bias(const struct sock *sk, unsigned int bias)
+{
+	return (atomic_read(&sk->sk_wmem_alloc) - bias) < (sk->sk_sndbuf >> 1);
+}
+
 static inline gfp_t gfp_any(void)
 {
 	return in_softirq() ? GFP_ATOMIC : GFP_KERNEL;
diff --git a/net/atm/raw.c b/net/atm/raw.c
index cbfcc71..ea14509 100644
--- a/net/atm/raw.c
+++ b/net/atm/raw.c
@@ -36,7 +36,7 @@ static void atm_pop_raw(struct atm_vcc *vcc,struct sk_buff *skb)
 		sk_wmem_alloc_get(sk), skb->truesize);
 	atomic_sub(skb->truesize, &sk->sk_wmem_alloc);
 	dev_kfree_skb_any(skb);
-	sk->sk_write_space(sk);
+	sk->sk_write_space(sk, 0);
 }
 
 
diff --git a/net/core/sock.c b/net/core/sock.c
index 7633422..b840c10 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -510,7 +510,7 @@ set_sndbuf:
 		 *	Wake up sending tasks if we
 		 *	upped the value.
 		 */
-		sk->sk_write_space(sk);
+		sk->sk_write_space(sk, 0);
 		break;
 
 	case SO_SNDBUFFORCE:
@@ -1220,10 +1220,10 @@ void sock_wfree(struct sk_buff *skb)
 	struct sock *sk = skb->sk;
 	int res;
 
-	/* In case it might be waiting for more memory. */
-	res = atomic_sub_return(skb->truesize, &sk->sk_wmem_alloc);
 	if (!sock_flag(sk, SOCK_USE_WRITE_QUEUE))
-		sk->sk_write_space(sk);
+		sk->sk_write_space(sk, skb->truesize);
+
+	res = atomic_sub_return(skb->truesize, &sk->sk_wmem_alloc);
 	/*
 	 * if sk_wmem_alloc reached 0, we are last user and should
 	 * free this sock, as sk_free() call could not do it.
@@ -1766,20 +1766,20 @@ static void sock_def_readable(struct sock *sk, int len)
 	read_unlock(&sk->sk_callback_lock);
 }
 
-static void sock_def_write_space(struct sock *sk)
+static void sock_def_write_space(struct sock *sk, unsigned int bias)
 {
 	read_lock(&sk->sk_callback_lock);
 
 	/* Do not wake up a writer until he can make "significant"
 	 * progress.  --DaveM
 	 */
-	if ((atomic_read(&sk->sk_wmem_alloc) << 1) <= sk->sk_sndbuf) {
+	if (((atomic_read(&sk->sk_wmem_alloc) - bias) << 1) <= sk->sk_sndbuf) {
 		if (sk_has_sleeper(sk))
 			wake_up_interruptible_sync_poll(sk->sk_sleep, POLLOUT |
 						POLLWRNORM | POLLWRBAND);
 
 		/* Should agree with poll, otherwise some programs break */
-		if (sock_writeable(sk))
+		if (sock_writeable_bias(sk, bias))
 			sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
 	}
 
diff --git a/net/core/stream.c b/net/core/stream.c
index a37debf..df720e9 100644
--- a/net/core/stream.c
+++ b/net/core/stream.c
@@ -25,7 +25,7 @@
  *
  * FIXME: write proper description
  */
-void sk_stream_write_space(struct sock *sk)
+void sk_stream_write_space(struct sock *sk, unsigned int bias)
 {
 	struct socket *sock = sk->sk_socket;
 
diff --git a/net/dccp/ccids/ccid3.c b/net/dccp/ccids/ccid3.c
index a27b7f4..bb9cf19 100644
--- a/net/dccp/ccids/ccid3.c
+++ b/net/dccp/ccids/ccid3.c
@@ -480,7 +480,7 @@ done_computing_x:
 	 * As we have calculated new ipi, delta, t_nom it is possible
 	 * that we now can send a packet, so wake up dccp_wait_for_ccid
 	 */
-	sk->sk_write_space(sk);
+	sk->sk_write_space(sk, 0);
 
 	/*
 	 * Update timeout interval for the nofeedback timer.
diff --git a/net/dccp/dccp.h b/net/dccp/dccp.h
index d6bc473..f32274f 100644
--- a/net/dccp/dccp.h
+++ b/net/dccp/dccp.h
@@ -235,7 +235,7 @@ extern void dccp_send_sync(struct sock *sk, const u64 seq,
 			   const enum dccp_pkt_type pkt_type);
 
 extern void dccp_write_xmit(struct sock *sk, int block);
-extern void dccp_write_space(struct sock *sk);
+extern void dccp_write_space(struct sock *sk, unsigned int);
 
 extern void dccp_init_xmit_timers(struct sock *sk);
 static inline void dccp_clear_xmit_timers(struct sock *sk)
diff --git a/net/dccp/output.c b/net/dccp/output.c
index c96119f..cf0635e 100644
--- a/net/dccp/output.c
+++ b/net/dccp/output.c
@@ -192,14 +192,14 @@ unsigned int dccp_sync_mss(struct sock *sk, u32 pmtu)
 
 EXPORT_SYMBOL_GPL(dccp_sync_mss);
 
-void dccp_write_space(struct sock *sk)
+void dccp_write_space(struct sock *sk, unsigned int bias)
 {
 	read_lock(&sk->sk_callback_lock);
 
 	if (sk_has_sleeper(sk))
 		wake_up_interruptible(sk->sk_sleep);
 	/* Should agree with poll, otherwise some programs break */
-	if (sock_writeable(sk))
+	if (sock_writeable_bias(sk, bias))
 		sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
 
 	read_unlock(&sk->sk_callback_lock);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 2bdb0da..9c24d07 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -4819,7 +4819,7 @@ static void tcp_new_space(struct sock *sk)
 		tp->snd_cwnd_stamp = tcp_time_stamp;
 	}
 
-	sk->sk_write_space(sk);
+	sk->sk_write_space(sk, 0);
 }
 
 static void tcp_check_space(struct sock *sk)
diff --git a/net/phonet/pep-gprs.c b/net/phonet/pep-gprs.c
index 480839d..18ccc24 100644
--- a/net/phonet/pep-gprs.c
+++ b/net/phonet/pep-gprs.c
@@ -38,7 +38,7 @@ struct gprs_dev {
 	struct sock		*sk;
 	void			(*old_state_change)(struct sock *);
 	void			(*old_data_ready)(struct sock *, int);
-	void			(*old_write_space)(struct sock *);
+	void			(*old_write_space)(struct sock *, unsigned int);
 
 	struct net_device	*dev;
 };
@@ -157,7 +157,7 @@ static void gprs_data_ready(struct sock *sk, int len)
 	}
 }
 
-static void gprs_write_space(struct sock *sk)
+static void gprs_write_space(struct sock *sk, unsigned int bias)
 {
 	struct gprs_dev *gp = sk->sk_user_data;
 
diff --git a/net/phonet/pep.c b/net/phonet/pep.c
index eef833e..0d15822 100644
--- a/net/phonet/pep.c
+++ b/net/phonet/pep.c
@@ -268,7 +268,7 @@ static int pipe_rcv_status(struct sock *sk, struct sk_buff *skb)
 		return -EOPNOTSUPP;
 	}
 	if (wake)
-		sk->sk_write_space(sk);
+		sk->sk_write_space(sk, 0);
 	return 0;
 }
 
@@ -389,7 +389,7 @@ static int pipe_do_rcv(struct sock *sk, struct sk_buff *skb)
 	case PNS_PIPE_ENABLED_IND:
 		if (!pn_flow_safe(pn->tx_fc)) {
 			atomic_set(&pn->tx_credits, 1);
-			sk->sk_write_space(sk);
+			sk->sk_write_space(sk, 0);
 		}
 		if (sk->sk_state == TCP_ESTABLISHED)
 			break; /* Nothing to do */
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c
index 23128ee..8c1642c 100644
--- a/net/sunrpc/svcsock.c
+++ b/net/sunrpc/svcsock.c
@@ -380,7 +380,7 @@ static void svc_sock_setbufsize(struct socket *sock, unsigned int snd,
 	sock->sk->sk_sndbuf = snd * 2;
 	sock->sk->sk_rcvbuf = rcv * 2;
 	sock->sk->sk_userlocks |= SOCK_SNDBUF_LOCK|SOCK_RCVBUF_LOCK;
-	sock->sk->sk_write_space(sock->sk);
+	sock->sk->sk_write_space(sock->sk, 0);
 	release_sock(sock->sk);
 #endif
 }
@@ -405,7 +405,7 @@ static void svc_udp_data_ready(struct sock *sk, int count)
 /*
  * INET callback when space is newly available on the socket.
  */
-static void svc_write_space(struct sock *sk)
+static void svc_write_space(struct sock *sk, unsigned int bias)
 {
 	struct svc_sock	*svsk = (struct svc_sock *)(sk->sk_user_data);
 
@@ -422,13 +422,13 @@ static void svc_write_space(struct sock *sk)
 	}
 }
 
-static void svc_tcp_write_space(struct sock *sk)
+static void svc_tcp_write_space(struct sock *sk, unsigned int bias)
 {
 	struct socket *sock = sk->sk_socket;
 
 	if (sk_stream_wspace(sk) >= sk_stream_min_wspace(sk) && sock)
 		clear_bit(SOCK_NOSPACE, &sock->flags);
-	svc_write_space(sk);
+	svc_write_space(sk, bias);
 }
 
 /*
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
index 83c73c4..11e4d35 100644
--- a/net/sunrpc/xprtsock.c
+++ b/net/sunrpc/xprtsock.c
@@ -262,7 +262,7 @@ struct sock_xprt {
 	 */
 	void			(*old_data_ready)(struct sock *, int);
 	void			(*old_state_change)(struct sock *);
-	void			(*old_write_space)(struct sock *);
+	void			(*old_write_space)(struct sock *, unsigned int);
 	void			(*old_error_report)(struct sock *);
 };
 
@@ -1491,12 +1491,12 @@ static void xs_write_space(struct sock *sk)
  * progress, otherwise we'll waste resources thrashing kernel_sendmsg
  * with a bunch of small requests.
  */
-static void xs_udp_write_space(struct sock *sk)
+static void xs_udp_write_space(struct sock *sk, unsigned int bias)
 {
 	read_lock(&sk->sk_callback_lock);
 
 	/* from net/core/sock.c:sock_def_write_space */
-	if (sock_writeable(sk))
+	if (sock_writeable_bias(sk, bias))
 		xs_write_space(sk);
 
 	read_unlock(&sk->sk_callback_lock);
@@ -1512,7 +1512,7 @@ static void xs_udp_write_space(struct sock *sk)
  * progress, otherwise we'll waste resources thrashing kernel_sendmsg
  * with a bunch of small requests.
  */
-static void xs_tcp_write_space(struct sock *sk)
+static void xs_tcp_write_space(struct sock *sk, unsigned int bias)
 {
 	read_lock(&sk->sk_callback_lock);
 
@@ -1535,7 +1535,7 @@ static void xs_udp_do_set_buffer_size(struct rpc_xprt *xprt)
 	if (transport->sndsize) {
 		sk->sk_userlocks |= SOCK_SNDBUF_LOCK;
 		sk->sk_sndbuf = transport->sndsize * xprt->max_reqs * 2;
-		sk->sk_write_space(sk);
+		sk->sk_write_space(sk, 0);
 	}
 }
 
diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index fc3ebb9..9f90ead 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -306,15 +306,15 @@ found:
 	return s;
 }
 
-static inline int unix_writable(struct sock *sk)
+static inline int unix_writable(struct sock *sk, unsigned int bias)
 {
-	return (atomic_read(&sk->sk_wmem_alloc) << 2) <= sk->sk_sndbuf;
+	return ((atomic_read(&sk->sk_wmem_alloc) - bias) << 2) <= sk->sk_sndbuf;
 }
 
-static void unix_write_space(struct sock *sk)
+static void unix_write_space(struct sock *sk, unsigned int bias)
 {
 	read_lock(&sk->sk_callback_lock);
-	if (unix_writable(sk)) {
+	if (unix_writable(sk, bias)) {
 		if (sk_has_sleeper(sk))
 			wake_up_interruptible_sync(sk->sk_sleep);
 		sk_wake_async(sk, SOCK_WAKE_SPACE, POLL_OUT);
@@ -2010,7 +2010,7 @@ static unsigned int unix_poll(struct file *file, struct socket *sock, poll_table
 	 * we set writable also when the other side has shut down the
 	 * connection. This prevents stuck sockets.
 	 */
-	if (unix_writable(sk))
+	if (unix_writable(sk, 0))
 		mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
 
 	return mask;
@@ -2048,7 +2048,7 @@ static unsigned int unix_dgram_poll(struct file *file, struct socket *sock,
 	}
 
 	/* writable? */
-	writable = unix_writable(sk);
+	writable = unix_writable(sk, 0);
 	if (writable) {
 		other = unix_peer_get(sk);
 		if (other) {

^ permalink raw reply related

* [PATCH] niu: Use resource_size instead of private function
From: Tobias Klauser @ 2009-09-09  7:25 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Tobias Klauser

The function res_size in drivers/net/niu.c is a copy of resource_size in
linux/ioport.h. Remove the function and use resource_size instead.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/net/niu.c |   23 +++++++++--------------
 1 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/drivers/net/niu.c b/drivers/net/niu.c
index 119fd4e..76cc261 100644
--- a/drivers/net/niu.c
+++ b/drivers/net/niu.c
@@ -10145,11 +10145,6 @@ static const struct niu_ops niu_phys_ops = {
 	.unmap_single	= niu_phys_unmap_single,
 };
 
-static unsigned long res_size(struct resource *r)
-{
-	return r->end - r->start + 1UL;
-}
-
 static int __devinit niu_of_probe(struct of_device *op,
 				  const struct of_device_id *match)
 {
@@ -10189,7 +10184,7 @@ static int __devinit niu_of_probe(struct of_device *op,
 	dev->features |= (NETIF_F_SG | NETIF_F_HW_CSUM);
 
 	np->regs = of_ioremap(&op->resource[1], 0,
-			      res_size(&op->resource[1]),
+			      resource_size(&op->resource[1]),
 			      "niu regs");
 	if (!np->regs) {
 		dev_err(&op->dev, PFX "Cannot map device registers, "
@@ -10199,7 +10194,7 @@ static int __devinit niu_of_probe(struct of_device *op,
 	}
 
 	np->vir_regs_1 = of_ioremap(&op->resource[2], 0,
-				    res_size(&op->resource[2]),
+				    resource_size(&op->resource[2]),
 				    "niu vregs-1");
 	if (!np->vir_regs_1) {
 		dev_err(&op->dev, PFX "Cannot map device vir registers 1, "
@@ -10209,7 +10204,7 @@ static int __devinit niu_of_probe(struct of_device *op,
 	}
 
 	np->vir_regs_2 = of_ioremap(&op->resource[3], 0,
-				    res_size(&op->resource[3]),
+				    resource_size(&op->resource[3]),
 				    "niu vregs-2");
 	if (!np->vir_regs_2) {
 		dev_err(&op->dev, PFX "Cannot map device vir registers 2, "
@@ -10244,19 +10239,19 @@ static int __devinit niu_of_probe(struct of_device *op,
 err_out_iounmap:
 	if (np->vir_regs_1) {
 		of_iounmap(&op->resource[2], np->vir_regs_1,
-			   res_size(&op->resource[2]));
+			   resource_size(&op->resource[2]));
 		np->vir_regs_1 = NULL;
 	}
 
 	if (np->vir_regs_2) {
 		of_iounmap(&op->resource[3], np->vir_regs_2,
-			   res_size(&op->resource[3]));
+			   resource_size(&op->resource[3]));
 		np->vir_regs_2 = NULL;
 	}
 
 	if (np->regs) {
 		of_iounmap(&op->resource[1], np->regs,
-			   res_size(&op->resource[1]));
+			   resource_size(&op->resource[1]));
 		np->regs = NULL;
 	}
 
@@ -10281,19 +10276,19 @@ static int __devexit niu_of_remove(struct of_device *op)
 
 		if (np->vir_regs_1) {
 			of_iounmap(&op->resource[2], np->vir_regs_1,
-				   res_size(&op->resource[2]));
+				   resource_size(&op->resource[2]));
 			np->vir_regs_1 = NULL;
 		}
 
 		if (np->vir_regs_2) {
 			of_iounmap(&op->resource[3], np->vir_regs_2,
-				   res_size(&op->resource[3]));
+				   resource_size(&op->resource[3]));
 			np->vir_regs_2 = NULL;
 		}
 
 		if (np->regs) {
 			of_iounmap(&op->resource[1], np->regs,
-				   res_size(&op->resource[1]));
+				   resource_size(&op->resource[1]));
 			np->regs = NULL;
 		}
 
-- 
1.6.0.4


^ permalink raw reply related

* Re: [PATCH 00/14] pktgen update for net-next (2.6.32)
From: Jesper Dangaard Brouer @ 2009-09-09  7:53 UTC (permalink / raw)
  To: robert
  Cc: Stephen Hemminger, David Miller, Robert Olsson, netdev,
	Thomas Gleixner
In-Reply-To: <19110.31505.134937.813631@gargle.gargle.HOWL>

On Tue, 8 Sep 2009, robert@herjulf.net wrote:

>> With patches:
>> -------------
>> tx_pkt_sz: 64  TX-pps: 9426724
>
> Impressive. 82599 seems fast. Didn't you report even higher number
> with other CPU's?

Yes, the Core i7 is even faster... but currently I'm not using it as a 
generator, its the router in my current setup.

Once I have finished my slides and last tests for LinuxCon.  I'll run some 
pktgen tests with the Core i7 and post the results.

Cheers,
   Jesper Brouer

--
-------------------------------------------------------------------
MSc. Master of Computer Science
Dept. of Computer Science, University of Copenhagen
Author of http://www.adsl-optimizer.dk
-------------------------------------------------------------------

^ permalink raw reply

* Re: [PATCH] niu: Use resource_size instead of private function
From: David Miller @ 2009-09-09  8:41 UTC (permalink / raw)
  To: tklauser; +Cc: netdev
In-Reply-To: <1252481150-12166-1-git-send-email-tklauser@distanz.ch>

From: Tobias Klauser <tklauser@distanz.ch>
Date: Wed,  9 Sep 2009 09:25:50 +0200

> The function res_size in drivers/net/niu.c is a copy of resource_size in
> linux/ioport.h. Remove the function and use resource_size instead.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>

Patch applied, thank you.

^ permalink raw reply

* Re: [PATCH] net: Fix sock_wfree() race
From: Eric Dumazet @ 2009-09-09  9:18 UTC (permalink / raw)
  To: Jike Song; +Cc: Linux Kernel Mailing List, netdev, David Miller, Parag Warudkar
In-Reply-To: <df9815e70909090014w27828827j860ecee4f1c3a9e2@mail.gmail.com>

Jike Song a écrit :
> On Wed, Sep 9, 2009 at 6:49 AM, Eric Dumazet<eric.dumazet@gmail.com> wrote:
>> Eric Dumazet a écrit :
>>> Jike Song a écrit :
>>>> On Tue, Sep 8, 2009 at 3:38 PM, Eric Dumazet<eric.dumazet@gmail.com> wrote:
>>>>> We decrement a refcnt while object already freed.
>>>>>
>>>>> (SLUB DEBUG poisons the zone with 0x6B pattern)
>>>>>
>>>>> You might add this patch to trigger a WARN_ON when refcnt >= 0x60000000U
>>>>> in sk_free() : We'll see the path trying to delete an already freed sock
>>>>>
>>>>> diff --git a/net/core/sock.c b/net/core/sock.c
>>>>> index 7633422..1cb85ff 100644
>>>>> --- a/net/core/sock.c
>>>>> +++ b/net/core/sock.c
>>>>> @@ -1058,6 +1058,7 @@ static void __sk_free(struct sock *sk)
>>>>>
>>>>>  void sk_free(struct sock *sk)
>>>>>  {
>>>>> +       WARN_ON(atomic_read(&sk->sk_wmem_alloc) >= 0x60000000U);
>>>>>        /*
>>>>>         * We substract one from sk_wmem_alloc and can know if
>>>>>        * some packets are still in some tx queue.
>>>>>
>>>>>
>>>> The output of dmesg with this patch appllied is attached.
>>>>
>>>>
>>> Unfortunatly this WARN_ON was not triggered,
>>> maybe freeing comes from sock_wfree()
>>>
>>> Could you try this patch instead ?
>>>
>>> Thanks
>>>
>>> diff --git a/net/core/sock.c b/net/core/sock.c
>>> index 7633422..30469dc 100644
>>> --- a/net/core/sock.c
>>> +++ b/net/core/sock.c
>>> @@ -1058,6 +1058,7 @@ static void __sk_free(struct sock *sk)
>>>
>>>  void sk_free(struct sock *sk)
>>>  {
>>> +     WARN_ON(atomic_read(&sk->sk_wmem_alloc) >= 0x60000000U);
>>>       /*
>>>        * We substract one from sk_wmem_alloc and can know if
>>>       * some packets are still in some tx queue.
>>> @@ -1220,6 +1221,7 @@ void sock_wfree(struct sk_buff *skb)
>>>       struct sock *sk = skb->sk;
>>>       int res;
>>>
>>> +     WARN_ON(atomic_read(&sk->sk_wmem_alloc) >= 0x60000000U);
>>>       /* In case it might be waiting for more memory. */
>>>       res = atomic_sub_return(skb->truesize, &sk->sk_wmem_alloc);
>>>       if (!sock_flag(sk, SOCK_USE_WRITE_QUEUE))
>>>
>>
>> David, I believe problem could come from a race in sock_wfree()
>>
>> It used to have two atomic ops.
>>
>> One doing the atomic_sub(skb->truesize, &sk->sk_wmem_alloc);
>> then one sock_put() doing the atomic_dec_and_test(&sk->sk_refcnt)
>>
>> Now, if two cpus are both :
>>
>> CPU 1 calling sock_wfree()
>> CPU 2 calling the 'final' sock_put(),
>> CPU 1 doing sock_wfree() might call sk->sk_write_space(sk)
>> while CPU 2 is already freeing the socket.
>>
>>
>> Please note I did not test this patch, its very late here and I should get some sleep now...
>>
>> Thanks
>>
>> [PATCH] net: Fix sock_wfree() race
>>
>> Commit 2b85a34e911bf483c27cfdd124aeb1605145dc80
>> (net: No more expensive sock_hold()/sock_put() on each tx)
>> opens a window in sock_wfree() where another cpu
>> might free the socket we are working on.
>>
>> Fix is to call sk->sk_write_space(sk) only
>> while still holding a reference on sk.
>>
>> Since doing this call is done before the
>> atomic_sub(truesize, &sk->sk_wmem_alloc), we should pass truesize as
>> a bias for possible sk_wmem_alloc evaluations.
>>
>> Reported-by: Jike Song <albcamus@gmail.com>
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> 
> Eric, I'm unable to apply this patch neatly.  I applied it by hand,
> and did some change necessary. This patch for test is attached.
> 
> With this patch applied, when run vncviewer, the kerneloops service
> still reports kernel failure. But I can't see any in dmesg output.
> 
> 

Sorry this was a patch against net-next-2.6

We probably can do something less intrusive for linux-2.6.31

[PATCH] net: Fix sock_wfree() race

Commit 2b85a34e911bf483c27cfdd124aeb1605145dc80
(net: No more expensive sock_hold()/sock_put() on each tx)
opens a window in sock_wfree() where another cpu
might free the socket we are working on.

A possible fix is to call sk->sk_write_space(sk) only
while still holding a reference on sk.


Reported-by: Jike Song <albcamus@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---

diff --git a/net/core/sock.c b/net/core/sock.c
index 7633422..aba5cd0 100644
--- a/net/core/sock.c
+++ b/net/core/sock.c
@@ -1220,10 +1220,12 @@ void sock_wfree(struct sk_buff *skb)
 	struct sock *sk = skb->sk;
 	int res;

-	/* In case it might be waiting for more memory. */
-	res = atomic_sub_return(skb->truesize, &sk->sk_wmem_alloc);
-	if (!sock_flag(sk, SOCK_USE_WRITE_QUEUE))
+	if (!sock_flag(sk, SOCK_USE_WRITE_QUEUE)) {
+		atomic_sub(skb->truesize - 1, &sk->sk_wmem_alloc);
 		sk->sk_write_space(sk);
+		res = atomic_sub_return(1, &sk->sk_wmem_alloc);
+	} else
+		res = atomic_sub_return(skb->truesize, &sk->sk_wmem_alloc);
 	/*
 	 * if sk_wmem_alloc reached 0, we are last user and should
 	 * free this sock, as sk_free() call could not do it.

^ permalink raw reply related

* Re: r8169 ethernet hangs after a pm-suspend (and resume)
From: Francois Romieu @ 2009-09-09  9:28 UTC (permalink / raw)
  To: Alex Bennee; +Cc: lkml, netdev
In-Reply-To: <b2cdc9f30909090013q1741da26la73da66f1eef975f@mail.gmail.com>

Alex Bennee <kernel-hacker@bennee.com> :
[...]
> I've just recently gotten suspend working on my system. Unfortunately
> after the resume event I loose access to the network.
> As far as the system is concerned the network is configured properly
> but every attempt to ping local nodes fails with "Host not reachable".

Can the problem be described as "gigabit link setting does not survive
suspend/resume" ?

-- 
Ueimor

^ permalink raw reply

* Re: r8169 ethernet hangs after a pm-suspend (and resume)
From: Alex Bennee @ 2009-09-09  9:37 UTC (permalink / raw)
  To: Francois Romieu; +Cc: lkml, netdev
In-Reply-To: <20090909092822.GA18355@electric-eye.fr.zoreil.com>

2009/9/9 Francois Romieu <romieu@fr.zoreil.com>:
> Alex Bennee <kernel-hacker@bennee.com> :
> [...]
>> I've just recently gotten suspend working on my system. Unfortunately
>> after the resume event I loose access to the network.
>> As far as the system is concerned the network is configured properly
>> but every attempt to ping local nodes fails with "Host not reachable".
>
> Can the problem be described as "gigabit link setting does not survive
> suspend/resume" ?

How could I check?

AFAIK my network only runs at 100Mbs anyway. I tried poking about with
ethtool to see if could determine any more diagnostics but it didn't know
much about the card.

>
> --
> Ueimor
>



-- 
Alex, homepage: http://www.bennee.com/~alex/
http://www.half-llama.co.uk

^ permalink raw reply

* [PATCH 2/2] cdc-phonet: autoconfigure Phonet address
From: Rémi Denis-Courmont @ 2009-09-09 10:00 UTC (permalink / raw)
  To: netdev; +Cc: Rémi Denis-Courmont
In-Reply-To: <1252490406-27951-1-git-send-email-remi@remlab.net>

From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
 drivers/net/usb/cdc-phonet.c |   15 +++++++++++++++
 include/linux/phonet.h       |    3 +++
 2 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
index 0ca5916..97e54d9 100644
--- a/drivers/net/usb/cdc-phonet.c
+++ b/drivers/net/usb/cdc-phonet.c
@@ -27,6 +27,7 @@
 #include <linux/netdevice.h>
 #include <linux/if_arp.h>
 #include <linux/if_phonet.h>
+#include <linux/phonet.h>
 
 #define PN_MEDIA_USB	0x1B
 
@@ -256,6 +257,19 @@ static int usbpn_close(struct net_device *dev)
 	return usb_set_interface(pnd->usb, num, !pnd->active_setting);
 }
 
+static int usbpn_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
+{
+	struct if_phonet_req *req = (struct if_phonet_req *)ifr;
+
+	switch (cmd) {
+	case SIOCPNGAUTOCONF:
+		req->ifr_phonet_autoconf.device = PN_DEV_PC;
+		printk(KERN_CRIT"device is PN_DEV_PC\n");
+		return 0;
+	}
+	return -ENOIOCTLCMD;
+}
+
 static int usbpn_set_mtu(struct net_device *dev, int new_mtu)
 {
 	if ((new_mtu < PHONET_MIN_MTU) || (new_mtu > PHONET_MAX_MTU))
@@ -269,6 +283,7 @@ static const struct net_device_ops usbpn_ops = {
 	.ndo_open	= usbpn_open,
 	.ndo_stop	= usbpn_close,
 	.ndo_start_xmit = usbpn_xmit,
+	.ndo_do_ioctl	= usbpn_ioctl,
 	.ndo_change_mtu = usbpn_set_mtu,
 };
 
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index 82b45d1..1ef5a07 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -99,6 +99,9 @@ struct sockaddr_pn {
 	__u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3];
 } __attribute__ ((packed));
 
+/* Well known address */
+#define PN_DEV_PC	0x10
+
 static inline __u16 pn_object(__u8 addr, __u16 port)
 {
 	return (addr << 8) | (port & 0x3ff);
-- 
1.6.0.4


^ permalink raw reply related

* [PATCH] Phonet: fix netlink address dump error handling
From: Rémi Denis-Courmont @ 2009-09-09  9:59 UTC (permalink / raw)
  To: netdev; +Cc: Rémi Denis-Courmont

From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
 net/phonet/pn_netlink.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/phonet/pn_netlink.c b/net/phonet/pn_netlink.c
index f8b4cee..d21fd35 100644
--- a/net/phonet/pn_netlink.c
+++ b/net/phonet/pn_netlink.c
@@ -147,7 +147,7 @@ static int getaddr_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
 
 			if (fill_addr(skb, pnd->netdev, addr << 2,
 					 NETLINK_CB(cb->skb).pid,
-					cb->nlh->nlmsg_seq, RTM_NEWADDR))
+					cb->nlh->nlmsg_seq, RTM_NEWADDR) < 0)
 				goto out;
 		}
 	}
-- 
1.6.0.4


^ permalink raw reply related

* [PATCH 1/2] Phonet: back-end for autoconfigured addresses
From: Rémi Denis-Courmont @ 2009-09-09 10:00 UTC (permalink / raw)
  To: netdev; +Cc: Rémi Denis-Courmont

From: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>

In some cases, the network device driver knows what layer-3 address the
device should have. This adds support for the Phonet stack to
automatically request from the driver and add that address to the
network device.

Signed-off-by: Rémi Denis-Courmont <remi.denis-courmont@nokia.com>
---
 include/linux/phonet.h |   17 +++++++++++++++++
 net/phonet/pn_dev.c    |   26 +++++++++++++++++++++++++-
 2 files changed, 42 insertions(+), 1 deletions(-)

diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index ee5e3c9..82b45d1 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -170,4 +170,21 @@ static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn)
 	return spn->spn_resource;
 }
 
+/* Phonet device ioctl requests */
+#ifdef __KERNEL__
+#define SIOCPNGAUTOCONF		(SIOCDEVPRIVATE + 0)
+
+struct if_phonet_autoconf {
+	uint8_t device;
+};
+
+struct if_phonet_req {
+	char ifr_phonet_name[16];
+	union {
+		struct if_phonet_autoconf ifru_phonet_autoconf;
+	} ifr_ifru;
+};
+#define ifr_phonet_autoconf ifr_ifru.ifru_phonet_autoconf
+#endif /* __KERNEL__ */
+
 #endif
diff --git a/net/phonet/pn_dev.c b/net/phonet/pn_dev.c
index 5ae4c01..2f65dca 100644
--- a/net/phonet/pn_dev.c
+++ b/net/phonet/pn_dev.c
@@ -28,6 +28,7 @@
 #include <linux/netdevice.h>
 #include <linux/phonet.h>
 #include <linux/proc_fs.h>
+#include <linux/if_arp.h>
 #include <net/sock.h>
 #include <net/netns/generic.h>
 #include <net/phonet/pn_dev.h>
@@ -195,14 +196,37 @@ found:
 	return err;
 }
 
+/* automatically configure a Phonet device, if supported */
+static int phonet_device_autoconf(struct net_device *dev)
+{
+	struct if_phonet_req req;
+	int ret;
+
+	if (!dev->netdev_ops->ndo_do_ioctl)
+		return -EOPNOTSUPP;
+
+	ret = dev->netdev_ops->ndo_do_ioctl(dev, (struct ifreq *)&req,
+						SIOCPNGAUTOCONF);
+	if (ret < 0)
+		return ret;
+	return phonet_address_add(dev, req.ifr_phonet_autoconf.device);
+}
+
 /* notify Phonet of device events */
 static int phonet_device_notify(struct notifier_block *me, unsigned long what,
 				void *arg)
 {
 	struct net_device *dev = arg;
 
-	if (what == NETDEV_UNREGISTER)
+	switch (what) {
+	case NETDEV_REGISTER:
+		if (dev->type == ARPHRD_PHONET)
+			phonet_device_autoconf(dev);
+		break;
+	case NETDEV_UNREGISTER:
 		phonet_device_destroy(dev);
+		break;
+	}
 	return 0;
 
 }
-- 
1.6.0.4


^ permalink raw reply related

* Re: [PATCH 2/2] cdc-phonet: autoconfigure Phonet address
From: Marcel Holtmann @ 2009-09-09 10:24 UTC (permalink / raw)
  To: Rémi Denis-Courmont; +Cc: netdev, Rémi Denis-Courmont
In-Reply-To: <1252490406-27951-2-git-send-email-remi@remlab.net>

Hi Remi,

>  drivers/net/usb/cdc-phonet.c |   15 +++++++++++++++
>  include/linux/phonet.h       |    3 +++
>  2 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/net/usb/cdc-phonet.c b/drivers/net/usb/cdc-phonet.c
> index 0ca5916..97e54d9 100644
> --- a/drivers/net/usb/cdc-phonet.c
> +++ b/drivers/net/usb/cdc-phonet.c
> @@ -27,6 +27,7 @@
>  #include <linux/netdevice.h>
>  #include <linux/if_arp.h>
>  #include <linux/if_phonet.h>
> +#include <linux/phonet.h>
>  
>  #define PN_MEDIA_USB	0x1B
>  
> @@ -256,6 +257,19 @@ static int usbpn_close(struct net_device *dev)
>  	return usb_set_interface(pnd->usb, num, !pnd->active_setting);
>  }
>  
> +static int usbpn_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
> +{
> +	struct if_phonet_req *req = (struct if_phonet_req *)ifr;
> +
> +	switch (cmd) {
> +	case SIOCPNGAUTOCONF:
> +		req->ifr_phonet_autoconf.device = PN_DEV_PC;
> +		printk(KERN_CRIT"device is PN_DEV_PC\n");
> +		return 0;
> +	}
> +	return -ENOIOCTLCMD;
> +}
> +

am I understanding this correctly, that even for the USB ones we still
have to execute that ioctl() and can not just auto configure them all
the time? For the USB ones, I would expect to should plug them in and
they are getting configured right away.

Regards

Marcel



^ permalink raw reply

* Re: [PATCH 2/2] cdc-phonet: autoconfigure Phonet address
From: Rémi Denis-Courmont @ 2009-09-09 10:28 UTC (permalink / raw)
  To: Marcel Holtmann; +Cc: netdev
In-Reply-To: <1252491850.8931.28.camel@violet>


On Wed, 09 Sep 2009 12:24:10 +0200, Marcel Holtmann <marcel@holtmann.org>
wrote:
> am I understanding this correctly, that even for the USB ones we still
> have to execute that ioctl() and can not just auto configure them all
> the time? For the USB ones, I would expect to should plug them in and
> they are getting configured right away.

The other patch makes the stack use the ioctl() internally.
But now I see that I forgot some debug statement :(

Still, something needs to ifconfig up/ip link set up.

-- 
Rémi Denis-Courmont


^ permalink raw reply

* Re: [PATCH 2/2] cdc-phonet: autoconfigure Phonet address
From: Marcel Holtmann @ 2009-09-09 10:33 UTC (permalink / raw)
  To: Rémi Denis-Courmont; +Cc: netdev
In-Reply-To: <1f7692749ea7722ba7f7f4ff9f86acd2@chewa.net>

Hi Remi,

> > am I understanding this correctly, that even for the USB ones we still
> > have to execute that ioctl() and can not just auto configure them all
> > the time? For the USB ones, I would expect to should plug them in and
> > they are getting configured right away.
> 
> The other patch makes the stack use the ioctl() internally.
> But now I see that I forgot some debug statement :(
> 
> Still, something needs to ifconfig up/ip link set up.

the ifup/ifdown is fine. And if the addresses get set when I plug the
device in, that looks good to me.

Regards

Marcel



^ permalink raw reply

* Re: [PATCH resend] s2io: Remove unnecessary casts
From: David Miller @ 2009-09-09 10:40 UTC (permalink / raw)
  To: dave; +Cc: netdev, kernel-janitors
In-Reply-To: <1252384015.6396.11.camel@dbueso-pc>

From: Davidlohr Bueso <dave@gnu.org>
Date: Tue, 08 Sep 2009 00:26:55 -0400

> Hi David,
> 
> Don't know why my email client corrupted the patch, anyways, here it is without white spaces.
> 
> No need to cast kmalloc.
> 
> Thanks,
> Davidlohr
> 
> 
> Signed-off-by: Davidlohr Bueso <dave@gnu.org>

Since you last submitted this patch a large series of cleanup
patches were added to this driver in the net-next-2.6 tree
and as a result your patch no longer applies properly.

You'll need to respin these changes and make sure they
apply cleanly to net-next-2.6

Thanks.

^ permalink raw reply

* Re: [PATCH] IPv6/addrconf: Fix minor addrlabel thinko
From: David Miller @ 2009-09-09 10:42 UTC (permalink / raw)
  To: tgohad; +Cc: yoshfuji, netdev
In-Reply-To: <4AA5F3D3.80706@mvista.com>

From: Tushar Gohad <tgohad@mvista.com>
Date: Mon, 07 Sep 2009 23:04:03 -0700

> 
> Fix apparent thinko related to RTM_DELADDRLABEL, introduced by commit 2a8cc6c89039e0530a3335954253b76ed0f9339a.
> 
> 
> Signed-off-by: Tushar Gohad <tgohad@mvista.com>

Looks good to me, applied to net-next-2.6, thanks.

^ permalink raw reply

* Re: [PATCH] headers: net/ipv[46]/protocol.c header trim
From: David Miller @ 2009-09-09 10:43 UTC (permalink / raw)
  To: adobriyan; +Cc: netdev
In-Reply-To: <20090907123825.GB29858@x200.localdomain>

From: Alexey Dobriyan <adobriyan@gmail.com>
Date: Mon, 7 Sep 2009 16:38:25 +0400

> Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Applied, thanks.

^ permalink raw reply

* [PATCH] dm9000: Remove unnecessary memset of netdev private data
From: Tobias Klauser @ 2009-09-09 11:07 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Tobias Klauser
In-Reply-To: <1252494464-4633-1-git-send-email-tklauser@distanz.ch>

The memory for the private data is allocated using kzalloc in
alloc_etherdev (or alloc_netdev_mq respectively) so there is no need to
set it to 0 again.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/net/dm9000.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index 00a9db8..11995ad 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -1213,7 +1213,6 @@ dm9000_probe(struct platform_device *pdev)
 
 	/* setup board info structure */
 	db = netdev_priv(ndev);
-	memset(db, 0, sizeof(*db));
 
 	db->dev = &pdev->dev;
 	db->ndev = ndev;
-- 
1.6.0.4


^ permalink raw reply related

* [PATCH] dm9000: Use resource_size instead of private macro
From: Tobias Klauser @ 2009-09-09 11:07 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev, Tobias Klauser

The macro res_size in drivers/net/dm9000.c is a copy of resource_size in
linux/ioport.h. Remove the function and use resource_size instead.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 drivers/net/dm9000.c |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/net/dm9000.c b/drivers/net/dm9000.c
index dd771de..00a9db8 100644
--- a/drivers/net/dm9000.c
+++ b/drivers/net/dm9000.c
@@ -1185,8 +1185,6 @@ static const struct net_device_ops dm9000_netdev_ops = {
 #endif
 };
 
-#define res_size(_r) (((_r)->end - (_r)->start) + 1)
-
 /*
  * Search DM9000 board, allocate space and register it
  */
@@ -1236,7 +1234,7 @@ dm9000_probe(struct platform_device *pdev)
 		goto out;
 	}
 
-	iosize = res_size(db->addr_res);
+	iosize = resource_size(db->addr_res);
 	db->addr_req = request_mem_region(db->addr_res->start, iosize,
 					  pdev->name);
 
@@ -1254,7 +1252,7 @@ dm9000_probe(struct platform_device *pdev)
 		goto out;
 	}
 
-	iosize = res_size(db->data_res);
+	iosize = resource_size(db->data_res);
 	db->data_req = request_mem_region(db->data_res->start, iosize,
 					  pdev->name);
 
-- 
1.6.0.4


^ permalink raw reply related

* Re: Next Sept 7: Bug : skb_release_head_state on x86
From: Sachin Sant @ 2009-09-09 11:13 UTC (permalink / raw)
  To: Sachin Sant
  Cc: Eric Dumazet, netdev, Stephen Rothwell, linux-next, David Miller
In-Reply-To: <4AA5E717.1050002@in.ibm.com>

Sachin Sant wrote:
> Will try to boot 0904 and will check if the same problem can be 
> recreated.
I still have this problem with next-20090908.Although the trace
looks a bit different.

Haven't checked today's next.

BUG: unable to handle kernel paging request at 00008c90
IP: [<c0349399>] skb_dma_unmap+0x15/0x91
*pdpt = 0000000035445001 *pde = 0000000000000000
Oops: 0000 [#2] SMP
last sysfs file: /sys/devices/system/cpu/cpu3/topology/core_siblings
Modules linked in: ipv6 microcode fuse loop dm_mod i2c_piix4 tg3 i2c_core pcspkr ppdev button libphy sworks_agp rtc_cmos rtc_core parport_pc sr_mod rtc_lib sg parport agpgart cdrom floppy ohci_hcd ehci_hcd sd_mod crc_t10dif usbcore edd fan ide_pci_generic serverworks ide_core ata_generic pata_serverworks libata ips scsi_mod thermal processor thermal_sys hwmon [last unloaded: speedstep_lib]

Pid: 6, comm: ksoftirqd/1 Tainted: G      D    (2.6.31-rc9-autotest-next-20090908-5-pae #1) eserver xSeries 235 -[86717AX]-
EIP: 0060:[<c0349399>] EFLAGS: 00010296 CPU: 1
EIP is at skb_dma_unmap+0x15/0x91
EAX: f5d3dc5c EBX: c056bba0 ECX: 00000001 EDX: 00008be8
ESI: f4d3b2f0 EDI: 00008be8 EBP: f5c69ec4 ESP: f5c69eac
 DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
Process ksoftirqd/1 (pid: 6, ti=f5c68000 task=f5c4f280 task.ti=f5c68000)
Stack:
 00000001 f5d3dc5c f5c69ec4 0000005f f4d3b2f0 00008be8 f5c69f3c f8d191a1
<0> c148347c 00000040 f4900380 f4900340 00000000 f55b2000 f4900340 00000064
<0> f553aa00 00000000 f4900340 00000000 f49006b8 d0622200 0000059a f4d377c0
Call Trace:
 [<f8d191a1>] ? tg3_poll+0x10f/0x802 [tg3]
 [<c034c151>] ? net_rx_action+0x93/0x173
 [<c01376b8>] ? __do_softirq+0xa7/0x144
 [<c013777b>] ? do_softirq+0x26/0x2b
 [<c01377ca>] ? ksoftirqd+0x4a/0xae
 [<c0137780>] ? ksoftirqd+0x0/0xae
 [<c0146a56>] ? kthread+0x61/0x66
 [<c01469f5>] ? kthread+0x0/0x66
 [<c0103507>] ? kernel_thread_helper+0x7/0x10
Code: 5a c0 74 07 89 d8 e8 f3 7b e6 ff ba f4 ff ff ff 89 d0 5b 5e 5d c3 55 89 e5 57 56 53 83 ec 0c 8b 1d c0 07 61 c0 89 4d e8 89 45 ec <8b> ba a8 00 00 00 83 7d e8 02 8b 42 50 8b 72 54 8b 4f 0c 8b 57
EIP: [<c0349399>] skb_dma_unmap+0x15/0x91 SS:ESP 0068:f5c69eac
CR2: 0000000000008c90
---[ end trace 9239788a6557ba57 ]---
Kernel panic - not syncing: Fatal exception in interrupt
Pid: 6, comm: ksoftirqd/1 Tainted: G      D    2.6.31-rc9-autotest-next-20090908-5-pae #1

I went back and tried out some old next versions. Seems like
the problem was introduced in next-20090903. next-20090902
worked fine.

Thanks
-Sachin

-- 

---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------


^ permalink raw reply

* Re: Next Sept 7: Bug : skb_release_head_state on x86
From: Eric Dumazet @ 2009-09-09 12:10 UTC (permalink / raw)
  To: Sachin Sant; +Cc: netdev, Stephen Rothwell, linux-next, David Miller
In-Reply-To: <4AA78DD4.60003@in.ibm.com>

Sachin Sant a écrit :
> Sachin Sant wrote:
>> Will try to boot 0904 and will check if the same problem can be
>> recreated.
> I still have this problem with next-20090908.Although the trace
> looks a bit different.
> 
> Haven't checked today's next.
> 
> BUG: unable to handle kernel paging request at 00008c90
> IP: [<c0349399>] skb_dma_unmap+0x15/0x91
> *pdpt = 0000000035445001 *pde = 0000000000000000
> Oops: 0000 [#2] SMP
> last sysfs file: /sys/devices/system/cpu/cpu3/topology/core_siblings
> Modules linked in: ipv6 microcode fuse loop dm_mod i2c_piix4 tg3
> i2c_core pcspkr ppdev button libphy sworks_agp rtc_cmos rtc_core
> parport_pc sr_mod rtc_lib sg parport agpgart cdrom floppy ohci_hcd
> ehci_hcd sd_mod crc_t10dif usbcore edd fan ide_pci_generic serverworks
> ide_core ata_generic pata_serverworks libata ips scsi_mod thermal
> processor thermal_sys hwmon [last unloaded: speedstep_lib]
> 
> Pid: 6, comm: ksoftirqd/1 Tainted: G      D   
> (2.6.31-rc9-autotest-next-20090908-5-pae #1) eserver xSeries 235
> -[86717AX]-
> EIP: 0060:[<c0349399>] EFLAGS: 00010296 CPU: 1
> EIP is at skb_dma_unmap+0x15/0x91
> EAX: f5d3dc5c EBX: c056bba0 ECX: 00000001 EDX: 00008be8
> ESI: f4d3b2f0 EDI: 00008be8 EBP: f5c69ec4 ESP: f5c69eac
> DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
> Process ksoftirqd/1 (pid: 6, ti=f5c68000 task=f5c4f280 task.ti=f5c68000)
> Stack:
> 00000001 f5d3dc5c f5c69ec4 0000005f f4d3b2f0 00008be8 f5c69f3c f8d191a1
> <0> c148347c 00000040 f4900380 f4900340 00000000 f55b2000 f4900340 00000064
> <0> f553aa00 00000000 f4900340 00000000 f49006b8 d0622200 0000059a f4d377c0
> Call Trace:
> [<f8d191a1>] ? tg3_poll+0x10f/0x802 [tg3]
> [<c034c151>] ? net_rx_action+0x93/0x173
> [<c01376b8>] ? __do_softirq+0xa7/0x144
> [<c013777b>] ? do_softirq+0x26/0x2b
> [<c01377ca>] ? ksoftirqd+0x4a/0xae
> [<c0137780>] ? ksoftirqd+0x0/0xae
> [<c0146a56>] ? kthread+0x61/0x66
> [<c01469f5>] ? kthread+0x0/0x66
> [<c0103507>] ? kernel_thread_helper+0x7/0x10
> Code: 5a c0 74 07 89 d8 e8 f3 7b e6 ff ba f4 ff ff ff 89 d0 5b 5e 5d c3
> 55 89 e5 57 56 53 83 ec 0c 8b 1d c0 07 61 c0 89 4d e8 89 45 ec <8b> ba
> a8 00 00 00 83 7d e8 02 8b 42 50 8b 72 54 8b 4f 0c 8b 57
> EIP: [<c0349399>] skb_dma_unmap+0x15/0x91 SS:ESP 0068:f5c69eac
> CR2: 0000000000008c90
> ---[ end trace 9239788a6557ba57 ]---
> Kernel panic - not syncing: Fatal exception in interrupt
> Pid: 6, comm: ksoftirqd/1 Tainted: G      D   
> 2.6.31-rc9-autotest-next-20090908-5-pae #1
> 
> I went back and tried out some old next versions. Seems like
> the problem was introduced in next-20090903. next-20090902
> worked fine.
> 
> Thanks
> -Sachin
> 

There were some changes on net-next-2.6 for tg3, you could try to revert them...

(They are working just fine on my machine, but I suspect you have a different chip)
# lspci | grep Ether
14:04.0 Ethernet controller: Broadcom Corporation NetXtreme BCM5715S Gigabit Ethernet (rev a3)
14:04.1 Ethernet controller: Broadcom Corporation NetXtreme BCM5715S Gigabit Ethernet (rev a3)



commit 7ab0f2736bfe137a82a7084bbfb5f809da95cabd
Author: Ben Hutchings <bhutchings@solarflare.com>
Date:   Thu Sep 3 10:39:43 2009 +0000

    netdev: Remove redundant checks for CAP_NET_ADMIN in MDIO implementations

    dev_ioctl() already checks capable(CAP_NET_ADMIN) before calling the
    driver's implementation of MDIO ioctls.

    Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit daf09de817353f18bb81a23a023d429cfd258e62
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:22:42 2009 +0000

    tg3: Update version to 3.102

    This patch updates the tg3 version to 3.102.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 882e9793faa9425dff581c33b1af45ed10145626
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:21:36 2009 +0000

    tg3: Add MDIO bus address assignments

    The 5717 is a dual port chip that has a shared MDIO bus design.  While
    it is impossible for one function to interface with the wrong phy, that
    function still needs to know which MDIO bus address to use when
    interfacing with its own phy.  This patch adds code to determine which
    MDIO bus address to use.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit a1b950d56de3c72bea3343f54de24c43fb7dc74e
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:20:17 2009 +0000

    tg3: Add 5717 NVRAM detection routines

    This patch adds NVRAM detection routines for the 5717.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit f6eb9b1fc1411d22c073f5264e5630a541d0f7df
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:19:53 2009 +0000

    tg3: Add 5717 asic rev

    This patch adds the 5717 asic rev.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 8d9d7cfc0ec2fe37ff9afd74326d03f38f96ad1b
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:19:05 2009 +0000

    tg3: Assign rx ret producer indexes by vector

    When RSS is enabled, the status block format changes slightly.  The
    "rx_jumbo_consumer", "reserved", and "rx_mini_consumer" members get
    mapped to the other three rx return ring producer indexes.  This patch
    introduces a new per-interrupt member which identifies which location
    in the status block a particular vector should look for return ring
    updates.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 0c1d0e2b05e92ad847b3ebe1c75b7974086bc8fa
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:16:33 2009 +0000

    tg3: Adjust RSS ring allocation strategies

    When multivector RSS is enabled, the first interrupt vector is only used
    to report link interrupts and error conditions.  This patch changes the
    code so that rx and tx ring resources are not allocated for this vector.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit baf8a94a572928710e9e60967d153a7bf3aebd9c
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:13:00 2009 +0000

    tg3: Add RSS support

    This patch adds code needed to enable RSS.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit b6080e126012047d42e53154189fdca286d0600e
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:12:00 2009 +0000

    tg3: Add coalesce parameters for msix vectors

    This patch adds code to tune the coalescing parameters for the other
    msix vectors.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
commit fed9781081aa9600765346c108ff22751e003715
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:10:19 2009 +0000

    tg3: Enable NAPI instances for other int vectors

    This patch adds code to enable and disable the rest of the NAPI
    instances.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit fe5f5787f0866e9f883bdd90018a354f2f3defd1
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:09:39 2009 +0000

    tg3: Add TSS support

    This patch exposes the additional transmit rings to the kernel and makes
    the necessary modifications to transmit, open, and close paths.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
commit 89aeb3bceaa1a02651206a76a7b9dcb8f3884702
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:08:58 2009 +0000

    tg3: Update intmbox and coal_now for msix

    This patch fixes up two spots that need attention now that msix support
    has been added.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit f77a6a8e6cee17b21a43bdf6b853cc2fc0e2c4df
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 13:04:37 2009 +0000

    tg3: Add tx and rx ring resource tracking

    This patch adds code to assign status block, tx producer ring and rx
    return ring resources needed for the other interrupt vectors.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 646c9eddcffd202bb0f3d906cecf94eaf10cad31
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 12:58:41 2009 +0000

    tg3: Add mailbox assignments

    The 5717 assigns mailbox locations to interrupt vectors in a rather
    non-intuitive way.  (Much of the complexity stems from legacy
    compatibility issues.)  This patch implements the assignment scheme.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 679563f47cd2547a0e091b5bd3ddf30027af6b08
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 12:55:46 2009 +0000

    tg3: Add MSI-X support

    This patch adds MSI-X support.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit 4f125f42dd55390016e21f8b3960f99d02d1001f
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 12:55:02 2009 +0000

    tg3: Add support code around kernel interrupt API

    This patch adds code to support multiple interrupt vectors around the
    kernel's interrupt API.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
commit 2d31ecaf10c4ae03d49aed516481b2839b0220f6
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 12:53:31 2009 +0000

    tg3: Create tg3_rings_reset()

    This patch moves most of the chip ring setup logic into a separate
    function.  This will make it easier to verify the multi ring setup
    changes.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

commit fd2ce37f8e4a570ce90b141a2e7c476c5b399836
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 12:51:13 2009 +0000

    tg3: Add per-int coalesce now member

    Each interrupt vector has its own bit in the host coalescing register to
    force that vector's status block to be updated and generate an
    interrupt.  This patch adds a member to the per-interrupt structure
    that records which bit belongs to that vector.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>
commit f19af9c2cc015e42dfe4bd5c383e32066ec2801c
Author: Matt Carlson <mcarlson@broadcom.com>
Date:   Tue Sep 1 12:47:49 2009 +0000

    tg3: inline tg3_cond_int()

    This patch inlines the code of tg3_cond_int() into the function's only
    callsite.  This prep work makes the following patch cleaner.

    Signed-off-by: Matt Carlson <mcarlson@broadcom.com>
    Reviewed-by: Benjamin Li <benli@broadcom.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

^ permalink raw reply

* Re: [iproute2] tc action mirred    question
From: Xiaofei Wu @ 2009-09-09 13:12 UTC (permalink / raw)
  To: hadi; +Cc: linux netdev
In-Reply-To: <1252376168.5244.11.camel@dogo.mojatatu.com>


I did an experiment. It seems that something is wrong.



>> (1) Could I use  pedit action to modify the dst MAC, so the destination node D will accept it, 
>> then forward it to node C?  

>Yes, you can achieve it with pedit; 
>it is as usable as u32 is - you have to know your offsets
>example, here's something done on an incoming packet:
=-=
#Note:
#dst MAC starts at -14
#src MAC at -8
#ethertype at -2
#
>
>

  A
 /  \
B  D
 \  /
  C
A: eth0,  IP 192.168.1.242
     waln1,  IP 192.168.2.200  ,MAC  00 23 cd af d0 74

D:  wlan1, IP  192.168.2.11, MAC 00 23 cd af ec da
     wlan2, IP 192.168.4.11

On node A,
1) run 'tc qdisc add dev eth0 handle 1: root prio'

2) run 'tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \
match ip src 192.168.1.0/24 flowid 1:16 \
action mirred egress mirror dev wlan1'

Node A sent some packets to C. (path: A-B-C)
I can use 'tcpdump -i wlan1 -e' to capture the packets from eth0  (node A),  but I can't forward the mirroring packets to D, (then D forwards them to C).

3 ) run 'tc filter del dev eth0 parent 1: protocol ip prio 10 u32'
then,
'tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \
match ip src 192.168.1.0/32 flowid 1:16 \
action pedit munge offset -14 u16 set 0x0023 \
munge offset -12 u32 set 0xcdafecda \
munge offset -8 u32 set 0x0023cdaf \
munge offset -4 u32 set 0xd0740800 pipe \
action mirred egress mirror dev wlan1'

After run 'tcpdump -i wlan1 -e', I can not capture any packets.
I change 'mirror' to 'redirect'   ('action mirred egress mirror dev wlan1'),  also capture nothing.
Why?

BTW,
'uname -a'
Linux fedora 2.6.27.30-170.2.82.fc10.i686 #1 SMP Mon Aug 17 08:38:59 EDT 2009
i686 i686 i386 GNU/Linux
iproute2:
iproute-2.6.27-2.fc10.i386


regards,
wu


      


^ permalink raw reply

* Re: UDP regression with packets rates < 10k per sec
From: Christoph Lameter @ 2009-09-09 14:01 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: netdev
In-Reply-To: <4AA6E039.4000907@gmail.com>

On Wed, 9 Sep 2009, Eric Dumazet wrote:

> In order to reproduce this here, could you tell me if you use
>
> Producer linux-2.6.22 -> Receiver 2.6.22
> Producer linux-2.6.31 -> Receiver 2.6.31

I use the above setup.


^ permalink raw reply

* Re: [IB] 2.6.31-rc9: SW2HW_EQ failed on Dell R610
From: Christoph Lameter @ 2009-09-09 14:02 UTC (permalink / raw)
  To: Roland Dreier; +Cc: netdev
In-Reply-To: <ada1vmgn76v.fsf@cisco.com>

On Tue, 8 Sep 2009, Roland Dreier wrote:

> The workaround of limiting possible cpus to 16 should be OK for the time
> between 2.6.31 and 2.6.31.1.

Why not merge it immediately? Dell R610s are fairly standard.


^ permalink raw reply

* Re: [PATCH] slub: fix slab_pad_check()
From: Christoph Lameter @ 2009-09-09 14:04 UTC (permalink / raw)
  To: Paul E. McKenney
  Cc: Eric Dumazet, Pekka Enberg, Zdenek Kabelac, Patrick McHardy,
	Robin Holt, Linux Kernel Mailing List, Jesper Dangaard Brouer,
	Linux Netdev List, Netfilter Developers
In-Reply-To: <20090908225937.GO6753@linux.vnet.ibm.com>

On Tue, 8 Sep 2009, Paul E. McKenney wrote:

> > No direct request but I have seen the network developers discover these
> > features and their caching benefits over the last year. It is likely that
> > they will try to push it into more components of the net subsystem.
>
> So if they push it far enough, they might well decide that they need
> a SLAB_DESTROY_BY_RCU_BH, for example.  Looks like seven bits left,
> so unless I am missing something, should not be a huge problem should
> this need arise.

I'd rather have the call_rcu in the slabs replaced by a function that
can be set by the user. Then we can remove all rcu barriers from the code
and the slabs could be used with any type of rcu functionality.


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox