diff mbox series

[for-next] RDMA/core: Add a debug print when a driver is marked as non-kverbs provider

Message ID 20200818083831.92212-1-galpress@amazon.com (mailing list archive)
State Changes Requested
Headers show
Series [for-next] RDMA/core: Add a debug print when a driver is marked as non-kverbs provider | expand

Commit Message

Gal Pressman Aug. 18, 2020, 8:38 a.m. UTC
Add a debug print which is emitted when a certain driver is marked as
non-kverbs provider. This allows for easier understanding of why kverbs
functionality isn't working in such cases.

In addition, print the name of the first mandatory verb that is missing.
This brings back use for the unused name field.

Signed-off-by: Gal Pressman <galpress@amazon.com>
---
 drivers/infiniband/core/device.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Jason Gunthorpe Aug. 31, 2020, 4:28 p.m. UTC | #1
On Tue, Aug 18, 2020 at 11:38:31AM +0300, Gal Pressman wrote:
> Add a debug print which is emitted when a certain driver is marked as
> non-kverbs provider. This allows for easier understanding of why kverbs
> functionality isn't working in such cases.
> 
> In addition, print the name of the first mandatory verb that is missing.
> This brings back use for the unused name field.
> 
> Signed-off-by: Gal Pressman <galpress@amazon.com>
> ---
>  drivers/infiniband/core/device.c | 4 ++++
>  1 file changed, 4 insertions(+)

Kinda wondering why here? The debug level doesn't print by default
does it?

Jason
Gal Pressman Sept. 1, 2020, 6:46 a.m. UTC | #2
On 31/08/2020 19:28, Jason Gunthorpe wrote:
> On Tue, Aug 18, 2020 at 11:38:31AM +0300, Gal Pressman wrote:
>> Add a debug print which is emitted when a certain driver is marked as
>> non-kverbs provider. This allows for easier understanding of why kverbs
>> functionality isn't working in such cases.
>>
>> In addition, print the name of the first mandatory verb that is missing.
>> This brings back use for the unused name field.
>>
>> Signed-off-by: Gal Pressman <galpress@amazon.com>
>> ---
>>  drivers/infiniband/core/device.c | 4 ++++
>>  1 file changed, 4 insertions(+)
> 
> Kinda wondering why here? The debug level doesn't print by default
> does it?

Nope, I assume that a user that wants to debug why things aren't working is
going to enable debug prints. What do you mean by where here? Do you have a more
appropriate place in mind?

I thought this could be helpful, I can remove the print and the name field if
you prefer.
diff mbox series

Patch

diff --git a/drivers/infiniband/core/device.c b/drivers/infiniband/core/device.c
index d293b826acbc..dc5896040df9 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -293,6 +293,10 @@  static void ib_device_check_mandatory(struct ib_device *device)
 	for (i = 0; i < ARRAY_SIZE(mandatory_table); ++i) {
 		if (!*(void **) ((void *) &device->ops +
 				 mandatory_table[i].offset)) {
+			ibdev_dbg(
+				device,
+				"Marking as non-kverbs provider due to missing mandatory verb %s",
+				mandatory_table[i].name);
 			device->kverbs_provider = false;
 			break;
 		}