Lines Matching defs:path
73 struct ipoib_path path;
323 struct ipoib_path *path;
327 path = rb_entry(n, struct ipoib_path, rb_node);
329 ret = memcmp(gid, path->pathrec.dgid.raw,
337 return path;
344 __path_add(struct ipoib_dev_priv *priv, struct ipoib_path *path)
355 ret = memcmp(path->pathrec.dgid.raw, tpath->pathrec.dgid.raw,
365 rb_link_node(&path->rb_node, pn, n);
366 rb_insert_color(&path->rb_node, &priv->path_tree);
368 list_add_tail(&path->list, &priv->path_list);
374 ipoib_path_free(struct ipoib_dev_priv *priv, struct ipoib_path *path)
377 _IF_DRAIN(&path->queue);
379 if (path->ah)
380 ipoib_put_ah(path->ah);
381 if (ipoib_cm_get(path))
382 ipoib_cm_destroy_tx(ipoib_cm_get(path));
384 kfree(path);
399 memset(iter->path.pathrec.dgid.raw, 0, 16);
414 struct ipoib_path *path;
422 path = rb_entry(n, struct ipoib_path, rb_node);
424 if (memcmp(iter->path.pathrec.dgid.raw, path->pathrec.dgid.raw,
426 iter->path = *path;
440 ipoib_path_iter_read(struct ipoib_path_iter *iter, struct ipoib_path *path)
442 *path = iter->path;
450 struct ipoib_path *path, *tp;
454 list_for_each_entry_safe(path, tp, &priv->path_list, list) {
455 ipoib_dbg(priv, "mark path LID 0x%04x GID %16D invalid\n",
456 be16_to_cpu(path->pathrec.dlid),
457 path->pathrec.dgid.raw, ":");
458 path->valid = 0;
467 struct ipoib_path *path, *tp;
475 list_for_each_entry(path, &remove_list, list)
476 rb_erase(&path->rb_node, &priv->path_tree);
478 list_for_each_entry_safe(path, tp, &remove_list, list) {
479 if (path->query)
480 ib_sa_cancel_query(path->query_id, path->query);
482 wait_for_completion(&path->done);
483 ipoib_path_free(priv, path);
493 struct ipoib_path *path = path_ptr;
494 struct ipoib_dev_priv *priv = path->priv;
507 status, path->pathrec.dgid.raw, ":");
521 path->pathrec = *pathrec;
523 old_ah = path->ah;
524 path->ah = ah;
530 _IF_DEQUEUE(&path->queue, mb);
537 if (ipoib_cm_enabled(priv, path->hwaddr) && !ipoib_cm_get(path))
538 ipoib_cm_set(path, ipoib_cm_create_tx(priv, path));
541 path->valid = 1;
544 path->query = NULL;
545 complete(&path->done);
566 struct ipoib_path *path;
571 path = kzalloc(sizeof *path, GFP_ATOMIC);
572 if (!path)
575 path->priv = priv;
577 bzero(&path->queue, sizeof(path->queue));
580 memcpy(&path->hwaddr, hwaddr, INFINIBAND_ALEN);
582 memcpy(path->pathrec.dgid.raw, &hwaddr[4], sizeof (union ib_gid));
583 path->pathrec.sgid = priv->local_gid;
584 path->pathrec.pkey = cpu_to_be16(priv->pkey);
585 path->pathrec.numb_path = 1;
586 path->pathrec.traffic_class = priv->broadcast->mcmember.traffic_class;
588 return path;
592 path_rec_start(struct ipoib_dev_priv *priv, struct ipoib_path *path)
599 p_rec = path->pathrec;
622 ipoib_dbg(priv, "Start path record lookup for %16D MTU > %d\n",
626 init_completion(&path->done);
628 path->query_id =
638 path, &path->query);
639 if (path->query_id < 0) {
640 ipoib_warn(priv, "ib_sa_path_rec_get failed: %d\n", path->query_id);
641 path->query = NULL;
642 complete(&path->done);
643 return path->query_id;
652 struct ipoib_path *path;
654 path = __path_find(priv, eh->hwaddr + 4);
655 if (!path || !path->valid) {
658 if (!path) {
659 path = path_rec_create(priv, eh->hwaddr);
662 if (path) {
663 _IF_ENQUEUE(&path->queue, mb);
664 if (!path->query && path_rec_start(priv, path)) {
667 ipoib_path_free(priv, path);
670 __path_add(priv, path);
679 if (ipoib_cm_get(path) && ipoib_cm_up(path)) {
680 ipoib_cm_send(priv, mb, ipoib_cm_get(path));
681 } else if (path->ah) {
682 ipoib_send(priv, mb, path->ah, IPOIB_QPN(eh->hwaddr));
683 } else if ((path->query || !path_rec_start(priv, path)) &&
684 path->queue.ifq_len < IPOIB_MAX_PATH_REC_QUEUE) {
685 _IF_ENQUEUE(&path->queue, mb);