public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: achiad-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: re: IB/mlx5: Extend query_device/port to support RoCE
Date: Fri, 8 Jan 2016 16:23:24 +0300	[thread overview]
Message-ID: <20160108132324.GA7683@mwanda> (raw)

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.

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

             reply	other threads:[~2016-01-08 13:23 UTC|newest]

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

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=20160108132324.GA7683@mwanda \
    --to=dan.carpenter-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=achiad-VPRAkNaXOzVWk0Htik3J/w@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox