[ofa-general] [PATCH] mlx4_ib/mthca: Fix dispatch of IB_EVENT_LID_CHANGE

Jack Morgenstein jackm at dev.mellanox.co.il
Thu Nov 27 04:57:32 PST 2008


On Tuesday 25 November 2008 18:06, Moni Shoua wrote:
> @@ -263,6 +269,9 @@ int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags,     u8 port_num,
>         } else
>                 return IB_MAD_RESULT_SUCCESS;
>  
> +       if (!ib_query_port(ibdev, port_num, &pattr))
> +               prev_lid = pattr.lid;
> +
> 

Why do ib_query_port for each MAD that is handled?  query_port involves a firmware access.
Events are generated only for SMP SET packets.

I think the condition should read:

	if ((in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_LID_ROUTED ||
	     in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) &&
	    in_mad->mad_hdr.method == IB_MGMT_METHOD_SET &&
	    !ib_query_port(ibdev, port_num, &pattr))
		prev_lid = pattr.lid;

so that the query_port will be performed only for appropriate packets.

- Jack



More information about the general mailing list