Re: 1000ms delay in networking stack or driver, new bug?

kuznet@ms2.inr.ac.ru
Fri, 24 Sep 1999 20:33:58 +0400 (MSK DST)


Hello!

> My first experiments when the problems where first observed was to
> analyse the isdn code and to insert mark_bh everywhere where

It was correct idea. The more butter is the better.
It is a pity that you gave up 8)8)

Rule is:

#define netif_stop_queue(dev) do { (dev)->tbusy = 1; } while (0)
#define netif_wake_queue(dev) do { (dev)->tbusy = 0; mark_bh(NET_BH); } while (0)

and
#define netif_start_queue(dev) do { (dev)->tbusy = 0; } while (0)
which may be used only on device open.

(You may improve these macros using bitops and using test_and_clear_bit()
in netif_wake_queue()).

If tbusy is referenced out of such macros and it is not
easy to encaplsulate them to such macros, because they are on a distance:
the device is buggy. Look at isdn_net now...

Yes, the only allowed in 2.2 exception is when tbusy is set to 1 in
dev->hard_start_xmit() without any reasons and then reset to 0
without marking BH. It is some magic combination, which is copied
and pasted to new drivers for years without thinking 8)
It lost its sense before linux-1.2...
It is harmless in 2.2, but it is not so harmless in 2.3/smp, by the way.

These rules are very weak, almost all of the devices satisfy them.
ISDN is sad exception.

Alexey

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/