[openib-general] Re: merge rdma_cm and ib_addr upstream

Or Gerlitz ogerlitz at voltaire.com
Wed Jan 11 07:01:15 PST 2006


Roland Dreier wrote:
> Yes, that's right.  Something like the patch below (compile tested
> only) is what is required.

good. I have committed the patch below and tested it to work fine.

Or.

use device->node_guid instead of device_attr->node_guid to match devices
corresponding to the same IP subnet

Signed-off-by: Or Gerlitz <ogerlitz.voltaire.com>

Index: iser_verbs.c
===================================================================
--- iser_verbs.c        (revision 4911)
+++ iser_verbs.c        (working copy)
@@ -1,6 +1,6 @@
  /*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2005 Cisco Systems.  All rights reserved.
+ * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2005, 2006 Cisco Systems.  All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
@@ -73,8 +73,6 @@ int iser_create_adaptor_ib_res(struct is
         struct ib_device          *device = p_iser_adaptor->device;
         struct ib_fmr_pool_param  params;

-       ib_query_device(device, &(p_iser_adaptor->device_attr));
-
         strcpy(p_iser_adaptor->name, device->name);
         iser_dbg("setting device name %s as adatptor name\n", 
device->name);

@@ -234,23 +232,16 @@ int iser_free_qp_and_id(struct iser_conn

  struct iser_adaptor *iser_adaptor_find_by_device(struct rdma_cm_id 
*cma_id)
  {
-       struct ib_device_attr *p_device_attr = NULL;
         struct list_head      *p_list;
         struct iser_adaptor   *p_adaptor = NULL;

-       p_device_attr = kmalloc(sizeof *p_device_attr, GFP_KERNEL);
-       if(p_device_attr == NULL)
-               goto end;
-
-       ib_query_device(cma_id->device, p_device_attr);
-
         spin_lock(&ig.adaptor_list_lock);

         p_list = ig.adaptor_list.next;
         while (p_list != &ig.adaptor_list) {
                 p_adaptor = list_entry(p_list, struct iser_adaptor, 
ig_list);
                 /* find if there's a match using the device GUID */
-               if (p_adaptor->device_attr.node_guid == 
p_device_attr->node_guid)
+               if (p_adaptor->device->node_guid == 
cma_id->device->node_guid)
                         break;
         }

@@ -268,7 +259,6 @@ struct iser_adaptor *iser_adaptor_find_b
         }
  end:
         spin_unlock(&ig.adaptor_list_lock);
-       kfree(p_device_attr);
         return p_adaptor;
  }

Index: iser.h
===================================================================
--- iser.h      (revision 4911)
+++ iser.h      (working copy)
@@ -1,6 +1,6 @@
  /*
- * Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
- * Copyright (c) 2005 Cisco Systems.  All rights reserved.
+ * Copyright (c) 2004, 2005, 2006 Voltaire, Inc. All rights reserved.
+ * Copyright (c) 2005, 2006 Cisco Systems.  All rights reserved.
   *
   * This software is available to you under a choice of one of two
   * licenses.  You may choose to be licensed under the terms of the GNU
@@ -105,7 +105,6 @@ struct iser_adaptor {
         struct list_head       ig_list; /* entry in ig adaptors list */

         struct ib_device       *device;
-       struct ib_device_attr  device_attr;

         struct ib_pd           *pd;
         struct ib_cq           *cq;




More information about the general mailing list