Skip to contentSkip to conversation

opensm/osm_pkey_mgr: clean partition enforcement on inter-switch links

PATCH In review Eli Dorfman 3 participants 4 messages May 3, 2011 – May 15, 2011 2 messages not in the archive InfiniBand

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 opensm/osm_pkey_mgr: clean partition enforcement on inter-switch links

clean partition enforcement on inter-switch links

after connectivity change from switch-host to switch-switch the partition enforcement bits were not cleared on the port. since the pkey table is not set on inter-switch links, packets with pkey other than default are dropped.

---
 opensm/osm_pkey_mgr.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
opensm/osm_pkey_mgr.c +24 -0
index f6bc9d1..b135cf9 100644
@@ -507,6 +507,10 @@ int osm_pkey_mgr_process(IN osm_opensm_t * p_osm)
 	cl_map_item_t *p_next;
 	osm_prtn_t *p_prtn;
 	osm_port_t *p_port;
+	osm_switch_t *p_sw;
+	osm_physp_t *p_physp;
+	osm_node_t *p_remote_node;
+	uint8_t i;
 	int ret = 0;
 
 	CL_ASSERT(p_osm);
@@ -550,6 +554,26 @@ int osm_pkey_mgr_process(IN osm_opensm_t * p_osm)
 			ret = -1;
 	}
 
+	/* clear partition enforcement on inter-switch links */
+	p_tbl = &p_osm->subn.sw_guid_tbl;
+	p_next = cl_qmap_head(p_tbl);
+	while (p_next != cl_qmap_end(p_tbl)) {
+		p_sw = (osm_switch_t * *) p_next;
+		p_next = cl_qmap_next(p_next);
+		for (i = 1; i < p_sw->num_ports; i++) {
+			p_physp = osm_node_get_physp_ptr(p_sw->p_node, i);
+			if (p_physp && p_physp->p_remote_physp)
+				p_remote_node = p_physp->p_remote_physp->p_node;
+			else
+				continue;
+			if (osm_node_get_type(p_remote_node) != IB_NODE_TYPE_SWITCH)
+				continue;
+
+			/* clear partition enforcement */
+			if (pkey_mgr_enforce_partition(&p_osm->log, &p_osm->sm, p_physp, FALSE))
+				ret = -1;
+		}
+	}
 _err:
 	CL_PLOCK_RELEASE(&p_osm->lock);
 	OSM_LOG_EXIT(&p_osm->log);
Signature · 6 lines
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to a message not in the archive

Hi Eli,

Quoted 37 lines · Eli Dorfman

clean partition enforcement on inter-switch links

after connectivity change from switch-host to switch-switch the partition enforcement bits were not cleared on the port. since the pkey table is not set on inter-switch links, packets with pkey other than default are dropped.

---
 opensm/osm_pkey_mgr.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)
opensm/osm_pkey_mgr.c +10 -0
index f6bc9d1..b135cf9 100644
@@ -507,6 +507,10 @@ int osm_pkey_mgr_process(IN osm_opensm_t * p_osm)
 	cl_map_item_t *p_next;
 	osm_prtn_t *p_prtn;
 	osm_port_t *p_port;
+	osm_switch_t *p_sw;
+	osm_physp_t *p_physp;
+	osm_node_t *p_remote_node;
+	uint8_t i;
 	int ret = 0;
 
 	CL_ASSERT(p_osm);
@@ -550,6 +554,26 @@ int osm_pkey_mgr_process(IN osm_opensm_t * p_osm)
 			ret = -1;
 	}
 
+	/* clear partition enforcement on inter-switch links */
+	p_tbl = &p_osm->subn.sw_guid_tbl;
+	p_next = cl_qmap_head(p_tbl);
+	while (p_next != cl_qmap_end(p_tbl)) {
+		p_sw = (osm_switch_t * *) p_next;
+		p_next = cl_qmap_next(p_next);

opensm/osm_pkey_mgr.c int osm_pkey_mgr_process(IN osm_opensm_t * p_osm) · line 572

Quoted 10 lines
opensm/osm_pkey_mgr.c +10 -0
+		for (i = 1; i < p_sw->num_ports; i++) {
+			p_physp = osm_node_get_physp_ptr(p_sw->p_node, i);
+			if (p_physp && p_physp->p_remote_physp)
+				p_remote_node = p_physp->p_remote_physp->p_node;
+			else
+				continue;
+			if (osm_node_get_type(p_remote_node) != IB_NODE_TYPE_SWITCH)
+				continue;
+
+			/* clear partition enforcement */

Don't you want limit the pkey_mgr_enforce_partition() only on ports that have these bits enable in portinfo?
Something like:

			if(! p_physp->p_remote_physp->port_info.vl_enforce && 0xc )
				continue;
Quoted 14 lines
opensm/osm_pkey_mgr.c +4 -0
+			if (pkey_mgr_enforce_partition(&p_osm->log, &p_osm->sm, p_physp, FALSE))
+				ret = -1;
+		}
+	}
 _err:
 	CL_PLOCK_RELEASE(&p_osm->lock);
 	OSM_LOG_EXIT(&p_osm->log);
