From: Santiago Leon <santil@us.ibm.com>
To: Andrew Morton <akpm@osdl.org>,
Linux Kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH] fix buffer starvation race in ibmveth
Date: Fri, 03 Dec 2004 16:02:31 -0600 [thread overview]
Message-ID: <41B0E277.2090801@us.ibm.com> (raw)
[-- 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 */
reply other threads:[~2004-12-03 22:01 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=41B0E277.2090801@us.ibm.com \
--to=santil@us.ibm.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox