Re: [openib-general] [PATCH v3] ib_sa: require SA registration

2006-09-13 Thread Sean Hefty
Roland Dreier wrote:
> OK, I added the following to my for-2.6.19 branch.  The differences
> from your patch are:
> 
>  - CMA can have a static variable (good to avoid clashes with a global
>'sa_client' variable name too)
>  - IPoIB does not use multicast module upstream, fix ipoib_multicast.c too.
>  - Simplify sa_query.c changes a little.  I don't like the
>"deref_client" name for a function, since it sounds too much like
>dereferencing a pointer rather than dropping a reference.  And I
>also didn't like ib_sa_client_get() having a magic side effect of
>setting query->client.  So I just open-coded more stuff.
> 
> How does this look?

I took the changes in your for-2.6.19 branch, modified the original patch to 
match, and committed that to svn.

- 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] [PATCH v3] ib_sa: require SA registration

2006-09-11 Thread Sean Hefty
> - CMA can have a static variable (good to avoid clashes with a global
>   'sa_client' variable name too)

Sounds good - that's a goof on my part.

> - IPoIB does not use multicast module upstream, fix ipoib_multicast.c too.

Okay - As an FYI, I will probably submit the multicast module upstream for
2.6.20, along with some sort of support for userspace access.

> - Simplify sa_query.c changes a little.  I don't like the
>   "deref_client" name for a function, since it sounds too much like
>   dereferencing a pointer rather than dropping a reference.  And I
>   also didn't like ib_sa_client_get() having a magic side effect of
>   setting query->client.  So I just open-coded more stuff.

Those changes sound fine to me.

- 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] [PATCH v3] ib_sa: require SA registration

2006-09-11 Thread Roland Dreier
OK, I added the following to my for-2.6.19 branch.  The differences
from your patch are:

 - CMA can have a static variable (good to avoid clashes with a global
   'sa_client' variable name too)
 - IPoIB does not use multicast module upstream, fix ipoib_multicast.c too.
 - Simplify sa_query.c changes a little.  I don't like the
   "deref_client" name for a function, since it sounds too much like
   dereferencing a pointer rather than dropping a reference.  And I
   also didn't like ib_sa_client_get() having a magic side effect of
   setting query->client.  So I just open-coded more stuff.

How does this look?

 - 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] [PATCH v3] ib_sa: require SA registration

2006-09-11 Thread Michael S. Tsirkin
Quoting r. Roland Dreier <[EMAIL PROTECTED]>:
> Subject: Re: [PATCH v3] ib_sa: require SA registration
> 
> Sean> Roland, Not sure if you've had a chance to review the SA
> Sean> patches, but any comments on any of the SA related patches?
> Sean> (SA registration, generic RMPP query support, or userspace
> Sean> SA)
> 
> I haven't really read the later patches but I am planning on merging
> at least the registration stuff for 2.6.19.

Yes, the registration stuff is clearly safe

-- 
MST

___
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] [PATCH v3] ib_sa: require SA registration

2006-09-11 Thread Sean Hefty
Roland Dreier wrote:
> I haven't really read the later patches but I am planning on merging
> at least the registration stuff for 2.6.19.

I'd like to commit the SA related patches soon.  There have been several 
e-mails 
recently about using IB multicast and the IB CM directly.

- 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] [PATCH v3] ib_sa: require SA registration

2006-08-28 Thread Roland Dreier
Sean> Roland, Not sure if you've had a chance to review the SA
Sean> patches, but any comments on any of the SA related patches?
Sean> (SA registration, generic RMPP query support, or userspace
Sean> SA)

I haven't really read the later patches but I am planning on merging
at least the registration stuff for 2.6.19.

 - 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] [PATCH v3] ib_sa: require SA registration

2006-08-28 Thread Sean Hefty
Roland,

Not sure if you've had a chance to review the SA patches, but any comments on 
any of the SA related patches?  (SA registration, generic RMPP query support, 
or 
userspace SA)

- 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



[openib-general] [PATCH v3] ib_sa: require SA registration

2006-08-21 Thread Sean Hefty
Require registration with SA module, to prevent module text
from going away while sa query callback is still running,
and update all users.

Signed-off-by: Michael S. Tsirkin 
Signed-off-by: Sean Hefty 
---
Changes from the previous post include:

* Move struct ib_sa_client definition external.

Index: include/rdma/ib_sa.h
===
--- include/rdma/ib_sa.h(revision 8928)
+++ include/rdma/ib_sa.h(working copy)
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2004 Topspin Communications.  All rights reserved.
  * Copyright (c) 2005 Voltaire, Inc.  All rights reserved.
