***SPAM*** Re: [ofa-general] [PATCH] opensm: PortInfo requests for discovered switches
Hal Rosenstock
hal.rosenstock at gmail.com
Sun Mar 1 17:24:38 PST 2009
On Sat, Feb 28, 2009 at 12:36 PM, Sasha Khapyorsky <sashak at voltaire.com> wrote:
>
> Request PortInfo for all switch ports right on first NodeInfo
> receiving and don't wait for SwitchInfo request results. This will
> simplify a subnet discovery flow and speed it up.
> Remove switch->discovery_count which is not needed anymore.
>
> Signed-off-by: Sasha Khapyorsky <sashak at voltaire.com>
> ---
> opensm/include/opensm/osm_switch.h | 6 ---
> opensm/opensm/osm_node_info_rcv.c | 83 ++++++++++++++----------------------
> opensm/opensm/osm_perfmgr.c | 1 -
> opensm/opensm/osm_state_mgr.c | 1 -
> opensm/opensm/osm_sw_info_rcv.c | 71 ------------------------------
> 5 files changed, 32 insertions(+), 130 deletions(-)
>
> diff --git a/opensm/include/opensm/osm_switch.h b/opensm/include/opensm/osm_switch.h
> index 6279727..3e3626b 100644
> --- a/opensm/include/opensm/osm_switch.h
> +++ b/opensm/include/opensm/osm_switch.h
> @@ -103,7 +103,6 @@ typedef struct osm_switch {
> uint8_t *lft;
> uint8_t *new_lft;
> osm_mcast_tbl_t mcast_tbl;
> - uint32_t discovery_count;
> unsigned endport_links;
> unsigned need_update;
> void *priv;
> @@ -145,11 +144,6 @@ typedef struct osm_switch {
> * mcast_tbl
> * Multicast forwarding table for this switch.
> *
> -* discovery_count
> -* The number of times this switch has been discovered
> -* during the current fabric sweep. This number is reset
> -* to zero at the start of a sweep.
> -*
> * need_update
> * When set indicates that switch was probably reset, so
> * fwd tables and rest cached data should be flushed
> diff --git a/opensm/opensm/osm_node_info_rcv.c b/opensm/opensm/osm_node_info_rcv.c
> index ac86b9a..e40fc82 100644
> --- a/opensm/opensm/osm_node_info_rcv.c
> +++ b/opensm/opensm/osm_node_info_rcv.c
> @@ -244,51 +244,43 @@ _exit:
> }
>
> /**********************************************************************
> - The plock must be held before calling this function.
> **********************************************************************/
> -static void
> -__osm_ni_rcv_process_new_node(IN osm_sm_t * sm,
> - IN osm_node_t * const p_node,
> - IN const osm_madw_t * const p_madw)
> +static void ni_rcv_get_port_info(IN osm_sm_t * sm, IN osm_node_t * node,
> + IN const osm_madw_t * madw)
> {
> - ib_api_status_t status = IB_SUCCESS;
> osm_madw_context_t context;
> - osm_physp_t *p_physp;
> - ib_node_info_t *p_ni;
> - ib_smp_t *p_smp;
> - uint8_t port_num;
> + osm_physp_t *physp;
> + ib_node_info_t *ni;
> + unsigned port, num_ports;
> + ib_api_status_t status;
>
> - OSM_LOG_ENTER(sm->p_log);
> + ni = ib_smp_get_payload_ptr(osm_madw_get_smp_ptr(madw));
>
> - p_smp = osm_madw_get_smp_ptr(p_madw);
> - p_ni = (ib_node_info_t *) ib_smp_get_payload_ptr(p_smp);
> - port_num = ib_node_info_get_local_port_num(p_ni);
> + if (ni->node_type == IB_NODE_TYPE_SWITCH) {
> + port = 0;
> + num_ports = osm_node_get_num_physp(node);
> + } else {
> + port = ib_node_info_get_local_port_num(ni);
> + num_ports = port + 1;
The else clause determination of num_ports doesn't look right to me.
Shouldn't it be
num_ports = ni->num_ports ?
-- Hal
[snip...]
More information about the general
mailing list