Skip to contentSkip to conversation

RDMA/vmw_pvrdma: Remove unused pvrdma_modify_device

PATCH Applied [email protected] 3 participants 3 messages Mar 4, 2025 – Mar 6, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 RDMA/vmw_pvrdma: Remove unused pvrdma_modify_device

From: "Dr. David Alan Gilbert" <[email protected]>

pvrdma_modify_device() was added in 2016 as part of commit 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
but accidentally it was never wired into the device_ops struct.

After some discussion the best course seems to be just to remove it, see discussion at:
https://lore.kernel.org/all/Z8TWF6coBUF3l_jk@gallifrey/

---
 .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.c   | 28 -------------------
 .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.h   |  2 --
 2 files changed, 30 deletions(-)
drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c +0 -28
index 9f54aa90a35a..bcd43dc30e21 100644
@@ -237,34 +237,6 @@ enum rdma_link_layer pvrdma_port_link_layer(struct ib_device *ibdev,
 	return IB_LINK_LAYER_ETHERNET;
 }
 
-int pvrdma_modify_device(struct ib_device *ibdev, int mask,
-			 struct ib_device_modify *props)
-{
-	unsigned long flags;
-
-	if (mask & ~(IB_DEVICE_MODIFY_SYS_IMAGE_GUID |
-		     IB_DEVICE_MODIFY_NODE_DESC)) {
-		dev_warn(&to_vdev(ibdev)->pdev->dev,
-			 "unsupported device modify mask %#x\n", mask);
-		return -EOPNOTSUPP;
-	}
-
-	if (mask & IB_DEVICE_MODIFY_NODE_DESC) {
-		spin_lock_irqsave(&to_vdev(ibdev)->desc_lock, flags);
-		memcpy(ibdev->node_desc, props->node_desc, 64);
-		spin_unlock_irqrestore(&to_vdev(ibdev)->desc_lock, flags);
-	}
-
-	if (mask & IB_DEVICE_MODIFY_SYS_IMAGE_GUID) {
-		mutex_lock(&to_vdev(ibdev)->port_mutex);
-		to_vdev(ibdev)->sys_image_guid =
-			cpu_to_be64(props->sys_image_guid);
-		mutex_unlock(&to_vdev(ibdev)->port_mutex);
-	}
-
-	return 0;
-}
-
 /**
  * pvrdma_modify_port - modify device port attributes
  * @ibdev: the device to modify
drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h +0 -2
index 4b9edc03d73d..fd47b0b1df5c 100644
@@ -356,8 +356,6 @@ int pvrdma_query_pkey(struct ib_device *ibdev, u32 port,
 		      u16 index, u16 *pkey);
 enum rdma_link_layer pvrdma_port_link_layer(struct ib_device *ibdev,
 					    u32 port);
-int pvrdma_modify_device(struct ib_device *ibdev, int mask,
-			 struct ib_device_modify *props);
 int pvrdma_modify_port(struct ib_device *ibdev, u32 port,
 		       int mask, struct ib_port_modify *props);
 int pvrdma_mmap(struct ib_ucontext *context, struct vm_area_struct *vma);
Signature · 1 line
2.48.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · On Tue, Mar 4, 2025 at 1:56 PM <[email protected]> wrote:

From: "Dr. David Alan Gilbert" <[email protected]>

pvrdma_modify_device() was added in 2016 as part of commit 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
but accidentally it was never wired into the device_ops struct.

Quoted 5 lines

After some discussion the best course seems to be just to remove it, see discussion at:
https://lore.kernel.org/all/Z8TWF6coBUF3l_jk@gallifrey/

Quoted 60 lines
---
 .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.c   | 28 -------------------
 .../infiniband/hw/vmw_pvrdma/pvrdma_verbs.h   |  2 --
 2 files changed, 30 deletions(-)
drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.c +0 -28
index 9f54aa90a35a..bcd43dc30e21 100644
@@ -237,34 +237,6 @@ enum rdma_link_layer pvrdma_port_link_layer(struct ib_device *ibdev,
        return IB_LINK_LAYER_ETHERNET;
 }
 
-int pvrdma_modify_device(struct ib_device *ibdev, int mask,
-                        struct ib_device_modify *props)
-{
-       unsigned long flags;
-
-       if (mask & ~(IB_DEVICE_MODIFY_SYS_IMAGE_GUID |
-                    IB_DEVICE_MODIFY_NODE_DESC)) {
-               dev_warn(&to_vdev(ibdev)->pdev->dev,
-                        "unsupported device modify mask %#x\n", mask);
-               return -EOPNOTSUPP;
-       }
-
-       if (mask & IB_DEVICE_MODIFY_NODE_DESC) {
-               spin_lock_irqsave(&to_vdev(ibdev)->desc_lock, flags);
-               memcpy(ibdev->node_desc, props->node_desc, 64);
-               spin_unlock_irqrestore(&to_vdev(ibdev)->desc_lock, flags);
-       }
-
-       if (mask & IB_DEVICE_MODIFY_SYS_IMAGE_GUID) {
-               mutex_lock(&to_vdev(ibdev)->port_mutex);
-               to_vdev(ibdev)->sys_image_guid =
-                       cpu_to_be64(props->sys_image_guid);
-               mutex_unlock(&to_vdev(ibdev)->port_mutex);
-       }
-
-       return 0;
-}
-
 /**
  * pvrdma_modify_port - modify device port attributes
  * @ibdev: the device to modify
drivers/infiniband/hw/vmw_pvrdma/pvrdma_verbs.h +0 -3
index 4b9edc03d73d..fd47b0b1df5c 100644
@@ -356,8 +356,6 @@ int pvrdma_query_pkey(struct ib_device *ibdev, u32 port,
                      u16 index, u16 *pkey);
 enum rdma_link_layer pvrdma_port_link_layer(struct ib_device *ibdev,
                                            u32 port);
-int pvrdma_modify_device(struct ib_device *ibdev, int mask,
-                        struct ib_device_modify *props);
 int pvrdma_modify_port(struct ib_device *ibdev, u32 port,
                       int mask, struct ib_port_modify *props);
 int pvrdma_mmap(struct ib_ucontext *context, struct vm_area_struct *vma);
--

2.48.1

#2 lore raw
In reply to [email protected]
Quoted 9 lines · On Tue, 04 Mar 2025 21:56:36 +0000, [email protected] wrote:

pvrdma_modify_device() was added in 2016 as part of commit 29c8d9eba550 ("IB: Add vmw_pvrdma driver")
but accidentally it was never wired into the device_ops struct.

After some discussion the best course seems to be just to remove it, see discussion at:
https://lore.kernel.org/all/Z8TWF6coBUF3l_jk@gallifrey/

[...]

Applied, thanks!

[1/1] RDMA/vmw_pvrdma: Remove unused pvrdma_modify_device

      https://git.kernel.org/rdma/rdma/c/0b27b0e4d43aff

Best regards,

Signature · 1 line
Leon Romanovsky <[email protected]>