Changeset View
Changeset View
Standalone View
Standalone View
sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_ib.c
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Lines | struct ipoib_ah *ipoib_create_ah(struct ipoib_dev_priv *priv, | ||||
ah = kmalloc(sizeof *ah, GFP_KERNEL); | ah = kmalloc(sizeof *ah, GFP_KERNEL); | ||||
if (!ah) | if (!ah) | ||||
return NULL; | return NULL; | ||||
ah->priv = priv; | ah->priv = priv; | ||||
ah->last_send = 0; | ah->last_send = 0; | ||||
kref_init(&ah->ref); | kref_init(&ah->ref); | ||||
ah->ah = ib_create_ah(pd, attr); | ah->ah = ib_create_ah(pd, attr, RDMA_CREATE_AH_SLEEPABLE); | ||||
if (IS_ERR(ah->ah)) { | if (IS_ERR(ah->ah)) { | ||||
kfree(ah); | kfree(ah); | ||||
ah = NULL; | ah = NULL; | ||||
} else | } else | ||||
ipoib_dbg(priv, "Created ah %p\n", ah->ah); | ipoib_dbg(priv, "Created ah %p\n", ah->ah); | ||||
return ah; | return ah; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 485 Lines • ▼ Show 20 Lines | static void __ipoib_reap_ah(struct ipoib_dev_priv *priv) | ||||
LIST_HEAD(remove_list); | LIST_HEAD(remove_list); | ||||
unsigned long flags; | unsigned long flags; | ||||
spin_lock_irqsave(&priv->lock, flags); | spin_lock_irqsave(&priv->lock, flags); | ||||
list_for_each_entry_safe(ah, tah, &priv->dead_ahs, list) | list_for_each_entry_safe(ah, tah, &priv->dead_ahs, list) | ||||
if ((int) priv->tx_tail - (int) ah->last_send >= 0) { | if ((int) priv->tx_tail - (int) ah->last_send >= 0) { | ||||
list_del(&ah->list); | list_del(&ah->list); | ||||
ib_destroy_ah(ah->ah); | ib_destroy_ah(ah->ah, 0); | ||||
kfree(ah); | kfree(ah); | ||||
} | } | ||||
spin_unlock_irqrestore(&priv->lock, flags); | spin_unlock_irqrestore(&priv->lock, flags); | ||||
} | } | ||||
void ipoib_reap_ah(struct work_struct *work) | void ipoib_reap_ah(struct work_struct *work) | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 453 Lines • Show Last 20 Lines |