• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500v2-V1.0.0.60_1.0.38/src/linux/linux-2.6/drivers/infiniband/hw/ipath/

Lines Matching refs:mcast

49  * ipath_mcast_qp_alloc - alloc a struct to link a QP to mcast GID struct
86 struct ipath_mcast *mcast;
88 mcast = kmalloc(sizeof *mcast, GFP_KERNEL);
89 if (!mcast)
92 mcast->mgid = *mgid;
93 INIT_LIST_HEAD(&mcast->qp_list);
94 init_waitqueue_head(&mcast->wait);
95 atomic_set(&mcast->refcount, 0);
96 mcast->n_attached = 0;
99 return mcast;
102 static void ipath_mcast_free(struct ipath_mcast *mcast)
106 list_for_each_entry_safe(p, tmp, &mcast->qp_list, list)
109 kfree(mcast);
124 struct ipath_mcast *mcast;
131 mcast = rb_entry(n, struct ipath_mcast, rb_node);
133 ret = memcmp(mgid->raw, mcast->mgid.raw,
140 atomic_inc(&mcast->refcount);
147 mcast = NULL;
150 return mcast;
154 * ipath_mcast_add - insert mcast GID into table and attach QP struct
155 * @mcast: the mcast GID table
163 struct ipath_mcast *mcast,
179 ret = memcmp(mcast->mgid.raw, tmcast->mgid.raw,
219 mcast->n_attached++;
221 list_add_tail_rcu(&mqp->list, &mcast->qp_list);
223 atomic_inc(&mcast->refcount);
224 rb_link_node(&mcast->rb_node, pn, n);
225 rb_insert_color(&mcast->rb_node, &mcast_tree);
239 struct ipath_mcast *mcast;
247 mcast = ipath_mcast_alloc(gid);
248 if (mcast == NULL) {
254 ipath_mcast_free(mcast);
258 switch (ipath_mcast_add(dev, mcast, mqp)) {
262 ipath_mcast_free(mcast);
265 case EEXIST: /* The mcast wasn't used */
266 ipath_mcast_free(mcast);
269 /* Exceeded the maximum number of mcast groups. */
271 ipath_mcast_free(mcast);
288 struct ipath_mcast *mcast = NULL;
296 /* Find the GID in the mcast table. */
305 mcast = rb_entry(n, struct ipath_mcast, rb_node);
306 ret = memcmp(gid->raw, mcast->mgid.raw,
317 list_for_each_entry_safe(p, tmp, &mcast->qp_list, list) {
325 mcast->n_attached--;
328 if (list_empty(&mcast->qp_list)) {
329 rb_erase(&mcast->rb_node, &mcast_tree);
342 wait_event(mcast->wait, atomic_read(&mcast->refcount) <= 1);
346 atomic_dec(&mcast->refcount);
347 wait_event(mcast->wait, !atomic_read(&mcast->refcount));
348 ipath_mcast_free(mcast);