[openib-general] [PATCH] mad: In ib_mad_recv_done_handler, don't dispatch additional error cases

Hal Rosenstock halr at voltaire.com
Tue Nov 9 09:18:39 PST 2004


On Tue, 2004-11-09 at 12:11, Sean Hefty wrote:
> Hal Rosenstock wrote:
> 
> > mad: In ib_mad_recv_done_handler, don't dispatch additional error cases
> > +		if (ret & IB_MAD_RESULT_SUCCESS) {
> > +			if (ret & IB_MAD_RESULT_REPLY) {
> > +				if (response->mad_hdr.mgmt_class ==
> > +				    IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE) {
> > +					if (!smi_handle_dr_smp_recv(
> > +					    (struct ib_smp *)response,
> > +					    port_priv->device->node_type,
> > +					    port_priv->port_num,
> > +					    port_priv->device->phys_port_cnt)) {
> > +						kfree(response);
> > +						goto out;
> > +					}
> > +				}
> > +				/* Send response */
> > +				grh = (void *)recv->header.recv_buf.mad -
> > +				      sizeof(struct ib_grh);
> > +				if (agent_send(response, grh, wc,
> > +					       port_priv->device,
> > +					       port_priv->port_num)) {
> >  					kfree(response);
> >  				}
> >  				goto out;
> >  			}
> 
> 			goto out;
> 
> I guess I was wondering if it was okay to move "goto out" to here, and 
> always skip dispatching if process_mad returned success.  I think 
> dispatching in the failure case makes sense.

Yes (more than OK, it's better :-) I'll issue a patch for this shortly.

-- Hal




More information about the general mailing list