[openib-general] [PATCH] ib_mad: Support call of ib_mad_post_send from any context

Hal Rosenstock halr at voltaire.com
Sat Sep 11 12:57:32 PDT 2004


ib_mad: Support call of ib_mad_post_send from any context

Index: ib_mad.c
===================================================================
--- ib_mad.c	(revision 788)
+++ ib_mad.c	(working copy)
@@ -58,6 +58,7 @@
 #include "ib_mad_priv.h"
 #include "ib_core.h"	/* for IB_DEVICE_NOTIFIER for now!!! */
 #include <linux/smp_lock.h>
+#include <linux/interrupt.h>
 
 
 MODULE_LICENSE("Dual BSD/GPL");
@@ -303,7 +304,9 @@
 		next_send_wr = (struct ib_send_wr *)cur_send_wr->list.next;
 
 		/* Allocate MAD send WR tracking structure */
-		mad_send_wr = kmalloc(sizeof *mad_send_wr, GFP_KERNEL);
+		mad_send_wr = kmalloc(sizeof *mad_send_wr, 
+				      (in_atomic() || irqs_disabled()) ?
+				      GFP_ATOMIC : GFP_KERNEL);
 		if (!mad_send_wr) {
 			*bad_send_wr = cur_send_wr;
 			printk(KERN_ERR "No memory for ib_mad_send_wr_private\n");
Index: TODO
===================================================================
--- TODO	(revision 788)
+++ TODO	(working copy)
@@ -3,7 +3,6 @@
 OpenIB MAD Layer
 
 Short Term
-Support call of ib_mad_post_send from any context
 Fix list handling
 Use wait queue and wait_event rather than signals and semaphores
 Finish coding receive path





More information about the general mailing list