Thread (15 messages) flat view 15 messages, 3 authors, 2018-12-22

Re: [PATCH rdma-next 2/5] RDMA/core: Don't depend device ODP capabilities on kconfig option

From: Jason Gunthorpe <hidden>
Date: 2018-12-20 23:23:00
Also in: linux-rdma

On Thu, Dec 20, 2018 at 07:50:20PM +0200, Leon Romanovsky wrote:
quoted
quoted
quoted
quoted
-#ifdef CONFIG_INFINIBAND_ON_DEMAND_PAGING
 	if (MLX5_CAP_GEN(mdev, pg))
 		props->device_cap_flags |= IB_DEVICE_ON_DEMAND_PAGING;
 	props->odp_caps = dev->odp_caps;
-#endif
But shouldn't this be protected? If the driver has compiled out ODP it
shouldn't set the cap flag...
I see those capabilities as device properties and not as kernel ones.

Current situation looks bad for me, when I have same device which
reports differently information depends on some compilation flag.
It is not device capabilities, it is a kernel API capability if the
API is not available the bit should not be set.
Is it better? Should I resend the series?
Hrm.. I think I'm inclined to keep the the if() in the same place as
the ifdefs. We can revise it later.

I noticed other busted up stuff:
 - IB_DEVICE_ON_DEMAND_PAGING is apparently UAPI but not in a uapi
   header (grr)
 - ucontext shouldn't have a driver callback, that should be moved to
   ops (ie to mlx5_ib_dev_odp_ops)
 - IB_DEVICE_ON_DEMAND_PAGING should be set in core code based
   on ops.invalidate_range being present, drivers shouldn't set it..

Jason
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help