Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 17 Jun 2018 07:08:48 +0000 (UTC)
From:      Slava Shwartsman <slavash@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r335282 - head/contrib/ofed/librdmacm/examples
Message-ID:  <201806170708.w5H78m4I006931@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: slavash
Date: Sun Jun 17 07:08:47 2018
New Revision: 335282
URL: https://svnweb.freebsd.org/changeset/base/335282

Log:
  Fix false positive on failure
  
  When running mckey, errors may happen in the init/connect stage.
  When leaving multicast groups, we override this value.
  
  Fix that by saving the return value from rdma_leave_multicast to different
  parameter, and only in case of failure in rdma_leave_multicast override it.
  
  MFC after:      1 week
  Approved by:    hselasky (mentor), kib (mentor)
  Sponsored by:   Mellanox Technologies

Modified:
  head/contrib/ofed/librdmacm/examples/mckey.c

Modified: head/contrib/ofed/librdmacm/examples/mckey.c
==============================================================================
--- head/contrib/ofed/librdmacm/examples/mckey.c	Sun Jun 17 06:25:32 2018	(r335281)
+++ head/contrib/ofed/librdmacm/examples/mckey.c	Sun Jun 17 07:08:47 2018	(r335282)
@@ -475,7 +475,7 @@ static int get_dst_addr(char *dst, struct sockaddr *ad
 
 static int run(void)
 {
-	int i, ret;
+	int i, ret, err;
 
 	printf("mckey: starting %s\n", is_sender ? "client" : "server");
 	if (src_addr) {
@@ -543,10 +543,12 @@ static int run(void)
 	}
 out:
 	for (i = 0; i < connections; i++) {
-		ret = rdma_leave_multicast(test.nodes[i].cma_id,
+		err = rdma_leave_multicast(test.nodes[i].cma_id,
 					   test.dst_addr);
-		if (ret)
+		if (err) {
 			perror("mckey: failure leaving");
+			ret = err;
+		}
 	}
 	return ret;
 }



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806170708.w5H78m4I006931>