[ofa-general] Re: [PATCH] infiniband-diags/ibsysstat: use RMPP for client/server communication

Sasha Khapyorsky sashak at voltaire.com
Tue Jan 27 04:46:56 PST 2009


On 14:19 Tue 27 Jan     , Sasha Khapyorsky wrote:
> 
> diff --git a/infiniband-diags/src/ibsysstat.c b/infiniband-diags/src/ibsysstat.c
> index c20a6f0..a145daf 100644
> --- a/infiniband-diags/src/ibsysstat.c
> +++ b/infiniband-diags/src/ibsysstat.c
> @@ -169,6 +174,11 @@ static char *ibsystat_serv(void)
>  	DEBUG("starting to serve...");
>  
>  	while ((umad = mad_receive(buf, -1))) {
> +		if (umad_status(buf)) {
> +			DEBUG("drop mad with status %x: %s", umad_status(buf),
> +			      strerror(umad_status(buf)));
> +			continue;
> +		}

And also to prevent timeouts when we are not really using large packets:


diff --git a/infiniband-diags/src/ibsysstat.c b/infiniband-diags/src/ibsysstat.c
index c20a6f0..2d44ef6 100644
--- a/infiniband-diags/src/ibsysstat.c
+++ b/infiniband-diags/src/ibsysstat.c
@@ -89,7 +89,8 @@ static int server_respond(void *umad, int size)
 	rpc.oui = mad_get_field(mad, 0, IB_VEND2_OUI_F);
 	rpc.trid = mad_get_field64(mad, 0, IB_MAD_TRID_F);
 
-	rmpp.flags = IB_RMPP_FLAG_ACTIVE;
+	if (size > IB_MAD_SIZE)
+		rmpp.flags = IB_RMPP_FLAG_ACTIVE;
 
 	DEBUG("responding %d bytes to %s, attr 0x%x mod 0x%x qkey %x",
 	      size, portid2str(&rport), rpc.attr.id, rpc.attr.mod, rport.qkey);

Sasha



More information about the general mailing list