From: Dave Jiang <dave.jiang@intel.com>
To: Koichiro Den <den@valinux.co.jp>, Jon Mason <jdmason@kudzu.us>,
Allen Hubbe <allenbh@gmail.com>
Cc: Frank Li <Frank.Li@kernel.org>,
Logan Gunthorpe <logang@deltatee.com>,
fuyuanli <fuyuanli0722@gmail.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Nicholas Bellinger <nab@linux-iscsi.org>,
Joey Zhang <joey.zhang@microchip.com>,
ntb@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 09/14] NTB: ntb_transport: Drain RX tasklets during link cleanup
Date: Thu, 24 Sep 2026 08:53:35 -0700 [thread overview]
Message-ID: <81b16606-4000-4e21-ba32-ab00a471d44f@intel.com> (raw)
In-Reply-To: <6a0db9eb-c1b4-4545-8b12-2dd8326d664b@intel.com>
On 9/24/26 8:51 AM, Dave Jiang wrote:
>
>
> On 9/9/26 9:08 PM, Koichiro Den wrote:
>> ntb_qp_link_cleanup() cancels QP link work but does not wait for the RX
>> tasklet. The tasklet can still be processing the ring while cleanup
>> resets the QP, and transport link cleanup can free the MW before the
>> tasklet finishes.
>>
>> Clear active under rx_sched_lock and drain the tasklet before resetting
>> the QP. Temporarily disable QP link work so a concurrent client link-up
>> request cannot reactivate RX during cleanup, then re-enable it for the
>> existing link setup paths.
>>
>> This does not drain RX DMA transfers or their completion callbacks.
>
> Is this something that we should handle?
Ah I see you are handling it in the next patch. I would add a comment to say that is being handled follow on.
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
>
> DJ
>
>>
>> Fixes: 9143595a7e05 ("NTB: ntb_transport: Free MWs in ntb_transport_link_cleanup()")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Koichiro Den <den@valinux.co.jp>
>> ---
>> Changes in v2:
>> - No changes.
>>
>> drivers/ntb/ntb_transport.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c
>> index 45d4365becac..36797ea3ff45 100644
>> --- a/drivers/ntb/ntb_transport.c
>> +++ b/drivers/ntb/ntb_transport.c
>> @@ -956,11 +956,16 @@ static void ntb_qp_link_cleanup(struct ntb_transport_qp *qp)
>>
>> dev_info(&pdev->dev, "qp %d: Link Cleanup\n", qp->qp_num);
>>
>> - cancel_delayed_work_sync(&qp->link_work);
>> + disable_delayed_work_sync(&qp->link_work);
>> + ntb_transport_set_qp_active(qp, false);
>> + tasklet_kill(&qp->rxc_db_work);
>> +
>> ntb_qp_link_down_reset(qp);
>>
>> if (qp->event_handler)
>> qp->event_handler(qp->cb_data, qp->link_is_up);
>> +
>> + enable_delayed_work(&qp->link_work);
>> }
>>
>> static void ntb_qp_link_cleanup_work(struct work_struct *work)
>
next prev parent reply other threads:[~2026-09-24 15:53 UTC|newest]
Thread overview: 74+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-10 4:08 [PATCH v2 00/14] NTB: ntb_transport: Miscellaneous fixes Koichiro Den
2026-09-10 4:08 ` [PATCH v2 01/14] NTB: ntb_transport: Remove the device debugfs directory Koichiro Den
2026-09-10 4:20 ` sashiko-bot
2026-09-10 18:41 ` Frank Li
2026-09-15 17:52 ` Logan Gunthorpe
2026-09-24 15:37 ` Dave Jiang
2026-09-10 4:08 ` [PATCH v2 02/14] NTB: ntb_transport: Start TX offload thread after queue setup Koichiro Den
2026-09-11 16:13 ` Frank Li
2026-09-15 18:08 ` Logan Gunthorpe
2026-09-24 15:38 ` Dave Jiang
2026-09-10 4:08 ` [PATCH v2 03/14] NTB: ntb_transport: Avoid deadlock when cancelling link work Koichiro Den
2026-09-10 4:23 ` sashiko-bot
2026-09-11 16:21 ` Frank Li
2026-09-11 17:41 ` Koichiro Den
2026-09-15 18:19 ` Logan Gunthorpe
2026-09-10 4:08 ` [PATCH v2 04/14] NTB: ntb_transport: Publish link state after QP setup Koichiro Den
2026-09-11 16:39 ` Frank Li
2026-09-15 18:32 ` Logan Gunthorpe
2026-09-24 15:40 ` Dave Jiang
2026-09-10 4:08 ` [PATCH v2 05/14] NTB: ntb_transport: Avoid losing QP link-up requests Koichiro Den
2026-09-10 4:26 ` sashiko-bot
2026-09-11 16:53 ` Frank Li
2026-09-11 18:04 ` Koichiro Den
2026-09-11 18:21 ` Koichiro Den
2026-09-12 3:20 ` Frank Li
2026-09-12 14:52 ` Koichiro Den
2026-09-18 14:43 ` Dave Jiang
2026-09-19 13:08 ` Koichiro Den
2026-09-10 4:08 ` [PATCH v2 06/14] NTB: ntb_transport: Clear link state before QP cleanup Koichiro Den
2026-09-10 4:27 ` sashiko-bot
2026-09-15 18:55 ` Logan Gunthorpe
2026-09-24 15:45 ` Dave Jiang
2026-09-10 4:08 ` [PATCH v2 07/14] NTB: ntb_transport: Stop QP work before freeing a queue Koichiro Den
2026-09-10 4:23 ` sashiko-bot
2026-09-15 19:59 ` Logan Gunthorpe
2026-09-10 4:08 ` [PATCH v2 08/14] NTB: ntb_transport: Stop RX tasklet scheduling " Koichiro Den
2026-09-18 15:28 ` Logan Gunthorpe
2026-09-24 15:49 ` Dave Jiang
2026-09-10 4:08 ` [PATCH v2 09/14] NTB: ntb_transport: Drain RX tasklets during link cleanup Koichiro Den
2026-09-10 4:23 ` sashiko-bot
2026-09-18 15:41 ` Logan Gunthorpe
2026-09-24 15:51 ` Dave Jiang
2026-09-24 15:53 ` Dave Jiang [this message]
2026-09-28 5:34 ` Koichiro Den
2026-09-10 4:08 ` [PATCH v2 10/14] NTB: ntb_transport: Wait for RX completions before resetting a QP Koichiro Den
2026-09-10 4:24 ` sashiko-bot
2026-09-18 17:21 ` Logan Gunthorpe
2026-09-24 15:54 ` Dave Jiang
2026-09-10 4:08 ` [PATCH v2 11/14] NTB: ntb_transport: Prepare remote RX info accesses for MW teardown Koichiro Den
2026-09-10 4:31 ` sashiko-bot
2026-09-18 18:04 ` Logan Gunthorpe
2026-09-24 15:56 ` Dave Jiang
2026-09-24 15:57 ` Dave Jiang
2026-09-28 8:51 ` Koichiro Den
2026-09-28 15:22 ` Dave Jiang
2026-09-10 4:08 ` [PATCH v2 12/14] NTB: ntb_transport: Clear QP pointers when freeing an MW Koichiro Den
2026-09-10 4:32 ` sashiko-bot
2026-09-18 18:16 ` Logan Gunthorpe
2026-09-24 15:59 ` Dave Jiang
2026-09-28 5:35 ` Koichiro Den
2026-09-10 4:08 ` [PATCH v2 13/14] NTB: ntb_transport: Abort link setup on QP MW allocation failure Koichiro Den
2026-09-10 4:40 ` sashiko-bot
2026-09-18 18:17 ` Logan Gunthorpe
2026-09-24 16:00 ` Dave Jiang
2026-09-10 4:08 ` [PATCH v2 14/14] NTB: ntb_transport: Remove clients before freeing transport resources Koichiro Den
2026-09-10 4:36 ` sashiko-bot
2026-09-10 8:48 ` Koichiro Den
2026-09-11 15:49 ` Dave Jiang
2026-09-14 4:27 ` Koichiro Den
2026-09-14 21:02 ` Dave Jiang
2026-09-15 4:01 ` Koichiro Den
2026-09-15 15:50 ` Dave Jiang
2026-09-18 18:19 ` Logan Gunthorpe
2026-09-24 16:02 ` Dave 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=81b16606-4000-4e21-ba32-ab00a471d44f@intel.com \
--to=dave.jiang@intel.com \
--cc=Frank.Li@kernel.org \
--cc=allenbh@gmail.com \
--cc=den@valinux.co.jp \
--cc=fuyuanli0722@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jdmason@kudzu.us \
--cc=joey.zhang@microchip.com \
--cc=linux-kernel@vger.kernel.org \
--cc=logang@deltatee.com \
--cc=nab@linux-iscsi.org \
--cc=ntb@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.