Author: hselasky
Date: Mon Mar  5 14:22:36 2018
New Revision: 330506
URL: https://svnweb.freebsd.org/changeset/base/330506

Log:
  Pass valid if_index to rdma_addr_find_l2_eth_by_grh() in ibcore when possible.
  
  MFC after:    1 week
  Sponsored by: Mellanox Technologies

Modified:
  head/sys/ofed/drivers/infiniband/core/ib_verbs.c

Modified: head/sys/ofed/drivers/infiniband/core/ib_verbs.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/core/ib_verbs.c    Mon Mar  5 13:58:03 
2018        (r330505)
+++ head/sys/ofed/drivers/infiniband/core/ib_verbs.c    Mon Mar  5 14:22:36 
2018        (r330506)
@@ -483,7 +483,7 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 po
                return ret;
 
        if (rdma_protocol_roce(device, port_num)) {
-               int if_index = 0;
+               int if_index;
                u16 vlan_id = wc->wc_flags & IB_WC_WITH_VLAN ?
                                wc->vlan_id : 0xffff;
                struct net_device *idev;
@@ -498,6 +498,12 @@ int ib_init_ah_from_wc(struct ib_device *device, u8 po
                idev = device->get_netdev(device, port_num);
                if (!idev)
                        return -ENODEV;
+
+               /*
+                * Get network interface index early on. This is
+                * useful for IPv6 link local addresses:
+                */
+               if_index = idev->if_index;
 
                ret = rdma_addr_find_l2_eth_by_grh(&dgid, &sgid,
                                                   ah_attr->dmac,
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to