• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/infiniband/hw/ipath/

Lines Matching refs:mcast

50  * ipath_mcast_qp_alloc - alloc a struct to link a QP to mcast GID struct
87 struct ipath_mcast *mcast;
89 mcast = kmalloc(sizeof *mcast, GFP_KERNEL);
90 if (!mcast)
93 mcast->mgid = *mgid;
94 INIT_LIST_HEAD(&mcast->qp_list);
95 init_waitqueue_head(&mcast->wait);
96 atomic_set(&mcast->refcount, 0);
97 mcast->n_attached = 0;
100 return mcast;
103 static void ipath_mcast_free(struct ipath_mcast *mcast)
107 list_for_each_entry_safe(p, tmp, &mcast->qp_list, list)
110 kfree(mcast);
125 struct ipath_mcast *mcast;
132 mcast = rb_entry(n, struct ipath_mcast, rb_node);
134 ret = memcmp(mgid->raw, mcast->mgid.raw,
141 atomic_inc(&mcast->refcount);
148 mcast = NULL;
151 return mcast;
155 * ipath_mcast_add - insert mcast GID into table and attach QP struct
156 * @mcast: the mcast GID table
164 struct ipath_mcast *mcast,
180 ret = memcmp(mcast->mgid.raw, tmcast->mgid.raw,
220 mcast->n_attached++;
222 list_add_tail_rcu(&mqp->list, &mcast->qp_list);
224 atomic_inc(&mcast->refcount);
225 rb_link_node(&mcast->rb_node, pn, n);
226 rb_insert_color(&mcast->rb_node, &mcast_tree);
240 struct ipath_mcast *mcast;
248 mcast = ipath_mcast_alloc(gid);
249 if (mcast == NULL) {
255 ipath_mcast_free(mcast);
259 switch (ipath_mcast_add(dev, mcast, mqp)) {
263 ipath_mcast_free(mcast);
266 case EEXIST: /* The mcast wasn't used */
267 ipath_mcast_free(mcast);
270 /* Exceeded the maximum number of mcast groups. */
272 ipath_mcast_free(mcast);
289 struct ipath_mcast *mcast = NULL;
297 /* Find the GID in the mcast table. */
306 mcast = rb_entry(n, struct ipath_mcast, rb_node);
307 ret = memcmp(gid->raw, mcast->mgid.raw,
318 list_for_each_entry_safe(p, tmp, &mcast->qp_list, list) {
326 mcast->n_attached--;
329 if (list_empty(&mcast->qp_list)) {
330 rb_erase(&mcast->rb_node, &mcast_tree);
343 wait_event(mcast->wait, atomic_read(&mcast->refcount) <= 1);
347 atomic_dec(&mcast->refcount);
348 wait_event(mcast->wait, !atomic_read(&mcast->refcount));
349 ipath_mcast_free(mcast);