[ofa-general] [PATCH] infiniband/core: Enable loopback of DR SMP responses from userspace

Sean Hefty mshefty at ichips.intel.com
Thu Sep 13 09:14:32 PDT 2007


Roland Dreier wrote:
> Hal and Sean, what was the final feeling about this?  I seem to recall
> some changes were requested?  Are there two independent changes mixed
> up in one patch here?

I don't think there are necessarily two independent patches here, but 
there were two minor changes that I requested:

>  > @@ -754,6 +755,7 @@ static int handle_outgoing_dr_smp(struct ib_mad_agent_private *mad_agent_priv,
>  >  		if (port_priv) {
>  >  			mad_priv->mad.mad.mad_hdr.tid =
>  >  				((struct ib_mad *)smp)->mad_hdr.tid;
>  > +			memcpy(&mad_priv->mad.mad, smp, sizeof(struct ib_mad));

Remove setting the TID, since the memcpy will overwrite it anyway.

It would be nice to test that this change doesn't break ehca or qlogic 
adapters, but it doesn't look like the existing code in this area would 
work.  You could separate this change out as a bug fix, I guess.

>  > +/*
>  > + * Return 1 if the SMP response should be handled by the local management stack
>  > + */
>  > +static inline enum smi_action smi_check_local_resp_smp(struct ib_smp *smp,
>  > +						       struct ib_device *device)
>  > +{
>  > +	/* C14-13:3 -- We're at the end of the DR segment of path */
>  > +	/* C14-13:4 -- Hop Pointer == 0 -> give to SM */
>  > +	return ((device->process_mad &&
>  > +		ib_get_smp_direction(smp) &&
>  > +		!smp->hop_ptr) ? IB_SMI_HANDLE : IB_SMI_DISCARD);
>  > +}

Update the comment above the function to replace '1' with IB_SMI_HANDLE.

- Sean



More information about the general mailing list