From: Leon Romanovsky <leonro@nvidia.com>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Jason Gunthorpe <jgg@nvidia.com>,
Kalesh AP <kalesh-anakkur.purayil@broadcom.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux Next Mailing List <linux-next@vger.kernel.org>,
Saravanan Vajravel <saravanan.vajravel@broadcom.com>
Subject: Re: linux-next: manual merge of the rdma tree with Linus' tree
Date: Thu, 11 Sep 2025 14:03:03 +0300 [thread overview]
Message-ID: <20250911110303.GS341237@unreal> (raw)
In-Reply-To: <20250911122330.14834c0a@canb.auug.org.au>
On Thu, Sep 11, 2025 at 12:23:30PM +1000, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the rdma tree got a conflict in:
>
> drivers/infiniband/hw/bnxt_re/main.c
>
> between commit:
>
> ba60a1e8cbbd ("RDMA/bnxt_re: Fix a possible memory leak in the driver")
>
> from Linus' tree and commits:
>
> bebe1a1bb1cf ("RDMA/bnxt_re: Refactor stats context memory allocation")
> b8f4e7f1a275 ("RDMA/bnxt_re: Add support for unique GID")
>
> from the rdma tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> --
> Cheers,
> Stephen Rothwell
>
> diff --cc drivers/infiniband/hw/bnxt_re/main.c
> index df7cf8d68e27,d8d3999d329e..000000000000
> --- a/drivers/infiniband/hw/bnxt_re/main.c
> +++ b/drivers/infiniband/hw/bnxt_re/main.c
> @@@ -2017,28 -2046,72 +2046,94 @@@ static void bnxt_re_free_nqr_mem(struc
> rdev->nqr = NULL;
> }
>
> +/* When DEL_GID fails, driver is not freeing GID ctx memory.
> + * To avoid the memory leak, free the memory during unload
> + */
> +static void bnxt_re_free_gid_ctx(struct bnxt_re_dev *rdev)
> +{
> + struct bnxt_qplib_sgid_tbl *sgid_tbl = &rdev->qplib_res.sgid_tbl;
> + struct bnxt_re_gid_ctx *ctx, **ctx_tbl;
> + int i;
> +
> + if (!sgid_tbl->active)
> + return;
> +
> + ctx_tbl = sgid_tbl->ctx;
> + for (i = 0; i < sgid_tbl->max; i++) {
> + if (sgid_tbl->hw_id[i] == 0xFFFF)
> + continue;
> +
> + ctx = ctx_tbl[i];
> + kfree(ctx);
> + }
> +}
> +
> + static int bnxt_re_get_stats_ctx(struct bnxt_re_dev *rdev)
> + {
> + struct bnxt_qplib_ctx *hctx = &rdev->qplib_ctx;
> + struct bnxt_qplib_res *res = &rdev->qplib_res;
> + int rc;
> +
> + rc = bnxt_qplib_alloc_stats_ctx(res->pdev, res->cctx, &hctx->stats);
> + if (rc)
> + return rc;
> +
> + rc = bnxt_re_net_stats_ctx_alloc(rdev, &hctx->stats);
> + if (rc)
> + goto free_stat_mem;
> +
> + return 0;
> + free_stat_mem:
> + bnxt_qplib_free_stats_ctx(res->pdev, &hctx->stats);
> +
> + return rc;
> + }
> +
> + static int bnxt_re_get_stats3_ctx(struct bnxt_re_dev *rdev)
> + {
> + struct bnxt_qplib_ctx *hctx = &rdev->qplib_ctx;
> + struct bnxt_qplib_res *res = &rdev->qplib_res;
> + int rc;
> +
> + if (!rdev->rcfw.roce_mirror)
> + return 0;
> +
> + rc = bnxt_qplib_alloc_stats_ctx(res->pdev, res->cctx, &hctx->stats3);
> + if (rc)
> + return rc;
> +
> + rc = bnxt_re_net_stats_ctx_alloc(rdev, &hctx->stats3);
> + if (rc)
> + goto free_stat_mem;
> +
> + return 0;
> + free_stat_mem:
> + bnxt_qplib_free_stats_ctx(res->pdev, &hctx->stats3);
> +
> + return rc;
> + }
> +
> + static void bnxt_re_put_stats3_ctx(struct bnxt_re_dev *rdev)
> + {
> + struct bnxt_qplib_ctx *hctx = &rdev->qplib_ctx;
> + struct bnxt_qplib_res *res = &rdev->qplib_res;
> +
> + if (!rdev->rcfw.roce_mirror)
> + return;
> +
> + bnxt_re_net_stats_ctx_free(rdev, hctx->stats3.fw_id);
> + bnxt_qplib_free_stats_ctx(res->pdev, &hctx->stats3);
> + }
> +
> + static void bnxt_re_put_stats_ctx(struct bnxt_re_dev *rdev)
> + {
> + struct bnxt_qplib_ctx *hctx = &rdev->qplib_ctx;
> + struct bnxt_qplib_res *res = &rdev->qplib_res;
> +
> + bnxt_re_net_stats_ctx_free(rdev, hctx->stats.fw_id);
> + bnxt_qplib_free_stats_ctx(res->pdev, &hctx->stats);
> + }
> +
> static void bnxt_re_dev_uninit(struct bnxt_re_dev *rdev, u8 op_type)
> {
> u8 type;
> @@@ -2049,10 -2122,8 +2144,9 @@@
> bnxt_re_net_unregister_async_event(rdev);
> bnxt_re_uninit_dcb_wq(rdev);
>
> - if (test_and_clear_bit(BNXT_RE_FLAG_QOS_WORK_REG, &rdev->flags))
> - cancel_delayed_work_sync(&rdev->worker);
> + bnxt_re_put_stats3_ctx(rdev);
>
> + bnxt_re_free_gid_ctx(rdev);
> if (test_and_clear_bit(BNXT_RE_FLAG_RESOURCES_INITIALIZED,
> &rdev->flags))
> bnxt_re_cleanup_res(rdev);
Looks right, thanks.
next prev parent reply other threads:[~2025-09-11 11:04 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 2:23 linux-next: manual merge of the rdma tree with Linus' tree Stephen Rothwell
2025-09-11 11:03 ` Leon Romanovsky [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-05-14 2:24 Stephen Rothwell
2025-05-14 8:17 ` Leon Romanovsky
2025-04-22 4:30 Stephen Rothwell
2025-03-20 1:08 Stephen Rothwell
2025-03-20 6:35 ` Leon Romanovsky
2025-01-06 0:13 Stephen Rothwell
2025-01-14 20:48 ` Jason Gunthorpe
2025-01-14 21:27 ` Stephen Rothwell
2025-01-15 0:41 ` Jason Gunthorpe
2025-01-15 1:07 ` Stephen Rothwell
2025-01-15 11:17 ` Bernard Metzler
2025-01-05 23:51 Stephen Rothwell
2025-01-06 1:02 ` Stephen Rothwell
2025-01-06 14:16 ` Zhu Yanjun
2023-06-22 1:52 Stephen Rothwell
2021-05-21 0:34 Stephen Rothwell
2021-04-15 2:05 Stephen Rothwell
2021-02-10 2:15 Stephen Rothwell
2021-02-10 18:57 ` Pearson, Robert B
2021-02-10 20:36 ` Jason Gunthorpe
2021-02-10 22:08 ` Pearson, Robert B
2021-02-11 20:03 ` Martin Wilck
2019-11-05 1:17 Stephen Rothwell
2019-11-05 2:21 ` Jason Gunthorpe
2019-11-05 2:28 ` Stephen Rothwell
2019-10-24 0:01 Stephen Rothwell
2019-10-28 19:30 ` Jason Gunthorpe
2019-06-20 2:10 Stephen Rothwell
2019-06-20 3:25 ` Doug Ledford
2019-06-20 2:06 Stephen Rothwell
2019-06-20 3:24 ` Doug Ledford
2019-06-14 3:00 Stephen Rothwell
2019-06-14 13:11 ` Doug Ledford
2018-09-28 0:01 Stephen Rothwell
2018-09-29 2:57 ` Parav Pandit
2018-08-06 2:01 Stephen Rothwell
2018-08-06 19:41 ` Jason Gunthorpe
2018-08-06 21:49 ` Stephen Rothwell
2017-08-08 2:11 Stephen Rothwell
2017-07-14 1:14 Stephen Rothwell
2017-07-14 1:17 ` Doug Ledford
2017-07-14 3:34 ` Leon Romanovsky
2017-07-14 3:50 ` Stephen Rothwell
2017-07-14 4:55 ` Leon Romanovsky
2017-07-14 12:03 ` Doug Ledford
2017-07-14 13:46 ` Leon Romanovsky
2017-07-14 4:12 ` Doug Ledford
2017-07-14 4:54 ` Leon Romanovsky
2017-07-14 14:33 ` Doug Ledford
2017-07-14 15:10 ` Leon Romanovsky
2016-12-15 0:47 Stephen Rothwell
2016-10-10 0:59 Stephen Rothwell
2016-10-10 0:54 Stephen Rothwell
2016-08-05 1:05 Stephen Rothwell
2016-08-05 1:01 Stephen Rothwell
2016-08-05 0:52 Stephen Rothwell
2016-05-19 1:45 Stephen Rothwell
2016-03-22 0:33 Stephen Rothwell
2016-03-22 0:29 Stephen Rothwell
2016-03-22 0:24 Stephen Rothwell
2016-03-22 0:17 Stephen Rothwell
2015-11-01 7:48 Stephen Rothwell
2015-11-02 10:40 ` Sagi Grimberg
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=20250911110303.GS341237@unreal \
--to=leonro@nvidia.com \
--cc=jgg@nvidia.com \
--cc=kalesh-anakkur.purayil@broadcom.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=saravanan.vajravel@broadcom.com \
--cc=sfr@canb.auug.org.au \
/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).