Strange delays with small packets - solved (?)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,
a few months ago i reported delays occuring on diskless workstations with
ne2k-pci network cards, but only with small packets. There was no answer, 
so it seemed like i was alone with this problem. After some digging i was
almost sure, that the problem is related to receiving data. Today i started
debugging the 8039 driver. And you know what - with all these printk's there
were no more delays. I ended with the following solution (patch appended),
which simply delays receiving data from the card in ei_receive. It works.
The patch is against 2.2.25, but 2.4 has similar problems. The default
time of 8 microseconds has been established experimentally ;).
My question is following: is it the proper solution? There are two
possibilities:
1. The hardware is flaky and generates interrupt before the network card
   is really ready (does it make any sense?). In such situation my
   "solution" could be expanded - delays per device, configurable via
   /proc entry. I'm not sure, but maybe RTL8139 based cards sometimes need
   similar trick. BTW, these ne2k-pci are realtek RTL8029.
2. There is a race somewhere in the kernel, and this delay only hides it.
   That would be bad news.
What do you think about it?
Cheers
Krzysztof

--- linux.orig/drivers/net/Config.in	Thu Jun  5 12:31:45 2003
+++ linux/drivers/net/Config.in	Thu Jun  5 12:33:31 2003
@@ -403,3 +403,10 @@
   fi
 fi
 tristate 'SBNI12-xx support' CONFIG_SBNI
+
+mainmenu_option next_comment
+comment 'Delaying (seems to be stupid, but cures a strange problem)'
+bool 'Delay before receiving a packet (currently 8390 cards only)' CONFIG_RECV_DELAY
+if [ "$CONFIG_RECV_DELAY" = "y" ];then
+  int 'how much time (microseconds)' CONFIG_DELAY_TIME 8
+fi
--- linux.orig/drivers/net/8390.c	Thu Jun  5 12:34:53 2003
+++ linux/drivers/net/8390.c	Thu Jun  5 12:33:32 2003
@@ -670,6 +670,9 @@
 	struct e8390_pkt_hdr rx_frame;
 	int num_rx_pages = ei_local->stop_page-ei_local->rx_start_page;
 
+#ifdef CONFIG_RECV_DELAY
+	udelay(CONFIG_DELAY_TIME);
+#endif
 	while (++rx_pkt_count < 10) 
 	{
 		int pkt_len, pkt_stat;


-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux