public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Guoqing Jiang <guoqing.jiang@linux.dev>
To: Jinpu Wang <jinpu.wang@ionos.com>
Cc: haris.iqbal@ionos.com, jgg@ziepe.ca, leon@kernel.org,
	linux-rdma@vger.kernel.org
Subject: Re: [PATCH RFC 01/12] RDMA/rtrs-srv: Remove ib_dev_count from rtrs_srv_ib_ctx
Date: Mon, 14 Nov 2022 16:45:18 +0800	[thread overview]
Message-ID: <2b99778c-9819-adc4-59fe-c8023c932247@linux.dev> (raw)
In-Reply-To: <CAMGffEn4eUrSX-v3Dr-iOD_LOFvqneGDYCuvAgqpTYBZTDFRYA@mail.gmail.com>



On 11/14/22 4:24 PM, Jinpu Wang wrote:
> On Mon, Nov 14, 2022 at 9:00 AM Guoqing Jiang <guoqing.jiang@linux.dev> wrote:
>> Hi Jinpu,
>>
>> On 11/14/22 3:39 PM, Jinpu Wang wrote:
>>> Hi Guoqing,
>>>
>>> Thx for the patch, see comments below.
>>> On Sun, Nov 13, 2022 at 2:08 AM Guoqing Jiang <guoqing.jiang@linux.dev> wrote:
>>>> The ib_dev_count is supposed to track the number of added ib devices
>>>> which is only used in rtrs_srv_{add,remove}_one.
>>>>
>>>> However we only trigger rtrs_srv_add_one from rnbd_srv_init_module
>>>> -> rtrs_srv_open -> ib_register_client -> client->add which should
>>>> happen only once.
>>> client->add is call per ib_device, eg:
>>> jwang@ps404a-1.stg:~$ ls -l /sys/class/infiniband/mlx5_*
>>> lrwxrwxrwx 1 root root 0 Nov  8 13:49 /sys/class/infiniband/mlx5_0 ->
>>> ../../devices/pci0000:ae/0000:ae:00.0/0000:af:00.0/infiniband/mlx5_0
>>> lrwxrwxrwx 1 root root 0 Nov  8 13:49 /sys/class/infiniband/mlx5_1 ->
>>> ../../devices/pci0000:ae/0000:ae:00.0/0000:af:00.1/infiniband/mlx5_1
>>> rtrs will be call twice for  mlx5_0 and mlx5_1 devices
>> Ah, yes.
>>
>> But still we can only load/unload module once, I guess it was used to avoid
>> racy condition (concurrent loading/unloading module?), could you elaborate
>> why it is needed?
> The change was introduced due to  a bug report, you can follow the
> discussion here for the history and reason:
> https://lore.kernel.org/linux-rdma/20200617103732.10356-1-haris.iqbal@cloud.ionos.com/

Thanks for the link.

I probably missed something but I don't know how rnbd_server module can be
initialized before cma module since we have the dependency chain as 
follows.

INFINIBAND_RTRS_SERVER depends on INFINIBAND_ADDR_TRANS
BLK_DEV_RNBD_SERVER depends on INFINIBAND_RTRS_SERVER

