All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-2ukJVAZIZ/Y@public.gmane.org>
To: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
Cc: achiad-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: IB/mlx5: Extend query_device/port to support RoCE
Date: Sat, 9 Jan 2016 13:05:04 +0200	[thread overview]
Message-ID: <20160109110504.GB10797@leon.nu> (raw)
In-Reply-To: <20160108132324.GA7683@mwanda>

On Fri, Jan 08, 2016 at 04:23:24PM +0300, Dan Carpenter wrote:
> Hello Achiad Shochat,
> 
> The patch 3f89a643eb29: "IB/mlx5: Extend query_device/port to support
> RoCE" from Dec 23, 2015, leads to the following static checker
> warning:
> 
> 	drivers/infiniband/hw/mlx5/main.c:149 mlx5_query_port_roce()
> 	warn: passing casted pointer '&props->qkey_viol_cntr' to 'mlx5_query_nic_vport_qkey_viol_cntr()' 32 vs 16.

Thanks for spotting it to us.
I sent patch which should eliminate that warning and expected to work
correctly on big endian systems too [1].

[1] https://patchwork.kernel.org/patch/7992081/

> 
> drivers/infiniband/hw/mlx5/main.c
>    129  static int mlx5_query_port_roce(struct ib_device *device, u8 port_num,
>    130                                  struct ib_port_attr *props)
>    131  {
>    132          struct mlx5_ib_dev *dev = to_mdev(device);
>    133          struct net_device *ndev;
>    134          enum ib_mtu ndev_ib_mtu;
>    135  
>    136          memset(props, 0, sizeof(*props));
>    137  
>    138          props->port_cap_flags  |= IB_PORT_CM_SUP;
>    139          props->port_cap_flags  |= IB_PORT_IP_BASED_GIDS;
>    140  
>    141          props->gid_tbl_len      = MLX5_CAP_ROCE(dev->mdev,
>    142                                                  roce_address_table_size);
>    143          props->max_mtu          = IB_MTU_4096;
>    144          props->max_msg_sz       = 1 << MLX5_CAP_GEN(dev->mdev, log_max_msg);
>    145          props->pkey_tbl_len     = 1;
>    146          props->state            = IB_PORT_DOWN;
>    147          props->phys_state       = 3;
>    148  
>    149          mlx5_query_nic_vport_qkey_viol_cntr(dev->mdev,
>    150                                              (u16 *)&props->qkey_viol_cntr);
>                                                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> This will break on big endian systems.
> 
>    151  
>    152          ndev = mlx5_ib_get_netdev(device, port_num);
>    153          if (!ndev)
>    154                  return 0;
>    155  
> 
> regards,
> dan carpenter
> --
> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
> the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2016-01-09 11:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-08 13:23 IB/mlx5: Extend query_device/port to support RoCE Dan Carpenter
2016-01-09 11:05 ` Leon Romanovsky [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160109110504.GB10797@leon.nu \
    --to=leon-2ukjvaziz/y@public.gmane.org \
    --cc=achiad-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
    --cc=dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.