Re: [PATCH v7 1/5] verbs/rxe: Use core services to keep track of RXE things

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 2018/12/18 0:28, Steve Wise wrote:
On 12/14/2018 11:16 PM, Zhu Yanjun wrote:
On 2018/12/15 上午12:05, Jason Gunthorpe wrote:
Replace
   - The nonsense rxe_dev.kref with rxe_dev.ib_dev.dev.kref
   - rxe_dev_list with core's device_list.
   - Buggy net_to_rxe with ib_device_get_by_netdev that does proper
     lifetime management
   - Buggy get_rxe_by_name with ib_device_get_by_name

Add
   - ib_unregister_driver so drivers like rxe don't have to keep track
     of things to do module unload
   - ib_unregister_device_and_put to work with potiners returned by
     that various ib_device_get_* functions

The refcount change to the pool might need more work, but fundamentally
the driver cannot have krefs open in the pool across unregistration
or it
contains module unlolad races.

Signed-off-by: Jason Gunthorpe <jgg@xxxxxxxxxxxx>
---
   drivers/infiniband/core/core_priv.h   |   1 -
   drivers/infiniband/core/device.c      | 213
++++++++++++++++++++++++++++++++--
   drivers/infiniband/sw/rxe/rxe.c       |  38 +-----
   drivers/infiniband/sw/rxe/rxe.h       |  14 ++-
   drivers/infiniband/sw/rxe/rxe_loc.h   |   2 +-
   drivers/infiniband/sw/rxe/rxe_net.c   |  83 +++----------
   drivers/infiniband/sw/rxe/rxe_pool.c  |   4 -
   drivers/infiniband/sw/rxe/rxe_sysfs.c |  39 +++----
   drivers/infiniband/sw/rxe/rxe_verbs.c |   7 --
   drivers/infiniband/sw/rxe/rxe_verbs.h |   3 -
   include/rdma/ib_verbs.h               |  10 ++
   11 files changed, 261 insertions(+), 153 deletions(-)

diff --git a/drivers/infiniband/core/core_priv.h
b/drivers/infiniband/core/core_priv.h
index cc7535c5e192..1b2575430032 100644
--- a/drivers/infiniband/core/core_priv.h
+++ b/drivers/infiniband/core/core_priv.h
@@ -267,7 +267,6 @@ static inline int ib_mad_enforce_security(struct
ib_mad_agent_private *map,
   #endif
     struct ib_device *ib_device_get_by_index(u32 ifindex);
-void ib_device_put(struct ib_device *device);
   /* RDMA device netlink */
   void nldev_init(void);
   void nldev_exit(void);
diff --git a/drivers/infiniband/core/device.c
b/drivers/infiniband/core/device.c
index 348a7fb1f945..a2523605e02a 100644
--- a/drivers/infiniband/core/device.c
+++ b/drivers/infiniband/core/device.c
@@ -85,6 +85,9 @@ struct ib_client_data {
   static DEFINE_MUTEX(device_mutex);
   static DECLARE_RWSEM(lists_rwsem);
   +/* Used to serialize ib_unregister_driver */
+static DECLARE_RWSEM(unregister_rwsem);
+
   static int ib_security_change(struct notifier_block *nb, unsigned
long event,
                     void *lsm_data);
   static void ib_policy_change_task(struct work_struct *work);
@@ -168,6 +171,7 @@ void ib_device_put(struct ib_device *device)
Where is this function ib_device_put? This function is used many times.

Zhu Yanjun

It is in drivers/infiniband/core/device.c.  It was core-private.  This
patch exports it.

Which repository are you using?

Zhu Yanjun

Steve.






[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux