On 10/30/2014 7:50 PM, ira.we...@intel.com wrote:
> From: Ira Weiny <ira.we...@intel.com>
> 
> Change the default node description string to IB_DEFAULT_ND_FORMAT
> Use ib_build_node_desc to dynamically map this string when queried
> 
> Reviewed-by: John Fleck <john.fl...@intel.com>
> Reviewed-by: Michael Heinz <michael.william.he...@intel.com>
> Reviewed-by: Mike Marciniszyn <mike.marcinis...@intel.com>
> Signed-off-by: Ira Weiny <ira.we...@intel.com>
> 
> ---
>  drivers/infiniband/hw/mthca/mthca_mad.c      |  3 ++-
>  drivers/infiniband/hw/mthca/mthca_provider.c | 12 +++---------
>  2 files changed, 5 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/mthca/mthca_mad.c 
> b/drivers/infiniband/hw/mthca/mthca_mad.c
> index 8881fa3..2c15359 100644
> --- a/drivers/infiniband/hw/mthca/mthca_mad.c
> +++ b/drivers/infiniband/hw/mthca/mthca_mad.c
> @@ -153,7 +153,8 @@ static void node_desc_override(struct ib_device *dev,
>           mad->mad_hdr.method == IB_MGMT_METHOD_GET_RESP &&
>           mad->mad_hdr.attr_id == IB_SMP_ATTR_NODE_DESC) {
>               mutex_lock(&to_mdev(dev)->cap_mask_mutex);
> -             memcpy(((struct ib_smp *) mad)->data, dev->node_desc, 64);
> +             ib_build_node_desc(((struct ib_smp *)mad)->data, dev->node_desc,
> +                                64, dev);

Nit: Should this be IB_DEVICE_DESC_MAX rather than 64 ?

-- Hal

>               mutex_unlock(&to_mdev(dev)->cap_mask_mutex);
>       }
>  }
> diff --git a/drivers/infiniband/hw/mthca/mthca_provider.c 
> b/drivers/infiniband/hw/mthca/mthca_provider.c
> index 415f8e1..c8e3d23 100644
> --- a/drivers/infiniband/hw/mthca/mthca_provider.c
> +++ b/drivers/infiniband/hw/mthca/mthca_provider.c
> @@ -1217,16 +1217,10 @@ static int mthca_init_node_data(struct mthca_dev *dev)
>       if (!in_mad || !out_mad)
>               goto out;
>  
> -     init_query_mad(in_mad);
> -     in_mad->attr_id = IB_SMP_ATTR_NODE_DESC;
> -
> -     err = mthca_MAD_IFC(dev, 1, 1,
> -                         1, NULL, NULL, in_mad, out_mad);
> -     if (err)
> -             goto out;
> -
> -     memcpy(dev->ib_dev.node_desc, out_mad->data, 64);
> +     snprintf(dev->ib_dev.node_desc, sizeof(dev->ib_dev.node_desc)-1, "%s",
> +              IB_DEFAULT_ND_FORMAT);
>  
> +     init_query_mad(in_mad);
>       in_mad->attr_id = IB_SMP_ATTR_NODE_INFO;
>  
>       err = mthca_MAD_IFC(dev, 1, 1,

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to