[openib-general] [PATCH] ib_mad: Implement ib_free_recv_mad routine
Hal Rosenstock
halr at voltaire.com
Wed Sep 15 14:03:48 PDT 2004
On Wed, 2004-09-15 at 13:57, Sean Hefty wrote:
> On Wed, 15 Sep 2004 12:38:24 -0400
> Hal Rosenstock <halr at voltaire.com> wrote:
>
> > ib_mad: Implement ib_free_recv_mad routine
> > ===================================================================
> > +void ib_free_recv_mad(struct ib_mad_recv_wc *mad_recv_wc)
> > +{
> > + kfree(mad_recv_wc); /* RMPP !!! */
> > +}
> > +EXPORT_SYMBOL(ib_free_recv_mad);
> > +
> > static inline u8 convert_mgmt_class(u8 mgmt_class)
> > {
> > /* Alias IB_MGMT_CLASS_SUBN_DIRECTED_ROUTE to 0 */
> > @@ -669,7 +679,6 @@
> > static void ib_mad_recv_done_handler(struct ib_mad_port_private
> > *port_priv,
> > struct ib_wc *wc)
> > {
> > - struct ib_mad_recv_wc recv_wc;
> > struct ib_mad_private *recv;
> > unsigned long flags;
> > u32 qp_num;
> > @@ -707,9 +716,9 @@
> > PCI_DMA_FROMDEVICE);
> >
> > /* Setup MAD receive work completion from "normal" work completion */
> > - recv_wc.wc = wc;
> > - recv_wc.mad_len = sizeof(struct ib_mad); /* Should this be based on
> > wc->byte_len ? Also, RMPP !!! */
> > - recv_wc.recv_buf = &recv->header.recv_buf;
> > + recv->header.recv_wc.wc = wc;
> > + recv->header.recv_wc.mad_len = sizeof(struct ib_mad); /* Should this
> > be based on wc->byte_len ? Also, RMPP !!! */
> > + recv->header.recv_wc.recv_buf = &recv->header.recv_buf;
> >
>
> Would it make more sense for ib_mad_recv_wc to have an embedded
> recv_buf, rather than a a pointer to a recv_buf?
> Seems like a minor optimization/simplification.
I think that optimization would only work short term. Once RMPP is
supported, it doesn't so I would leave the API as is.
-- Hal
More information about the general
mailing list