* Réf. : Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP
@ 2003-09-30 7:07 dfages
2003-09-30 7:08 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: dfages @ 2003-09-30 7:07 UTC (permalink / raw)
To: Robert Olsson; +Cc: Andrew Morton, netdev
Yes, I know that but, for the moment, I've to keep my 2.4.19 kernel (so without
NAPI).
I've also ported the e1000 driver to HW_FLOWCONTROL. Some people may be happy to
use it...
Regards,
---
Daniel FAGES
ARKOON Network Security http://www.arkoon.net
|--------+--------------------------->
| | Robert Olsson |
| | <Robert.Olsson@da|
| | ta.slu.se> |
| | |
| | 29/09/2003 23:25 |
| | |
|--------+--------------------------->
>----------------------------------------------------------------------------|
| |
| Pour : Andrew Morton <akpm@osdl.org> |
| cc : netdev@oss.sgi.com, daniel fages/Arkoon |
| Objet : Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP |
>----------------------------------------------------------------------------|
Hello!
IMO HW_FLOWCONTROL is now outdated. It has served very well and encouraged
people to use for Linux production networking. With a 2 tulip NIC's on a UP
system as a typical system. Only tulip has code for it. This option was
added by Alexey in 2.1.63 something...
Cheers.
--ro
Andrew Morton writes:
>
>
> Begin forwarded message:
>
> Date: Mon, 29 Sep 2003 14:08:54 +0200
> From: dfages@arkoon.net
> To: linux-kernel@vger.kernel.org
> Subject: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP
>
>
>
>
> Hi,
> by testing the CONFIG_NET_HW_FLOWCONTROL (NIC Hardware throttling) on
> a SMP system, I found a bug in net/core/dev.c : the netdev_dropping
> variable can be set to a negative value (the result is that a CPU can
> be locked in "throttle" state).
> This bug seems to exist in 2.4 and in 2.6 kernels.
>
> Here's a typical scenario :
>
> - Throttling --> (CPU 0)queue->throttle==1 && (CPU 1)queue->throttle==1
> && netdev_dropping == 2
> - 1st packet Unthrottle ( in net_rx_action() ), received by CPU 0
> --> (CPU 0)queue->throttle==1 && (CPU 1)queue->throttle==1
> && netdev_dropping == 1
> - 2nd packet Unthrottle ( in net_rx_action() ), received by CPU 0
> --> (CPU 0)queue->throttle==0 && (CPU 1)queue->throttle==1
> && netdev_dropping == 0
> - 3nd packet Unthrottle ( in net_rx_action() ), received by CPU 1
> --> (CPU 0)queue->throttle==0 && (CPU 1)queue->throttle==0
> && netdev_dropping == -1
>
> and so on...
>
> The problem is that the (CPU)queue->throttle should be set to zero every
> time the netdev_dropping variable is decremented.
>
>
> Here's a patch for the 2.4.19 kernel (tested with success) :
>
> --- linux-2.4.19/net/core/dev.c.orig Mon Sep 29 12:49:14 2003
> +++ linux-2.4.19/net/core/dev.c Tue Sep 23 18:35:35 2003
> @@ -1519,8 +1519,8 @@
>
> #ifdef CONFIG_NET_HW_FLOWCONTROL
> if (queue->throttle && queue->input_pkt_queue.qlen < no_cong_thresh ) {
> + queue->throttle = 0;
> if (atomic_dec_and_test(&netdev_dropping)) {
> - queue->throttle = 0;
> netdev_wakeup();
> goto softnet_break;
> }
>
>
>
>
> I haven't done a patch for 2.4.22 (as we currently use 2.4.19) but the same
> modification should be applied around lines 1572 to 1577 of net/core/dev.c
>
> For 2.6.0-test5, the lines to modified are arount 1631 to 1637.
>
> Regards,
> ---
> Daniel FAGES
> ARKOON Network Security http://www.arkoon.net
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Réf. : Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP
2003-09-30 7:07 Réf. : Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP dfages
@ 2003-09-30 7:08 ` David S. Miller
0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2003-09-30 7:08 UTC (permalink / raw)
To: dfages; +Cc: Robert.Olsson, akpm, netdev
On Tue, 30 Sep 2003 09:07:28 +0200
dfages@arkoon.net wrote:
> Yes, I know that but, for the moment, I've to keep my 2.4.19 kernel
> (so without NAPI). I've also ported the e1000 driver to
> HW_FLOWCONTROL. Some people may be happy to use it...
I agree to adding the bug fix, it's a bug fix and for code we can't
remove from the 2.4.x series at this point.
I don't agree to adding usage of this deprecated feature to any
drivers shipped in the kernel. If you're going to invest time into
making this kind of improvement, invest it in a NAPI port.
So I'll add your bug fix, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-09-30 7:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-30 7:07 Réf. : Fw: [BUG/PATCH] CONFIG_NET_HW_FLOWCONTROL and SMP dfages
2003-09-30 7:08 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).