Author: markj
Date: Mon Aug  1 20:27:11 2016
New Revision: 303635
URL: https://svnweb.freebsd.org/changeset/base/303635

Log:
  MFV 29f27e847: "IB/cma: Use cached gids"
  
  This addresses a regression from an earlier upstream change which caused
  cma_acquire_dev() to bypass the port GID cache and instead query the HCA
  for each entry in its GID table. These queries can become extremely slow on
  multiport devices, which has a negative impact on connection setup times.
  
  Discussed with:       hselasky
  Obtained from:        Linux
  MFC after:    2 weeks
  Sponsored by: EMC / Isilon Storage Division

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

Modified: head/sys/ofed/drivers/infiniband/core/cma.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/core/cma.c Mon Aug  1 20:02:59 2016        
(r303634)
+++ head/sys/ofed/drivers/infiniband/core/cma.c Mon Aug  1 20:27:11 2016        
(r303635)
@@ -485,7 +485,7 @@ static int cma_acquire_dev(struct rdma_i
        struct cma_device *cma_dev;
        union ib_gid gid, iboe_gid;
        int ret = -ENODEV;
-       u8 port;
+       u8 port, found_port;
        enum rdma_link_layer dev_ll = dev_addr->dev_type == ARPHRD_INFINIBAND ?
                IB_LINK_LAYER_INFINIBAND : IB_LINK_LAYER_ETHERNET;
 
@@ -500,21 +500,20 @@ static int cma_acquire_dev(struct rdma_i
        memcpy(&gid, dev_addr->src_dev_addr +
               rdma_addr_gid_offset(dev_addr), sizeof gid);
        list_for_each_entry(cma_dev, &dev_list, list) {
-               for (port = 1; port <= cma_dev->device->phys_port_cnt; ++port) {
+               for (port = 1; port <= cma_dev->device->phys_port_cnt; ++port)
                        if (rdma_port_get_link_layer(cma_dev->device, port) == 
dev_ll) {
                                if 
(rdma_node_get_transport(cma_dev->device->node_type) == RDMA_TRANSPORT_IB &&
                                    rdma_port_get_link_layer(cma_dev->device, 
port) == IB_LINK_LAYER_ETHERNET)
-                                       ret = find_gid_port(cma_dev->device, 
&iboe_gid, port);
+                                       ret = 
ib_find_cached_gid(cma_dev->device, &iboe_gid, &found_port, NULL);
                                else
-                                       ret = find_gid_port(cma_dev->device, 
&gid, port);
+                                       ret = 
ib_find_cached_gid(cma_dev->device, &gid, &found_port, NULL);
 
-                               if (!ret) {
+                               if (!ret && (port == found_port)) {
                                        id_priv->id.port_num = port;
                                        goto out;
                                } else if (ret == 1)
-                       break;
-       }
-               }
+                                       break;
+                       }
        }
 
 out:
_______________________________________________
svn-src-all@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to