> It was originally written without the path->valid check in the "if", and so 
> was based on the path record
> being allocated within the "if".  In this case, the path record was not yet 
> inserted into the path list.
> When you added the "valid" processing, you did not take this into account.
> 
> You need code something like the following:
> 
>       path = __path_find(dev, phdr->hwaddr + 4);
>       if (!path || !path->valid) {
>               int had_path = 0;
>               if (!path)
>                       path = path_rec_create(dev, phdr->hwaddr + 4);
>               else
>                   had_path = 1;
>               if (path) {
>                       /* put pseudoheader back on for next time */
>                       skb_push(skb, sizeof *phdr);
>                       __skb_queue_tail(&path->queue, skb);
> 
>                       if (path_rec_start(dev, path)) {
>                               if (had_path)
>                                       /* detach from path list here under 
> spinlock */
>                               spin_unlock(&priv->lock);
>                               path_free(dev, path);
>                               return;
>                       } else if (!had_path)
>                               __path_add(dev, path);
>               } else {
>                       ++dev->stats.tx_dropped;
>                       dev_kfree_skb_any(skb);
>               }
> 
>               spin_unlock(&priv->lock);
>               return;
>       }

I hope I'm not missing something but __path_rec() checks for path existence
and returns -EEXIST if the path is not added.

                ret = memcmp(path->pathrec.dgid.raw, tpath->pathrec.dgid.raw,
                             sizeof (union ib_gid));
                if (ret < 0)
                        n = &pn->rb_left;
                else if (ret > 0)
                        n = &pn->rb_right;
                else
                        return -EEXIST;
        }

so the code you suggest may improve performance but I  don't see how it solves 
the bug.

_______________________________________________
general mailing list
[email protected]
http://lists.openfabrics.org/cgi-bin/mailman/listinfo/general

To unsubscribe, please visit http://openib.org/mailman/listinfo/openib-general

Reply via email to