From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Yishai Hadas <yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
Cc: Yishai Hadas <yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>,
dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org,
majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org
Subject: Re: [PATCH V1 rdma-core 0/5] Device hot plug support
Date: Mon, 10 Jul 2017 19:23:12 +0300 [thread overview]
Message-ID: <20170710162312.GP1528@mtr-leonro.local> (raw)
In-Reply-To: <985e4646-0afa-f0f1-2c0e-e5757e839765-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
[-- Attachment #1: Type: text/plain, Size: 4388 bytes --]
On Mon, Jul 10, 2017 at 07:05:12PM +0300, Yishai Hadas wrote:
> On 7/10/2017 6:58 PM, Leon Romanovsky wrote:
> > On Mon, Jul 10, 2017 at 06:05:32PM +0300, Yishai Hadas wrote:
> > > This patch set from Maor adds support for device hot plug.
> > > Sending V1 to handle some cleanup note came on github from Jason, details
> > > below.
> > >
> > > Hot plug is the method in which a new hardware becomes available in the system
> > > or is being removed from it.
> > >
> > > The IB device list is returned by ibv_get_device_list() from libibverbs.
> > > Today, this list is created once by scanning /sys/class/infiniband_verbs, the
> > > list is cached and never updated, no matter if there were hardware changes in
> > > the system.
> > >
> > > libibverbs must be able to provide the application access to new ibv_device
> > > objects, according to the recent system hardware changes.
> > >
> > > For this purpose, the device scanning logic, should be separated from the
> > > libibverbs singleton initialization step, an updated list should be returned
> > > upon any call to ibv_get_device_list().
> > >
> > > User can call ibv_open_device() while holding this list (see man pages) and once
> > > ibv_free_device_list() is called libibverbs can release the unused ibv_device
> > > objects. Later, upon a call to ibv_close_device() the ibv_device object should
> > > be released.
> > >
> > > Currently, on ibv_free_device_list(), only the array is freed, while the
> > > ibv_device objects are never freed.
> > >
> > > This series comes to handle the above notes based on the discussion that followed
> > > an RFC on that.
> > >
> > > The solution:
> > > - The initialization part was separated from ibv_get_device_list().
> > > - Upon a call to ibv_get_device_list() the sysfs is scanned to look for
> > > new/removed entries.
> > > - Same device is recognized based on name and timestamp creation.
> > > - libibverbs will maintain a ref count for each verbs_device object, once
> > > it became zero, it calls the provider library to release the 'strcut
> > > verbs_device' which it allocated before. For this purpose each provider library
> > > provide a function to release the verbs_device.
> > >
> > > Further details exist in the commit logs of the series.
> > >
> > > Pull request was sent:
> > > https://github.com/linux-rdma/rdma-core/pull/157
> > >
> > > Changes from V0:
> > > #Patch #3: Use the introduced mutex also for the initialization step, dropping
> > > the pthread_once usage.
> > >
> > > Yishai
> > > Maor Gottlieb (5):
> > > utils: Add timespec compare utility
> > > verbs: Split ibverbs_init functionality
> > > verbs: Refresh cahced ibv_device list
> > > verbs: Avoid ibv_device memory leak
> > > providers: Add support for uninit_device for all providers
> > >
> > > debian/libibverbs1.symbols | 2 +-
> > > libibverbs/device.c | 50 +++++++----
> > > libibverbs/driver.h | 6 ++
> > > libibverbs/ibverbs.h | 5 +-
> > > libibverbs/init.c | 166 ++++++++++++++++++++++++-------------
> > > libibverbs/libibverbs.map | 2 +-
> > > providers/cxgb3/iwch.c | 10 ++-
> > > providers/cxgb4/dev.c | 10 ++-
> > > providers/hfi1verbs/hfiverbs.c | 10 ++-
> > > providers/hns/hns_roce_u.c | 10 ++-
> > > providers/i40iw/i40iw_umain.c | 10 ++-
> > > providers/ipathverbs/ipathverbs.c | 10 ++-
> > > providers/mlx4/mlx4.c | 8 ++
> > > providers/mlx5/mlx5.c | 8 ++
> > > providers/mthca/mthca.c | 10 ++-
> > > providers/nes/nes_umain.c | 9 +-
> > > providers/ocrdma/ocrdma_main.c | 10 ++-
> > > providers/qedr/qelr_main.c | 10 ++-
> > > providers/rxe/rxe.c | 8 ++
> > > providers/vmw_pvrdma/pvrdma_main.c | 10 ++-
> > > srp_daemon/srp_daemon.h | 7 +-
> > > util/util.h | 6 ++
> > > 22 files changed, 284 insertions(+), 93 deletions(-)
> >
> > Shouldn't man pages be updated too?
> >
>
> The man pages are up-to-date with current solution and now the code really
> behaves as described to return the currently available devices.
>
> From man page:
> "ibv_get_device_list() returns a NULL-terminated array of RDMA devices
> *currently* available"
>
Excellent, thanks
>
>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
prev parent reply other threads:[~2017-07-10 16:23 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 15:05 [PATCH V1 rdma-core 0/5] Device hot plug support Yishai Hadas
[not found] ` <1499699137-29037-1-git-send-email-yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-07-10 15:05 ` [PATCH V1 rdma-core 1/5] utils: Add timespec compare utility Yishai Hadas
2017-07-10 15:05 ` [PATCH V1 rdma-core 2/5] verbs: Split ibverbs_init functionality Yishai Hadas
2017-07-10 15:05 ` [PATCH V1 rdma-core 3/5] verbs: Refresh cahced ibv_device list Yishai Hadas
2017-07-10 15:05 ` [PATCH V1 rdma-core 4/5] verbs: Avoid ibv_device memory leak Yishai Hadas
2017-07-10 15:05 ` [PATCH V1 rdma-core 5/5] providers: Add support for uninit_device for all providers Yishai Hadas
2017-07-10 15:58 ` [PATCH V1 rdma-core 0/5] Device hot plug support Leon Romanovsky
[not found] ` <20170710155832.GM1528-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-07-10 16:05 ` Yishai Hadas
[not found] ` <985e4646-0afa-f0f1-2c0e-e5757e839765-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org>
2017-07-10 16:23 ` Leon Romanovsky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170710162312.GP1528@mtr-leonro.local \
--to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
--cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
--cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=majd-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=maorg-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
--cc=yishaih-LDSdmyG8hGV8YrgS2mwiifqBs+8SCbDb@public.gmane.org \
--cc=yishaih-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox