All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] opensm: added function that dumps PathRecords
@ 2010-04-08 13:29 Yevgeny Kliteynik
       [not found] ` <4BBDDA1E.7030102-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Yevgeny Kliteynik @ 2010-04-08 13:29 UTC (permalink / raw)
  To: Sasha Khapyorsky; +Cc: Linux RDMA, Jim Schut


Dumping SL, MTU and Rate for all the
non-switch-2-non-switch paths in the subnet.

PRs that are dumped:

  for every non-switch source port
      for every non-switch target LID in the subnet
          dump PR between source port and target LID

This way number of sources is equal to number of physical
non-switch ports in the subnet, and only number of targets
depends on LMC that is used.

Signed-off-by: Yevgeny Kliteynik <kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
---
 opensm/include/opensm/osm_sa.h     |   21 +++++++++
 opensm/opensm/osm_sa.c             |   81 ++++++++++++++++++++++++++++++++++++
 opensm/opensm/osm_sa_path_record.c |   12 +++++
 3 files changed, 114 insertions(+), 0 deletions(-)

diff --git a/opensm/include/opensm/osm_sa.h b/opensm/include/opensm/osm_sa.h
index d516310..40622ff 100644
--- a/opensm/include/opensm/osm_sa.h
+++ b/opensm/include/opensm/osm_sa.h
@@ -462,6 +462,27 @@ int osm_sa_db_file_load(struct osm_opensm *p_osm);
 *
 *********/

+/****f* OpenSM: SA/osm_sa_path_records_file_dump
+* NAME
+*	osm_sa_path_records_file_dump
+*
+* DESCRIPTION
+*	Dumps the SA Path Records to the dump file.
+*
+* SYNOPSIS
+*/
+int osm_sa_path_records_file_dump(struct osm_opensm *p_osm);
+/*
+* PARAMETERS
+*	p_osm
+*		[in] Pointer to an osm_opensm_t object.
+*
+* RETURN VALUES
+*	 0 on success
+*	!0 if some error occurred.
+*
+*********/
+
 /****f* OpenSM: MC Member Record Receiver/osm_mcmr_rcv_find_or_create_new_mgrp
 * NAME
 *	osm_mcmr_rcv_find_or_create_new_mgrp
diff --git a/opensm/opensm/osm_sa.c b/opensm/opensm/osm_sa.c
index 8aab548..83da258 100644
--- a/opensm/opensm/osm_sa.c
+++ b/opensm/opensm/osm_sa.c
@@ -718,6 +718,87 @@ int osm_sa_db_file_dump(osm_opensm_t * p_osm)
 	return res;
 }

+typedef struct _path_parms {
+	ib_net16_t pkey;
+	uint8_t mtu;
+	uint8_t rate;
+	uint8_t sl;
+	uint8_t pkt_life;
+	boolean_t reversible;
+} path_parms_t;
+
+extern ib_api_status_t osm_get_path_params(IN osm_sa_t * sa,
+				    IN const osm_port_t * p_src_port,
+				    IN const osm_port_t * p_dest_port,
+				    IN const uint16_t dlid_ho,
+				    OUT path_parms_t * p_parms);
+
+static void sa_dump_path_records(osm_opensm_t * p_osm, FILE * file)
+{
+	osm_port_t *p_src_port;
+	osm_port_t *p_dest_port;
+	osm_node_t *p_node;
+	uint16_t dlid_ho;
+	uint32_t vector_size;
+	osm_physp_t *p_physp;
+	path_parms_t path_parms;
+	ib_api_status_t status;
+
+	vector_size = cl_ptr_vector_get_size(&p_osm->subn.port_lid_tbl);
+	for (p_src_port = (osm_port_t *) cl_qmap_head(&p_osm->subn.port_guid_tbl);
+	     p_src_port != (osm_port_t *) cl_qmap_end(&p_osm->subn.port_guid_tbl);
+	     p_src_port = (osm_port_t *) cl_qmap_next(&p_src_port->map_item)) {
+
+		p_node = p_src_port->p_node;
+		if (p_node->node_info.node_type == IB_NODE_TYPE_SWITCH)
+			return;
+
+		p_physp = p_src_port->p_physp;
+		CL_ASSERT(p_physp->p_remote_physp);
+
+		fprintf(file, "%s 0x%016" PRIx64 ", base LID %d, "
+			"\"%s\", port %d\n# LID  : SL : MTU : RATE\n",
+			ib_get_node_type_str(p_node->node_info.node_type),
+			cl_ntoh64(p_src_port->guid),
+			cl_ntoh16(osm_port_get_base_lid(p_src_port)),
+			p_node->print_desc, p_physp->port_num);
+
+		memset(&path_parms, 0, sizeof(path_parms_t));
+
+		for (dlid_ho = 1; dlid_ho < vector_size; dlid_ho++) {
+
+			p_dest_port = (osm_port_t *) cl_ptr_vector_get(
+				&p_osm->subn.port_lid_tbl, dlid_ho);
+
+			if (!p_dest_port || !p_dest_port->p_node ||
+			    p_dest_port->p_node->node_info.node_type ==
+			    IB_NODE_TYPE_SWITCH)
+			continue;
+
+			status = osm_get_path_params(&p_osm->sa,
+				p_src_port, p_dest_port, dlid_ho,
+				(void*)&path_parms);
+
+			if (!status)
+				fprintf(file, "0x%04X : %-2d : %-3d : %-4d\n",
+					dlid_ho, path_parms.sl,
+					path_parms.mtu, path_parms.rate);
+			else
+				fprintf(file, "0x%04X : UNREACHABLE\n",
+					dlid_ho);
+		}
+		fprintf(file, "\n");
+	}
+}
+
+
+int osm_sa_path_records_file_dump(osm_opensm_t * p_osm)
+{
+	return opensm_dump_to_file(p_osm, p_osm->subn.opt.path_rec_file ?
+		p_osm->subn.opt.path_rec_file : "opensm-path-records.dump",
+		sa_dump_path_records);
+}
+
 /*
  *  SA DB Loader
  */
diff --git a/opensm/opensm/osm_sa_path_record.c b/opensm/opensm/osm_sa_path_record.c
index c4c3f86..b168428 100644
--- a/opensm/opensm/osm_sa_path_record.c
+++ b/opensm/opensm/osm_sa_path_record.c
@@ -743,6 +743,18 @@ Exit:
 	return status;
 }

+ib_api_status_t osm_get_path_params(IN osm_sa_t * sa,
+				    IN const osm_port_t * p_src_port,
+				    IN const osm_port_t * p_dest_port,
+				    IN const uint16_t dlid_ho,
+				    OUT osm_path_parms_t * p_parms)
+{
+	ib_path_rec_t pr;
+	memset(&pr, 0, sizeof(ib_path_rec_t));
+	return pr_rcv_get_path_parms(sa, &pr,
+		p_src_port, p_dest_port, dlid_ho, 0, p_parms);
+}
+
 static void pr_rcv_build_pr(IN osm_sa_t * sa, IN const osm_port_t * p_src_port,
 			    IN const osm_port_t * p_dest_port,
 			    IN const ib_gid_t * p_dgid,
-- 
1.5.1.4

--
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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/4] opensm: added function that dumps PathRecords
       [not found] ` <4BBDDA1E.7030102-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