Signature · 6 lines
1.7.4.1

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 5 lines
-- Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#4 lore raw
In reply to a message not in the archive
Quoted 55 lines · Alex Netes

Hi Eli,

Quoted 37 lines · Eli Dorfman

clean partition enforcement on inter-switch links

after connectivity change from switch-host to switch-switch the partition enforcement bits were not cleared on the port. since the pkey table is not set on inter-switch links, packets with pkey other than default are dropped.

---
 opensm/osm_pkey_mgr.c |   24 ++++++++++++++++++++++++

 1 files changed, 24 insertions(+), 0 deletions(-)
opensm/osm_pkey_mgr.c +10 -0
index f6bc9d1..b135cf9 100644
@@ -507,6 +507,10 @@ int osm_pkey_mgr_process(IN osm_opensm_t * p_osm)
       cl_map_item_t *p_next;
       osm_prtn_t *p_prtn;
       osm_port_t *p_port;
+     osm_switch_t *p_sw;
+     osm_physp_t *p_physp;
+     osm_node_t *p_remote_node;
+     uint8_t i;
       int ret = 0;
 
       CL_ASSERT(p_osm);
@@ -550,6 +554,26 @@ int osm_pkey_mgr_process(IN osm_opensm_t * p_osm)
                       ret = -1;
       }
 
+     /* clear partition enforcement on inter-switch links */
+     p_tbl = &p_osm->subn.sw_guid_tbl;
+     p_next = cl_qmap_head(p_tbl);
+     while (p_next != cl_qmap_end(p_tbl)) {
+             p_sw = (osm_switch_t * *) p_next;
+             p_next = cl_qmap_next(p_next);

opensm/osm_pkey_mgr.c int osm_pkey_mgr_process(IN osm_opensm_t * p_osm) · line 572

Quoted 10 lines
opensm/osm_pkey_mgr.c +10 -0
+             for (i = 1; i < p_sw->num_ports; i++) {
+                     p_physp = osm_node_get_physp_ptr(p_sw->p_node, i);
+                     if (p_physp && p_physp->p_remote_physp)
+                             p_remote_node = p_physp->p_remote_physp->p_node;
+                     else
+                             continue;
+                     if (osm_node_get_type(p_remote_node) != IB_NODE_TYPE_SWITCH)
+                             continue;
+
+                     /* clear partition enforcement */

Don't you want limit the pkey_mgr_enforce_partition() only on ports that have these bits enable in portinfo?
Something like:

Quoted 3 lines

                       if(! p_physp->p_remote_physp->port_info.vl_enforce && 0xc ) continue;

Yes, this is a good optimization but it should check the local physp since we're running on all switches.

                         if(! p_physp->port_info.vl_enforce && 0xc )
                                continue;

-- Eli

Quoted 15 lines
Quoted 10 lines
opensm/osm_pkey_mgr.c +4 -0
+                     if (pkey_mgr_enforce_partition(&p_osm->log, &p_osm->sm, p_physp, FALSE))
+                             ret = -1;
+             }
+     }

 _err:
      CL_PLOCK_RELEASE(&p_osm->lock);
      OSM_LOG_EXIT(&p_osm->log);
--
1.7.4.1

Quoted 4 lines

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at  http://vger.kernel.org/majordomo-info.html

Quoted 8 lines

--

-- Alex
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] 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 [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
In reply to a message not in the archive

Hi Eli,

Quoted 9 lines · Eli Dorfman

clean partition enforcement on inter-switch links

after connectivity change from switch-host to switch-switch the partition enforcement bits were not cleared on the port. since the pkey table is not set on inter-switch links, packets with pkey other than default are dropped.

---

Applied, thanks
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html