linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qing Huang <qing.huang@oracle.com>
To: Daniel Jurgens <danielj@mellanox.com>,
	Or Gerlitz <gerlitz.or@gmail.com>,
	Parav Pandit <parav@mellanox.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>,
	RDMA mailing list <linux-rdma@vger.kernel.org>,
	Jason Gunthorpe <jgg@ziepe.ca>,
	Doug Ledford <dledford@redhat.com>,
	Leon Romanovsky <leon@kernel.org>,
	gerald.gibson@oracle.com, Sharon Liu <sharon.s.liu@oracle.com>
Subject: Re: [PATCH] IB/mlx5: avoid binding a new mpi unit to the same devices repeatedly
Date: Mon, 23 Jul 2018 11:21:35 -0700	[thread overview]
Message-ID: <175e7c33-c12b-7c37-c5b9-127804e599b5@oracle.com> (raw)
In-Reply-To: <f2a5d82c-f65c-152d-5545-0d50a4e5e150@mellanox.com>

Hi Daniel,


On 7/23/2018 11:11 AM, Daniel Jurgens wrote:
>
> On 7/23/2018 10:36 AM, Qing Huang wrote:
>> Hi Daniel/Parav,
>>
>> Have you got a chance to review this patch? Thanks!
> Hi Qing, sorry for the delay, I just got back to the office today. I don't agree with the proposed fix, I provided an alternative suggestion below.
>>>> Or.
>>>>
>>>>> Reported-by: Gerald Gibson <gerald.gibson@oracle.com>
>>>>> Signed-off-by: Qing Huang <qing.huang@oracle.com>
>>>>> ---
>>>>>    drivers/infiniband/hw/mlx5/main.c | 3 ++-
>>>>>    1 file changed, 2 insertions(+), 1 deletion(-)
>>>>>
>>>>> diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c
>>>>> index b3ba9a2..1ddd1d3 100644
>>>>> --- a/drivers/infiniband/hw/mlx5/main.c
>>>>> +++ b/drivers/infiniband/hw/mlx5/main.c
>>>>> @@ -6068,7 +6068,8 @@ static void *mlx5_ib_add_slave_port(struct mlx5_core_dev *mdev, u8 port_num)
>>>>>
>>>>>           mutex_lock(&mlx5_ib_multiport_mutex);
>>>>>           list_for_each_entry(dev, &mlx5_ib_dev_list, ib_dev_list) {
>>>>> -               if (dev->sys_image_guid == mpi->sys_image_guid)
>>>>> +               if (dev->sys_image_guid == mpi->sys_image_guid &&
>>>>> +                   !dev->port[mlx5_core_native_port_num(mdev) - 1].mp.mpi)
> You shouldn't check the mpi field that without holding the lock in the mp structure. Prefer you change the print from a warning in mlx5_ib_bind_slave_port to a debug message.
Thanks for the review. That works for us too. Will resend the patch.

Regards,
Qing

>
>>>>>                           bound = mlx5_ib_bind_slave_port(dev, mpi);
>>>>>
>>>>>                   if (bound) {
>>>>> -- 
>>>>> 2.9.3
>>>>>
>>>>> -- 
>>>>> To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
>>>>> the body of a message to majordomo@vger.kernel.org
>>>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


      reply	other threads:[~2018-07-23 18:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13 23:50 [PATCH] IB/mlx5: avoid binding a new mpi unit to the same devices repeatedly Qing Huang
2018-07-14 15:57 ` Or Gerlitz
2018-07-15  6:04   ` Leon Romanovsky
2018-07-15 19:48   ` Daniel Jurgens
2018-07-23 15:36     ` Qing Huang
2018-07-23 16:21       ` Parav Pandit
2018-07-23 18:11       ` Daniel Jurgens
2018-07-23 18:21         ` Qing Huang [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=175e7c33-c12b-7c37-c5b9-127804e599b5@oracle.com \
    --to=qing.huang@oracle.com \
    --cc=danielj@mellanox.com \
    --cc=dledford@redhat.com \
    --cc=gerald.gibson@oracle.com \
    --cc=gerlitz.or@gmail.com \
    --cc=jgg@ziepe.ca \
    --cc=leon@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=parav@mellanox.com \
    --cc=sharon.s.liu@oracle.com \
    /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;
as well as URLs for NNTP newsgroup(s).