Re: [PATCH 2/2] IB/mad: Return unsupported for MADs as appropriate

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Wed, Jan 18, 2012 at 06:06:11PM +0000, Hefty, Sean wrote:
> > +	} 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:

No, refer to Figure 169. GetResp is the correct response.

The method cannot be parsed outside the context of the
(baseVersion,manamgentClass,classVersion) tuple. A agent that does not
understand the managementClass must return GetResp.

I feel if the base version is not supported then a GetResp should be
returned without a memcpy. The base version set to the highest
supported value and the TID copied over from the reply but everything
else 0'd. This allows base version discovery which might be important
some day.

Otherwise this looks right..

To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at

[Home]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]    [Yosemite Photos]    [Free Online Dating]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]

Add to Google Powered by Linux