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

2006-01-11 Thread Or Gerlitz

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 

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;

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

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


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

2006-01-10 Thread Roland Dreier
Or> Just to make sure, would the __be64 node_guid field of struct
Or> ib_device have the exact semantics of the __be64 node_guid
Or> field of struct ib_device_attr ? iser uses it from the attr
Or> struct and we can sure move to use it from the device struct.

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

 - R.

---

Move iSER from getting node_guid via ib_query_device() to using the
node_guid field in struct ib_device, since ib_query_device() will stop
returning the node_guid soon.

Signed-off-by: Roland Dreier <[EMAIL PROTECTED]>

--- infiniband/ulp/iser/iser_verbs.c(revision 4866)
+++ infiniband/ulp/iser/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) 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;
 }
 
--- infiniband/ulp/iser/iser.h  (revision 4866)
+++ infiniband/ulp/iser/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) 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;
___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

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


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

2006-01-09 Thread Or Gerlitz

Sean Hefty wrote:

Roland Dreier wrote:

Sean> Roland, could you generate a patch (or push the changes
Sean> upstream) for the node_guid that will work with the mthca
Sean> version that is upstream?

Yes, I'll push that stuff upstream shortly.  I'd like to completely
kill the node_guid field in struct ib_device_attr at the same time.
Do you have a patch handy that does that?  I can generate it myself
pretty easily but I'd rather be lazy.


Sean,

Just to make sure, would the __be64 node_guid field of struct ib_device 
have the exact semantics of the __be64 node_guid field of struct 
ib_device_attr ? iser uses it from the attr struct and we can sure move 
to use it from the device struct.


Or.

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

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


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

2006-01-09 Thread Sean Hefty

Roland Dreier wrote:

Sean> Roland, could you generate a patch (or push the changes
Sean> upstream) for the node_guid that will work with the mthca
Sean> version that is upstream?

Yes, I'll push that stuff upstream shortly.  I'd like to completely
kill the node_guid field in struct ib_device_attr at the same time.
Do you have a patch handy that does that?  I can generate it myself
pretty easily but I'd rather be lazy.


I'll generate a patch to do that against Linus' git tree and forward to you.

- Sean

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

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


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

2006-01-09 Thread Roland Dreier
Sean> Roland, could you generate a patch (or push the changes
Sean> upstream) for the node_guid that will work with the mthca
Sean> version that is upstream?

Yes, I'll push that stuff upstream shortly.  I'd like to completely
kill the node_guid field in struct ib_device_attr at the same time.
Do you have a patch handy that does that?  I can generate it myself
pretty easily but I'd rather be lazy.

In svn, ehca still needs to be fixed up, but I sent email to the ehca
team asking them to initialize the node_guid field at initialization
time.  Once that happens we can kill the field in struct
ib_device_attr in svn too.

 - R.
___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

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


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

2006-01-09 Thread Sean Hefty

Hal Rosenstock wrote:

Also, isn't the fib_frontend.c patch needed too ?


It is, but I included that with my patch that adds ib_addr to the infiniband 
tree.

- Sean
___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

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


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

2006-01-09 Thread Hal Rosenstock
On Mon, 2006-01-09 at 18:13, Sean Hefty wrote:
> Sean Hefty wrote:
> > I installed git, pulled the latest tree, and am working on a set of 
> > patches for this.  I think that a patch series could be broken up as 
> > follows:
> > 
> > Address translation service.
> > Marshalling parameters between userspace and the kernel.
> > CM comparing private data.
> > Kernel CMA.
> > Userspace CMA kernel agent.
> > 
> > Hopefully I'm not missing anything else.
> 
> I'm missing one other piece: adding node_guid to ib_device.
> 
> Roland, could you generate a patch (or push the changes upstream) for the 
> node_guid that will work with the mthca version that is upstream?

Also, isn't the fib_frontend.c patch needed too ?

-- Hal

___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

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


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

2006-01-09 Thread Sean Hefty

Sean Hefty wrote:
I installed git, pulled the latest tree, and am working on a set of 
patches for this.  I think that a patch series could be broken up as 
follows:


Address translation service.
Marshalling parameters between userspace and the kernel.
CM comparing private data.
Kernel CMA.
Userspace CMA kernel agent.

Hopefully I'm not missing anything else.


I'm missing one other piece: adding node_guid to ib_device.

Roland, could you generate a patch (or push the changes upstream) for the 
node_guid that will work with the mthca version that is upstream?


- Sean
___
openib-general mailing list
openib-general@openib.org
http://openib.org/mailman/listinfo/openib-general

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