From owner-svn-src-all@freebsd.org Mon Jun 25 07:25:42 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 562D1102894B; Mon, 25 Jun 2018 07:25:42 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id F34C38F2C3; Mon, 25 Jun 2018 07:25:41 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id C93BC2A1D5; Mon, 25 Jun 2018 07:25:41 +0000 (UTC) (envelope-from slavash@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w5P7PfMf000334; Mon, 25 Jun 2018 07:25:41 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5P7Pfor000333; Mon, 25 Jun 2018 07:25:41 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201806250725.w5P7Pfor000333@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Mon, 25 Jun 2018 07:25:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r335614 - stable/11/contrib/ofed/librdmacm/examples X-SVN-Group: stable-11 X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: stable/11/contrib/ofed/librdmacm/examples X-SVN-Commit-Revision: 335614 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jun 2018 07:25:42 -0000 Author: slavash Date: Mon Jun 25 07:25:41 2018 New Revision: 335614 URL: https://svnweb.freebsd.org/changeset/base/335614 Log: MFC r335282: 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. Approved by: hselasky (mentor), kib (mentor) Sponsored by: Mellanox Technologies Modified: stable/11/contrib/ofed/librdmacm/examples/mckey.c Directory Properties: stable/11/ (props changed) Modified: stable/11/contrib/ofed/librdmacm/examples/mckey.c ============================================================================== --- stable/11/contrib/ofed/librdmacm/examples/mckey.c Mon Jun 25 06:57:10 2018 (r335613) +++ stable/11/contrib/ofed/librdmacm/examples/mckey.c Mon Jun 25 07:25:41 2018 (r335614) @@ -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; }