But commit 558d52b2976b ("RDMA/rtrs-srv: Incorporate ib_register_client into
rtrs server init") did mention this.

"and if the rnbd_server module is initialized before RDMA cma module, a 
null ptr
dereference occurs during the RDMA bind operation."

Thanks,
Guoqing

  reply	other threads:[~2022-11-14  8:45 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-13  1:08 [PATCH RFC 00/12] Misc changes for rtrs Guoqing Jiang
2022-11-13  1:08 ` [PATCH RFC 01/12] RDMA/rtrs-srv: Remove ib_dev_count from rtrs_srv_ib_ctx Guoqing Jiang
2022-11-14  7:39   ` Jinpu Wang
2022-11-14  8:00     ` Guoqing Jiang
2022-11-14  8:24       ` Jinpu Wang
2022-11-14  8:45         ` Guoqing Jiang [this message]
2022-11-14 13:36           ` Haris Iqbal
2022-11-15 10:22             ` Guoqing Jiang
2022-11-13  1:08 ` [PATCH RFC 02/12] RDMA/rtrs-srv: Refactor rtrs_srv_rdma_cm_handler Guoqing Jiang
2022-11-14 14:39   ` Haris Iqbal
2022-11-15 10:24     ` Guoqing Jiang
2022-11-13  1:08 ` [PATCH RFC 03/12] RDMA/rtrs-srv: Only close srv_path if it is just allocated Guoqing Jiang
2022-11-14 16:18   ` Haris Iqbal
2022-11-15 10:24     ` Guoqing Jiang
2022-11-15 10:31       ` Jinpu Wang
2022-11-13  1:08 ` [PATCH RFC 04/12] RDMA/rtrs-srv: refactor the handling of failure case in map_cont_bufs Guoqing Jiang
2022-11-14 16:21   ` Haris Iqbal
2022-11-13  1:08 ` [PATCH RFC 05/12] RDMA/rtrs-srv: Correct the checking of ib_map_mr_sg Guoqing Jiang
2022-11-15 11:46   ` Jinpu Wang
2022-11-16  1:13     ` Guoqing Jiang
2022-11-16  5:44       ` Jinpu Wang
2022-11-13  1:08 ` [PATCH RFC 06/12] RDMA/rtrs-clt: " Guoqing Jiang
2022-11-15 11:49   ` Jinpu Wang
2022-11-13  1:08 ` [PATCH RFC 07/12] RDMA/rtrs-srv: Remove outdated comments from create_con Guoqing Jiang
2022-11-14 16:22   ` Haris Iqbal
2022-11-13  1:08 ` [PATCH RFC 08/12] RDMA/rtrs: Kill recon_cnt from several structs Guoqing Jiang
2022-11-15  9:39   ` Haris Iqbal
2022-11-15  9:53     ` Jinpu Wang
2022-11-15  9:58       ` Jinpu Wang
2022-11-15 10:33         ` Guoqing Jiang
2022-11-13  1:08 ` [PATCH RFC 09/12] RDMA/rtrs: Clean up rtrs_rdma_dev_pd_ops Guoqing Jiang
2022-11-15  9:18   ` Haris Iqbal
2022-11-13  1:08 ` [PATCH RFC 10/12] RDMA/rtrs-srv: Remove paths_num Guoqing Jiang
2022-11-15  9:48   ` Haris Iqbal
2022-11-15 10:01     ` Jinpu Wang
2022-11-15 10:30       ` Guoqing Jiang
2022-11-13  1:08 ` [PATCH RFC 11/12] RDMA/rtrs-srv: fix several issues in rtrs_srv_destroy_path_files Guoqing Jiang
2022-11-14 16:22   ` Haris Iqbal
2022-11-13  1:08 ` [PATCH RFC 12/12] RDMA/rtrs-srv: Remove kobject_del from rtrs_srv_destroy_once_sysfs_root_folders Guoqing Jiang
2022-11-14 16:23   ` Haris Iqbal
2022-11-14  8:32 ` [PATCH RFC 00/12] Misc changes for rtrs Leon Romanovsky
2022-11-14  8:46   ` Guoqing Jiang
2022-11-17  9:52 ` Leon Romanovsky
2022-11-17 10:06   ` Guoqing Jiang

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=2b99778c-9819-adc4-59fe-c8023c932247@linux.dev \
    --to=guoqing.jiang@linux.dev \
    --cc=haris.iqbal@ionos.com \
    --cc=jgg@ziepe.ca \
    --cc=jinpu.wang@ionos.com \
    --cc=leon@kernel.org \
    --cc=linux-rdma@vger.kernel.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