> +     } else {
> +             memcpy(response, recv, sizeof(*response));
> +             response->header.recv_wc.wc = &response->header.wc;
> +             response->header.recv_wc.recv_buf.mad = &response->mad.mad;
> +             response->header.recv_wc.recv_buf.grh = &response->grh;
> +             response->mad.mad.mad_hdr.method = IB_MGMT_METHOD_GET_RESP;
> +             response->mad.mad.mad_hdr.status =
> +                             __be16_to_cpu(IB_MGMT_MAD_STATUS_BAD_VERSION);
> +             agent_send_response(&response->mad.mad, &recv->grh, wc,
> +                     port_priv->device, port_num, qp_info->qp->qp_num);
>       }

I think we need to do more here than just generate a GetResp for an unmatched 
receive.  The received MAD in question could itself be a GetResp or a Send, 
Trap, Report, etc.  Maybe add a check:

} else if generate_unmatched_resp(recv, ..) {
        agent_send_response(...)
}

and let generate_unmatched_resp() determine if an actual response should be 
generated and what the contents should be, if there are any differences in the 
response, such as different methods.  The initial submission could limit which 
MADs a response is generated for.

- Sean

Reply via email to