On Fri, Apr 03, 2015 at 05:40:22PM -0600, Hefty, Sean wrote: > > @@ -937,20 +937,31 @@ struct ib_mad_send_buf * ib_create_send_mad(struct > > ib_mad_agent *mad_agent, > > struct ib_mad_send_wr_private *mad_send_wr; > > int pad, message_size, ret, size; > > void *buf; > > + size_t mad_size; > > + int opa; > > > > mad_agent_priv = container_of(mad_agent, struct > > ib_mad_agent_private, > > agent); > > - pad = get_pad_size(hdr_len, data_len); > > + > > + opa = mad_agent_priv->agent.device- > > >cached_dev_attrs.device_cap_flags2 & > > + IB_DEVICE_OPA_MAD_SUPPORT; > > + > > + if (opa && base_version == OPA_MGMT_BASE_VERSION) > > + mad_size = sizeof(struct jumbo_mad); > > + else > > + mad_size = sizeof(struct ib_mad); > > Didn't an earlier patch make is possible to read the mad_size directly from > the device? >
Not exactly, that patch specified the "max_mad_size" the device supported. OPA devices support IB MADs. If the IB Base Version is specified on an OPA device the IB MAD size is to be used. This maintains compatibility with any software issuing IB MADs. Ira -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
