[ofa-general] [PATCH] libibmad/rpc: fix class registration bug [was: Re: can't use perfquery from git against late kernels]

Sasha Khapyorsky sashak at voltaire.com
Thu Mar 12 05:10:04 PDT 2009


Fix class registration bug in mad_rpc_open_port(). Now it uses
mad_register_client_via() (and not mad_register_port_client()) which
returns status value and not an agent value - so don't overwrite by zero
agent number in port's class_agent array.

Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
---

Hi Or,

On 12:04 Thu 12 Mar     , Or Gerlitz wrote:
> 
> commit 070649d6dc832edde9cc3a289109b39211d80d7d
> Author: Sasha Khapyorsky <sashak at voltaire.com>
> Date:   Sat Mar 7 23:27:34 2009 +0200
> 
>     libibmad: cleanup deprecated function use
> 
>     This cleans up libibmad internal stuff from using potentially deprecated
>     functions, which may go away soon.
> 
>     Also removes DEPRECATED attribute from mad_register_port_client() - it
>     doesn't touch any global data.
> 
>     Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>

This commit breaks tools which use non-SM class (such as perfquery).
There is the fix, I will commit soon.

Sasha


 libibmad/src/rpc.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/libibmad/src/rpc.c b/libibmad/src/rpc.c
index 233874b..87f0cad 100644
--- a/libibmad/src/rpc.c
+++ b/libibmad/src/rpc.c
@@ -361,12 +361,11 @@ struct ibmad_port *mad_rpc_open_port(char *dev_name, int dev_port,
 	while (num_classes--) {
 		uint8_t rmpp_version = 0;
 		int mgmt = *mgmt_classes++;
-		int agent;
 
 		if (mgmt == IB_SA_CLASS)
 			rmpp_version = 1;
 		if (mgmt < 0 || mgmt >= MAX_CLASS ||
-		    (agent = mad_register_client_via(mgmt, rmpp_version, p)) < 0) {
+		    mad_register_client_via(mgmt, rmpp_version, p) < 0) {
 			IBWARN("client_register for mgmt %d failed", mgmt);
 			if (!errno)
 				errno = EINVAL;
@@ -374,7 +373,6 @@ struct ibmad_port *mad_rpc_open_port(char *dev_name, int dev_port,
 			free(p);
 			return NULL;
 		}
-		p->class_agents[mgmt] = agent;
 	}
 
 	return p;
-- 
1.6.1.2.319.gbd9e




More information about the general mailing list