Re: [PATCH rdma-next 5/8] IB/{core,ulp} Support above 32 possible device capability flags

Leon Romanovsky
2016-02-21T08:00:53Z

On Sun, Feb 21, 2016 at 09:39:33AM +0200, Haggai Eran wrote:
> On 20/02/2016 09:47, Leon Romanovsky wrote:
> > --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
> > +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
> > @@ -1762,7 +1762,7 @@ int ipoib_add_pkey_attr(struct net_device *dev)
> >
> > int ipoib_set_dev_features(struct ipoib_dev_priv *priv, struct ib_device *hca)
> > {
> > - priv->hca_caps = hca->attrs.device_cap_flags;
> > + priv->hca_caps = (int)hca->attrs.device_cap_flags;
>
> Won't it be better to increase the size of priv->hca_caps? Someone in the
> future will probably attempt to check one of the new device caps through
> this field and will be surprised to see it is only partial.

My changes were intended to minimize the impact on the existing code base. The future
developer will be expected to check his code when he adds new device
capability above 32 bit limit. In this change, he will update the ipoib
properly expose it.

Current implementation doesn't change ipoib behavior and easy for
review without extra knowledge of ipoib internals, so let's stay this
change as is.

Thanks.