[openib-general] What context can CM be called from?
Roland Dreier
roland at topspin.com
Tue Mar 29 08:08:20 PST 2005
Tziporet> Hi, If I remember correctly the verbs of create &
Tziporet> destroy AVs should be enabled from interrupt context too
Tziporet> since they are not privileged verbs. In VAPI we
Tziporet> implemented these verbs in this way and I think it is
Tziporet> important to keep it this way.
Yes, you're correct that the AV verbs are not privileged according to
the table in chapter 11 of the IB spec. I'm not sure that this
requires that they must be available from interrupt context but it is
reasonable for us to choose the policy that all non-privileged verbs
may be called from interrupt context.
Fixing mthca to allow the AH verbs to be callable from interrupt
context is easy -- the trivial patch is included below.
I'm not sure if this removes all obstructions to the CM being usable
from interrupt context.
- R.
Index: infiniband/hw/mthca/mthca_av.c
===================================================================
--- infiniband/hw/mthca/mthca_av.c (revision 2060)
+++ infiniband/hw/mthca/mthca_av.c (working copy)
@@ -63,7 +63,7 @@ int mthca_create_ah(struct mthca_dev *de
ah->type = MTHCA_AH_PCI_POOL;
if (dev->hca_type == ARBEL_NATIVE) {
- ah->av = kmalloc(sizeof *ah->av, GFP_KERNEL);
+ ah->av = kmalloc(sizeof *ah->av, GFP_ATOMIC);
if (!ah->av)
return -ENOMEM;
@@ -77,7 +77,7 @@ int mthca_create_ah(struct mthca_dev *de
if (index == -1)
goto on_hca_fail;
- av = kmalloc(sizeof *av, GFP_KERNEL);
+ av = kmalloc(sizeof *av, GFP_ATOMIC);
if (!av)
goto on_hca_fail;
@@ -89,7 +89,7 @@ int mthca_create_ah(struct mthca_dev *de
on_hca_fail:
if (ah->type == MTHCA_AH_PCI_POOL) {
ah->av = pci_pool_alloc(dev->av_table.pool,
- SLAB_KERNEL, &ah->avdma);
+ SLAB_ATOMIC, &ah->avdma);
if (!ah->av)
return -ENOMEM;
More information about the general
mailing list