All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix buffer starvation race in ibmveth
@ 2004-12-03 22:02 Santiago Leon
  0 siblings, 0 replies; only message in thread
From: Santiago Leon @ 2004-12-03 22:02 UTC (permalink / raw)
  To: Andrew Morton, Linux Kernel

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

Andrew,

There's a chance that the receive buffers are being consumed at the same 
rate as they are being replenished in ibmveth_replenish_task()... 
Meanwhile, the calls to schedule_replenishing() from ibmveth_poll() 
won't schedule another replenishing cycle (because the not_replenishing 
flag is zero), starving the buffers and making the adapter unable to 
receive packets unless the module is reloaded... Here's a small patch 
that will fix it by scheduling another replenishing task after toggling 
the not_replenishing flag.

Please apply.

Signed-Off-By: Santiago Leon <santil@us.ibm.com>
-- 
Santiago A. Leon
Power Linux Development
IBM Linux Technology Center

[-- Attachment #2: ibmveth_buff_starve.patch --]
[-- Type: text/plain, Size: 1207 bytes --]

===== drivers/net/ibmveth.c 1.19 vs edited =====
--- 1.19/drivers/net/ibmveth.c	2004-11-22 00:42:54 -06:00
+++ edited/drivers/net/ibmveth.c	2004-12-03 15:27:40 -06:00
@@ -96,6 +96,7 @@
 static void ibmveth_proc_register_adapter(struct ibmveth_adapter *adapter);
 static void ibmveth_proc_unregister_adapter(struct ibmveth_adapter *adapter);
 static irqreturn_t ibmveth_interrupt(int irq, void *dev_instance, struct pt_regs *regs);
+static inline void ibmveth_schedule_replenishing(struct ibmveth_adapter*);
 
 #ifdef CONFIG_PROC_FS
 #define IBMVETH_PROC_DIR "ibmveth"
@@ -104,7 +105,7 @@
 
 static const char ibmveth_driver_name[] = "ibmveth";
 static const char ibmveth_driver_string[] = "IBM i/pSeries Virtual Ethernet Driver";
-#define ibmveth_driver_version "1.02"
+#define ibmveth_driver_version "1.03"
 
 MODULE_AUTHOR("Santiago Leon <santil@us.ibm.com>");
 MODULE_DESCRIPTION("IBM i/pSeries Virtual Ethernet Driver");
@@ -271,6 +272,8 @@
 	adapter->rx_no_buffer = *(u64*)(((char*)adapter->buffer_list_addr) + 4096 - 8);
 
 	atomic_inc(&adapter->not_replenishing);
+
+	ibmveth_schedule_replenishing(adapter);
 }
 
 /* kick the replenish tasklet if we need replenishing and it isn't already running */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-12-03 22:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-03 22:02 [PATCH] fix buffer starvation race in ibmveth Santiago Leon

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.