Changeset View
Changeset View
Standalone View
Standalone View
sys/ofed/drivers/infiniband/core/ib_sa_query.c
Show First 20 Lines • Show All 489 Lines • ▼ Show 20 Lines | |||||
{ | { | ||||
query->flags &= ~IB_SA_ENABLE_LOCAL_SERVICE; | query->flags &= ~IB_SA_ENABLE_LOCAL_SERVICE; | ||||
} | } | ||||
static void free_sm_ah(struct kref *kref) | static void free_sm_ah(struct kref *kref) | ||||
{ | { | ||||
struct ib_sa_sm_ah *sm_ah = container_of(kref, struct ib_sa_sm_ah, ref); | struct ib_sa_sm_ah *sm_ah = container_of(kref, struct ib_sa_sm_ah, ref); | ||||
ib_destroy_ah(sm_ah->ah); | ib_destroy_ah(sm_ah->ah, 0); | ||||
kfree(sm_ah); | kfree(sm_ah); | ||||
} | } | ||||
static void update_sm_ah(struct work_struct *work) | static void update_sm_ah(struct work_struct *work) | ||||
{ | { | ||||
struct ib_sa_port *port = | struct ib_sa_port *port = | ||||
container_of(work, struct ib_sa_port, update_task); | container_of(work, struct ib_sa_port, update_task); | ||||
struct ib_sa_sm_ah *new_ah; | struct ib_sa_sm_ah *new_ah; | ||||
Show All 23 Lines | static void update_sm_ah(struct work_struct *work) | ||||
ah_attr.sl = port_attr.sm_sl; | ah_attr.sl = port_attr.sm_sl; | ||||
ah_attr.port_num = port->port_num; | ah_attr.port_num = port->port_num; | ||||
if (port_attr.grh_required) { | if (port_attr.grh_required) { | ||||
ah_attr.ah_flags = IB_AH_GRH; | ah_attr.ah_flags = IB_AH_GRH; | ||||
ah_attr.grh.dgid.global.subnet_prefix = cpu_to_be64(port_attr.subnet_prefix); | ah_attr.grh.dgid.global.subnet_prefix = cpu_to_be64(port_attr.subnet_prefix); | ||||
ah_attr.grh.dgid.global.interface_id = cpu_to_be64(IB_SA_WELL_KNOWN_GUID); | ah_attr.grh.dgid.global.interface_id = cpu_to_be64(IB_SA_WELL_KNOWN_GUID); | ||||
} | } | ||||
new_ah->ah = ib_create_ah(port->agent->qp->pd, &ah_attr); | new_ah->ah = ib_create_ah(port->agent->qp->pd, &ah_attr, RDMA_CREATE_AH_SLEEPABLE); | ||||
if (IS_ERR(new_ah->ah)) { | if (IS_ERR(new_ah->ah)) { | ||||
pr_warn("Couldn't create new SM AH\n"); | pr_warn("Couldn't create new SM AH\n"); | ||||
kfree(new_ah); | kfree(new_ah); | ||||
return; | return; | ||||
} | } | ||||
spin_lock_irq(&port->ah_lock); | spin_lock_irq(&port->ah_lock); | ||||
if (port->sm_ah) | if (port->sm_ah) | ||||
▲ Show 20 Lines • Show All 1,034 Lines • Show Last 20 Lines |