[ofa-general] [PATCH] opensm/osm_pkey_mgr.c: setting only outbound partition enforcement on switch

Hal Rosenstock hrosenstock at xsigo.com
Thu Dec 27 07:00:08 PST 2007


On Tue, 2007-12-25 at 14:29 +0200, Yevgeny Kliteynik wrote:
> Fixing wrong setting of partition enforcement bits on switch ports.
> When an HCA port is configured with a certain pkey, the peer port
> on the switch should turn on outbound partition enforcement bit only.
> Turning on the inbound enforcement will cause the switch to drop
> valid packets if the HCA is partial member.

Inbound enforcement is actually the more useful case. If there is
inbound enforcement, outbound enforcement doesn't add much.

In the case of partial only (not both partial and full) membership, the
peer switch physical port would need to be set to full membership.

-- Hal

> 
> Signed-off-by: Yevgeny Kliteynik <kliteyn at dev.mellanox.co.il>
> ---
>  opensm/opensm/osm_pkey_mgr.c |   12 ++++++++----
>  1 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/opensm/opensm/osm_pkey_mgr.c b/opensm/opensm/osm_pkey_mgr.c
> index 58eed04..209fa71 100644
> --- a/opensm/opensm/osm_pkey_mgr.c
> +++ b/opensm/opensm/osm_pkey_mgr.c
> @@ -212,7 +212,8 @@ pkey_mgr_enforce_partition(IN osm_log_t * p_log,
> 
>  	p_pi = &p_physp->port_info;
> 
> -	if ((p_pi->vl_enforce & 0xc) == (0xc) * (enforce == TRUE)) {
> +	if (((p_pi->vl_enforce & 0xc) == 0x4 && enforce) ||
> +	    ((p_pi->vl_enforce & 0xc) == 0 && !enforce)) {
>  		osm_log(p_log, OSM_LOG_DEBUG,
>  			"pkey_mgr_enforce_partition: "
>  			"No need to update PortInfo for "
> @@ -227,10 +228,13 @@ pkey_mgr_enforce_partition(IN osm_log_t * p_log,
>  	memcpy(payload, p_pi, sizeof(ib_port_info_t));
> 
>  	p_pi = (ib_port_info_t *) payload;
> +
> +	/* clearing enforcement in both directions */
> +	p_pi->vl_enforce &= ~0xc;
>  	if (enforce == TRUE)
> -		p_pi->vl_enforce |= 0xc;
> -	else
> -		p_pi->vl_enforce &= ~0xc;
> +		/* enforcing only in outbound direction */
> +		p_pi->vl_enforce |= 0x4;
> +
>  	p_pi->state_info2 = 0;
>  	ib_port_info_set_port_state(p_pi, IB_LINK_NO_CHANGE);
> 



More information about the general mailing list