diff mbox

[opensm] osm_perfmgr.c: Reset physp_discovered before discovery

Message ID 548882ED.5000400@dev.mellanox.co.il (mailing list archive)
State Accepted
Delegated to: Hal Rosenstock
Headers show

Commit Message

Hal Rosenstock Dec. 10, 2014, 5:29 p.m. UTC
From: Daniel Klein <danielk@mellanox.com>

Bug description:
When PerfMgr starts discovery, it resets the discovery_count of ports and
node, but it doesn't reset the physp_discoved buffers.
As a result, the drop manager frees osm_port_t and osm_physp_t objects
of nodes without removing the nodes themselves.
On the next discovery process, when OpenSM receives responses for
NodeInfo from a switch, it treats it as a NodeInfo from an existing
node and assumes that osm_physp_t objects of the switch exists and tries
to access them.

This change adds code that clears the physp_discoverd buffers of all nodes
at the beginning of the discovery process in PerfMgr.

Signed-off-by: Daniel Klein <danielk@mellanox.com>
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
---
 opensm/osm_perfmgr.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
diff mbox

Patch

diff --git a/opensm/osm_perfmgr.c b/opensm/osm_perfmgr.c
index 4ab654b..993fdb7 100644
--- a/opensm/osm_perfmgr.c
+++ b/opensm/osm_perfmgr.c
@@ -985,6 +985,9 @@  static void reset_node_count(cl_map_item_t * p_map_item, void *cxt)
 {
 	osm_node_t *p_node = (osm_node_t *) p_map_item;
 	p_node->discovery_count = 0;
+
+	memset(p_node->physp_discovered, 0,
+	       sizeof(uint8_t) * p_node->physp_tbl_size);
 }
 
 static void reset_port_count(cl_map_item_t * p_map_item, void *cxt)