All of lore.kernel.org
 help / color / mirror / Atom feed
From: "ira.weiny" <ira.weiny-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Hal Rosenstock <hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: Vladimir Koushnir
	<vladimirk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
	"linux-rdma
	(linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org)"
	<linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH infiniband-diags] dump_fts: Open global file descriptor after calling ibnd_discover_fabric
Date: Fri, 3 Jul 2015 11:21:35 -0400	[thread overview]
Message-ID: <20150703152134.GC15224@phlsvsds.ph.intel.com> (raw)
In-Reply-To: <55363F57.3020909-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>

On Tue, Apr 21, 2015 at 08:15:19AM -0400, Hal Rosenstock wrote:
> From: Vladimir Koushnir <vladimirk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Date: Thu, 16 Apr 2015 16:56:40 +0300
> 
> Global file descriptor for SMPs should be opened only after running
> ibnd_discover_fabric() to avoid parallel usage of two SMP file descriptors
> 
> Signed-off-by: Vladimir Koushnir <vladimirk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> Signed-off-by: Hal Rosenstock <hal-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>

Thanks applied,
Ira

> ---
>  src/dump_fts.c |   30 +++++++++++++++++++-----------
>  1 files changed, 19 insertions(+), 11 deletions(-)
> 
> diff --git a/src/dump_fts.c b/src/dump_fts.c
> index 0de61da..387211f 100644
> --- a/src/dump_fts.c
> +++ b/src/dump_fts.c
> @@ -457,33 +457,41 @@ int main(int argc, char **argv)
>  	if (argc > 1)
>  		endlid = strtoul(argv[1], 0, 0);
>  
> -	srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
> -	if (!srcport)
> -		IBEXIT("Failed to open '%s' port '%d'", ibd_ca, ibd_ca_port);
> -
>  	node_name_map = open_node_name_map(node_name_map_file);
>  
> -	smp_mkey_set(srcport, ibd_mkey);
> -
> -	if (ibd_timeout) {
> -		mad_rpc_set_timeout(srcport, ibd_timeout);
> +	if (ibd_timeout)
>  		config.timeout_ms = ibd_timeout;
> -	}
>  
>  	config.flags = ibd_ibnetdisc_flags;
>  	config.mkey = ibd_mkey;
>  
>  	if ((fabric = ibnd_discover_fabric(ibd_ca, ibd_ca_port, NULL,
>  						&config)) != NULL) {
> +
> +		srcport = mad_rpc_open_port(ibd_ca, ibd_ca_port, mgmt_classes, 3);
> +		if (!srcport) {
> +			fprintf(stderr,
> +				"Failed to open '%s' port '%d'\n", ibd_ca, ibd_ca_port);
> +			rc = -1;
> +			goto Exit;
> +		}
> +		smp_mkey_set(srcport, ibd_mkey);
> +
> +		if (ibd_timeout) {
> +			mad_rpc_set_timeout(srcport, ibd_timeout);
> +		}
> +
>  		ibnd_iter_nodes_type(fabric, process_switch, IB_NODE_SWITCH, fabric);
> +
> +		mad_rpc_close_port(srcport);
> +
>  	} else {
>  		fprintf(stderr, "Failed to discover fabric\n");
>  		rc = -1;
>  	}
> -
> +Exit:
>  	ibnd_destroy_fabric(fabric);
>  
> -	mad_rpc_close_port(srcport);
>  	close_node_name_map(node_name_map);
>  	exit(rc);
>  }
> -- 
> 1.7.8.2
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2015-07-03 15:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-21 12:15 [PATCH infiniband-diags] dump_fts: Open global file descriptor after calling ibnd_discover_fabric Hal Rosenstock
     [not found] ` <55363F57.3020909-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2015-04-22 15:27   ` ira.weiny
2015-07-03 15:21   ` ira.weiny [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150703152134.GC15224@phlsvsds.ph.intel.com \
    --to=ira.weiny-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=hal-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=vladimirk-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.