From 18fcb11be3e951abcb275a344aa159213862686b Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Tue, 22 Sep 2009 19:18:45 +0000 Subject: [PATCH] Added error injection code: the kernel parameter processing_delay_in_us allows to control by how much the srpt_completion() function (which runs in interrupt context) will be delayed. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@1128 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- srpt/src/ib_srpt.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/srpt/src/ib_srpt.c b/srpt/src/ib_srpt.c index 6bb46badf..1df516ba9 100644 --- a/srpt/src/ib_srpt.c +++ b/srpt/src/ib_srpt.c @@ -94,6 +94,10 @@ static unsigned long trace_flag = DEFAULT_SRPT_TRACE_FLAGS; module_param(trace_flag, long, 0644); MODULE_PARM_DESC(trace_flag, "Trace flags for the ib_srpt kernel module."); +static unsigned long processing_delay_in_us; +module_param(processing_delay_in_us, long, 0744); +MODULE_PARM_DESC(processing_delay_in_us, + "Per CQ event processing delay in microseconds."); #endif module_param(thread, int, 0444); @@ -1454,6 +1458,9 @@ static void srpt_completion(struct ib_cq *cq, void *ctx) break; } } + + if (processing_delay_in_us <= MAX_UDELAY_MS * 1000) + udelay(processing_delay_in_us); } }