[ofa-general] Re: pick the outgoing HCA based on the IP used for bind

Or Gerlitz ogerlitz at voltaire.com
Thu Feb 5 04:03:42 PST 2009


Or Gerlitz wrote:
> Rick Frank who brought this to my attention, also handed me this patch
> which is claimed to workaround this issue, 
> --- ofa_kernel-1.3.1.orig/drivers/infiniband/core/addr.c
> +++ ofa_kernel-1.3.1/drivers/infiniband/core/addr.c
> @@ -174,15 +174,29 @@ static int addr_resolve_remote(struct so
>   struct flowi fl;
>   struct rtable *rt;
>   struct neighbour *neigh;
> + struct net_device *dev;
>   int ret;
>
>   memset(&fl, 0, sizeof fl);
>   fl.nl_u.ip4_u.daddr = dst_ip;
>   fl.nl_u.ip4_u.saddr = src_ip;
> +
> + if (src_ip && (dev = ip_dev_find(src_ip)) != NULL) {
> + fl.oif = dev->ifindex;
> + dev_put(dev);
> +
> + ret = ip_route_output_key(&rt, &fl);
> + if (ret == 0)
> + goto found;
I assume the trick here is to somehow enforce the interface returned by 
ip_dev_find and not the one resolved by the routing table. At least as I 
understand the addr.c code, it takes the interface later from neigh->dev 
, correct?

Or.


> + /* Fall back to using any local device */
> + fl.oif = 0;
> + }
>   ret = ip_route_output_key(&rt, &fl);
>   if (ret)
>   goto out;
>
> +found: ;
> +
>   /* If the device does ARP internally, return 'done' */
>   if (rt->idev->dev->flags & IFF_NOARP) {
>   rdma_copy_addr(addr, rt->idev->dev, NULL);





More information about the general mailing list