+ * Copyright (c) 2006 Intel Corporation.  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
@@ -36,6 +37,9 @@
 #ifndef IB_SA_H
 #define IB_SA_H
 
+#include 
+
+#include 
 #include 
 
 #include 
@@ -250,11 +254,28 @@ struct ib_sa_service_rec {
u64 data64[2];
 };
 
+struct ib_sa_client {
+   atomic_t users;
+   struct completion comp;
+};
+
+/**
+ * ib_sa_register_client - Register an SA client.
+ */
+void ib_sa_register_client(struct ib_sa_client *client);
+
+/**
+ * ib_sa_unregister_client - Deregister an SA client.
+ * @client: Client object to deregister.
+ */
+void ib_sa_unregister_client(struct ib_sa_client *client);
+
 struct ib_sa_query;
 
 void ib_sa_cancel_query(int id, struct ib_sa_query *query);
 
-int ib_sa_path_rec_get(struct ib_device *device, u8 port_num,
+int ib_sa_path_rec_get(struct ib_sa_client *client,
+  struct ib_device *device, u8 port_num,
   struct ib_sa_path_rec *rec,
   ib_sa_comp_mask comp_mask,
   int timeout_ms, int retries, gfp_t gfp_mask,
@@ -264,7 +285,8 @@ int ib_sa_path_rec_get(struct ib_device 
   void *context,
   struct ib_sa_query **query);
 
-int ib_sa_mcmember_rec_query(struct ib_device *device, u8 port_num,
+int ib_sa_mcmember_rec_query(struct ib_sa_client *client,
+struct ib_device *device, u8 port_num,
 u8 method,
 struct ib_sa_mcmember_rec *rec,
 ib_sa_comp_mask comp_mask,
@@ -275,7 +297,8 @@ int ib_sa_mcmember_rec_query(struct ib_d
 void *context,
 struct ib_sa_query **query);
 
-int ib_sa_service_rec_query(struct ib_device *device, u8 port_num,
+int ib_sa_service_rec_query(struct ib_sa_client *client,
+struct ib_device *device, u8 port_num,
 u8 method,
 struct ib_sa_service_rec *rec,
 ib_sa_comp_mask comp_mask,
@@ -288,6 +311,7 @@ int ib_sa_service_rec_query(struct ib_de
 
 /**
  * ib_sa_mcmember_rec_set - Start an MCMember set query
+ * @client:SA client
  * @device:device to send query on
  * @port_num: port number to send query on
  * @rec:MCMember Record to send in query
@@ -312,7 +336,8 @@ int ib_sa_service_rec_query(struct ib_de
  * cancel the query.
  */
 static inline int
-ib_sa_mcmember_rec_set(struct ib_device *device, u8 port_num,
+ib_sa_mcmember_rec_set(struct ib_sa_client *client,
+  struct ib_device *device, u8 port_num,
   struct ib_sa_mcmember_rec *rec,
   ib_sa_comp_mask comp_mask,
   int timeout_ms, int retries, gfp_t gfp_mask,
@@ -322,7 +347,7 @@ ib_sa_mcmember_rec_set(struct ib_device 
   void *context,
   struct ib_sa_query **query)
 {
-   return ib_sa_mcmember_rec_query(device, port_num,
+   return ib_sa_mcmember_rec_query(client, device, port_num,
IB_MGMT_METHOD_SET,
rec, comp_mask,
timeout_ms, retries, gfp_mask, callback,
@@ -331,6 +356,7 @@ ib_sa_mcmember_rec_set(struct ib_device 
 
 /**
  * ib_sa_mcmember_rec_delete - Start an MCMember delete query
+ * @client:SA client
  * @device:device to send query on
  * @port_num: port number to send query on
  * @rec:MCMember Record to send in query
@@ -355,7 +381,8 @@ ib_sa_mcmember_rec_set(struct ib_device 
  * cancel the query.
  */
 static inline int
-ib_sa_mcmember_rec_delete(struct ib_device *device, u8 port_num,
+ib_sa_mcmember_rec_delete(struct ib_sa_client *client,
+ struct ib_device *device, u8 port_num,
  struct ib_sa_mcmember_rec *rec,
  ib_sa_comp_mask comp_mask,
  int timeout_ms, int retries, gfp_t gfp_mask,
@@ -365,7 +392,7 @@ ib_sa_mcmember_rec_delete(struct ib_devi
  void *context,
  struct ib_sa_query **query)
 {
-   return ib_sa_mcmember_rec_query