[openib-general] [PATCH] agent: Fix agent_mad_send PCI mapping and gather address and length
Hal Rosenstock
halr at voltaire.com
Wed Nov 10 14:30:19 PST 2004
On Wed, 2004-11-10 at 16:29, Roland Dreier wrote:
> Roland> I guess the problem with calling smi_handle_dr_smp_recv()
> Roland> twice on the same packet is that the function may alter
> Roland> the packet.
>
> Hal> No, the second call to smi_handle_dr_smp_recv() was on the
> Hal> outgoing response and not the incoming request. The thought
> Hal> was that a packet coming from process_mad is much like an
> Hal> incoming received packet and hence the call to
> Hal> smi_handle_dr_smp_recv. The routine validates the packet but
> Hal> also can do some fixups depending on which case it falls
> Hal> into. Guess it's only dangerous to validate this and wrong to
> Hal> fix it up.
>
> Maybe I'm misreading the code, but my patch deleted the call to
> smi_handle_dr_smp_recv() before the call to agent_send.
You're not. I was...
> agent_send() eventually ends up in ib_post_send_mad(), which calls
> handle_outgoing_smp() for directed route MADs, which ends up calling
> smi_handle_dr_smp_recv() again. Since smi_handle_dr_smp_recv() can
> change the packet, calling it twice on the same packet seems to break things.
I'm with you now.
> However I don't think it's a good idea to think of responses generated
> by process_mad as an incoming received packet. I think they should be
> thought of as returning DR SMPs being passed to the SMI for sending
> (as in section 14.2.2 of the IB spec).
Yup, there is a difference between a returning SMP being sent and an
incoming SMP being received in terms of SMI. I was being imprecise
again.
> Hal> The key to me is the following: The split of responsibility
> Hal> on the DR header formation is a little unclear to me. In the
> Hal> case of the SM, are the DR headers fully formed before
> Hal> handing it to the MAD layer or is some DR fixup needed ?
>
> My suggestion would be to follow the IB spec, and assume that the SM
> follows the SMP initialization in 14.2.2.1 and have the MAD layer just
> implement the SMI processing in 14.2.2.2. (And I believe things
> should work similarly for responses generated by the SMA -- the MAD
> layer should just do SMI processing).
That was the intention.
I will figure out what is broke but not just yet... I may want something
tried by either you or Sean prior to my checking it in to be sure. I'll
let you know.
Thanks.
-- Hal
More information about the general
mailing list