From: Dan Carpenter <dan.carpenter@oracle.com>
To: danielj@mellanox.com
Cc: linux-rdma@vger.kernel.org
Subject: [bug report] {net, IB}/mlx5: Manage port association for multiport RoCE
Date: Wed, 19 May 2021 17:18:33 +0300 [thread overview]
Message-ID: <YKUeOV14j98OJIj7@mwanda> (raw)
In-Reply-To: <20210518082855.GB32682@kadam>
Hello Daniel Jurgens,
The patch 32f69e4be269: "{net, IB}/mlx5: Manage port association for
multiport RoCE" from Jan 4, 2018, leads to the following static
checker warning:
drivers/infiniband/hw/mlx5/main.c:3285 mlx5_ib_init_multiport_master()
warn: iterator 'mpi->list.next' changed during iteration
drivers/infiniband/hw/mlx5/main.c
3285 list_for_each_entry(mpi, &mlx5_ib_unaffiliated_port_list,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
We're iterating through the unafiliated list.
3286 list) {
3287 if (dev->sys_image_guid == mpi->sys_image_guid &&
3288 (mlx5_core_native_port_num(mpi->mdev) - 1) == i) {
3289 bound = mlx5_ib_bind_slave_port(dev, mpi);
The mlx5_ib_bind_slave_port() function returns true on success and
false on failure. On the failure path it calls:
mlx5_ib_unbind_slave_port(ibdev, mpi);
Which adds our "mpi" as the last item on the unaffiliated list. I don't
think anything good can come from adding a list item to a list twice.
3290 }
3291
3292 if (bound) {
3293 dev_dbg(mpi->mdev->device,
3294 "removing port from unaffiliated list.\n");
3295 mlx5_ib_dbg(dev, "port %d bound\n", i + 1);
3296 list_del(&mpi->list);
3297 break;
3298 }
3299 }
3300 if (!bound)
3301 mlx5_ib_dbg(dev, "no free port found for port %d\n",
3302 i + 1);
regards,
dan carpenter
next parent reply other threads:[~2021-05-19 14:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210518082855.GB32682@kadam>
2021-05-19 14:18 ` Dan Carpenter [this message]
2021-05-20 8:09 ` [bug report] {net, IB}/mlx5: Manage port association for multiport RoCE Leon Romanovsky
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=YKUeOV14j98OJIj7@mwanda \
--to=dan.carpenter@oracle.com \
--cc=danielj@mellanox.com \
--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