From owner-svn-src-head@freebsd.org Sun Jun 17 07:08:48 2018 Return-Path: Delivered-To: svn-src-head@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 DBDF51011AD2; Sun, 17 Jun 2018 07:08:48 +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 844D182E96; Sun, 17 Jun 2018 07:08:48 +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 5FB1912144; Sun, 17 Jun 2018 07:08:48 +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 w5H78mQa006932; Sun, 17 Jun 2018 07:08:48 GMT (envelope-from slavash@FreeBSD.org) Received: (from slavash@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w5H78m4I006931; Sun, 17 Jun 2018 07:08:48 GMT (envelope-from slavash@FreeBSD.org) Message-Id: <201806170708.w5H78m4I006931@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: slavash set sender to slavash@FreeBSD.org using -f From: Slava Shwartsman Date: Sun, 17 Jun 2018 07:08:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r335282 - head/contrib/ofed/librdmacm/examples X-SVN-Group: head X-SVN-Commit-Author: slavash X-SVN-Commit-Paths: head/contrib/ofed/librdmacm/examples X-SVN-Commit-Revision: 335282 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 17 Jun 2018 07:08:49 -0000 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; }