@ 2010-04-14 22:16   ` Jim Schutt
       [not found]     ` <1271283366.4092.145.camel-mgfCWIlwujvg4c9jKm7R2O1ftBKYq+Ku@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Jim Schutt @ 2010-04-14 22:16 UTC (permalink / raw)
  To: Yevgeny Kliteynik; +Cc: Sasha Khapyorsky, Linux RDMA

Hi Yevgeny,

On Thu, 2010-04-08 at 07:29 -0600, Yevgeny Kliteynik wrote:
> Dumping SL, MTU and Rate for all the
> non-switch-2-non-switch paths in the subnet.
> 
> PRs that are dumped:
> 
>   for every non-switch source port
>       for every non-switch target LID in the subnet
>           dump PR between source port and target LID
> 
> This way number of sources is equal to number of physical
> non-switch ports in the subnet, and only number of targets
> depends on LMC that is used.
> 
> Signed-off-by: Yevgeny Kliteynik <kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
> ---

[snip]

> +
>  /****f* OpenSM: MC Member Record Receiver/osm_mcmr_rcv_find_or_create_new_mgrp
>  * NAME
>  *	osm_mcmr_rcv_find_or_create_new_mgrp
> diff --git a/opensm/opensm/osm_sa.c b/opensm/opensm/osm_sa.c
> index 8aab548..83da258 100644
> --- a/opensm/opensm/osm_sa.c
> +++ b/opensm/opensm/osm_sa.c
> @@ -718,6 +718,87 @@ int osm_sa_db_file_dump(osm_opensm_t * p_osm)
>  	return res;
>  }
> 
> +typedef struct _path_parms {
> +	ib_net16_t pkey;
> +	uint8_t mtu;
> +	uint8_t rate;
> +	uint8_t sl;
> +	uint8_t pkt_life;
> +	boolean_t reversible;
> +} path_parms_t;
> +
> +extern ib_api_status_t osm_get_path_params(IN osm_sa_t * sa,
> +				    IN const osm_port_t * p_src_port,
> +				    IN const osm_port_t * p_dest_port,
> +				    IN const uint16_t dlid_ho,
> +				    OUT path_parms_t * p_parms);
> +
> +static void sa_dump_path_records(osm_opensm_t * p_osm, FILE * file)
> +{
> +	osm_port_t *p_src_port;
> +	osm_port_t *p_dest_port;
> +	osm_node_t *p_node;
> +	uint16_t dlid_ho;
> +	uint32_t vector_size;
> +	osm_physp_t *p_physp;
> +	path_parms_t path_parms;
> +	ib_api_status_t status;
> +
> +	vector_size = cl_ptr_vector_get_size(&p_osm->subn.port_lid_tbl);
> +	for (p_src_port = (osm_port_t *) cl_qmap_head(&p_osm->subn.port_guid_tbl);
> +	     p_src_port != (osm_port_t *) cl_qmap_end(&p_osm->subn.port_guid_tbl);
> +	     p_src_port = (osm_port_t *) cl_qmap_next(&p_src_port->map_item)) {
> +
> +		p_node = p_src_port->p_node;
> +		if (p_node->node_info.node_type == IB_NODE_TYPE_SWITCH)
> +			return;

-			return;
+			continue;

Otherwise we stop dumping at the first switch we encounter?

-- Jim



--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 1/4] opensm: added function that dumps PathRecords
       [not found]     ` <1271283366.4092.145.camel-mgfCWIlwujvg4c9jKm7R2O1ftBKYq+Ku@public.gmane.org>
@ 2010-04-15 11:54       ` Yevgeny Kliteynik
  0 siblings, 0 replies; 3+ messages in thread
From: Yevgeny Kliteynik @ 2010-04-15 11:54 UTC (permalink / raw)
  To: Jim Schutt; +Cc: Sasha Khapyorsky, Linux RDMA

Hi Jim,

On 15/Apr/10 01:16, Jim Schutt wrote:
> Hi Yevgeny,
>
> On Thu, 2010-04-08 at 07:29 -0600, Yevgeny Kliteynik wrote:
>> Dumping SL, MTU and Rate for all the
>> non-switch-2-non-switch paths in the subnet.
>>
>> PRs that are dumped:
>>
>>    for every non-switch source port
>>        for every non-switch target LID in the subnet
>>            dump PR between source port and target LID
>>
>> This way number of sources is equal to number of physical
>> non-switch ports in the subnet, and only number of targets
>> depends on LMC that is used.
>>
>> Signed-off-by: Yevgeny Kliteynik<kliteyn-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
>> ---

[snip]
  
>> +		p_node = p_src_port->p_node;
>> +		if (p_node->node_info.node_type == IB_NODE_TYPE_SWITCH)
>> +			return;
>
> -			return;
> +			continue;
>
> Otherwise we stop dumping at the first switch we encounter?

Correct, thanks :)

-- Yevgeny

> -- Jim
>
>
>
> --
> 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
>

--
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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-04-15 11:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-04-08 13:29 [PATCH 1/4] opensm: added function that dumps PathRecords Yevgeny Kliteynik
     [not found] ` <4BBDDA1E.7030102-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2010-04-14 22:16   ` Jim Schutt
     [not found]     ` <1271283366.4092.145.camel-mgfCWIlwujvg4c9jKm7R2O1ftBKYq+Ku@public.gmane.org>
2010-04-15 11:54       ` Yevgeny Kliteynik

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.