From nobody Wed Dec 4 18:52:54 2024 Received: from mail-pl1-f174.google.com (mail-pl1-f174.google.com [209.85.214.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 680722905 for ; Tue, 3 Dec 2024 03:34:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.174 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733196892; cv=none; b=tBv16IjEP9yBSZ3ykzDqE05sLyXeP2qPSeefB22oWOQaZgWRO3j+V56UHQ+dJL7NJpLelo63GyuscC0gb1dTz/cWtOMA9CiKAM8LzrYVhGP1OYZGlgXYc6ILpIOlJbvATw1uFOVKw5M2jRhMsdfNc2cUMmY1WfjFoZLpU93lkpw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733196892; c=relaxed/simple; bh=PavmXKb7c01Z/dnMBjwCAK9z+jnOybfldhgG1FCXYD8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=ciQtyOyxYBy+ZwIIGlmHiw+dTF4qzVTjG3w0eBxKvHx6b2bDWo7P29piqQ6aIeHZzrdUQO+Dmdza+MIfC3pte2s9kyJD+dYEH1tXMLWwS/Regm7qQBn0QsAHd2lu9yK+OZbqJDJAw48aOHYH4v8UD4vwuczTdo1bwrFl296pc7s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=dym/Xevg; arc=none smtp.client-ip=209.85.214.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dym/Xevg" Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-21539e1d09cso45936765ad.1 for ; Mon, 02 Dec 2024 19:34:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733196891; x=1733801691; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=o7u1S0eHhsN4mYxNA4iXN1JMBrK9KSvAJK6vFPRdxHE=; b=dym/XevgobvVpkFA90Gtd+N57CV83KyHJtYdtRa4NNQ/sqyVAi+a6rxYuMasJ83Qxo KXkNVQPp5QUWytLtAJjzJMBVHdrCMh0AtQWT2C9PZhHI1hzX+n2gtRiPItDF7coCJIIJ 1M/xFGm0O7Pn3AmAMBrjJmegU9YFKLjfv4oUi3HroA1s4N8tBszmnlQe2wVFzZAKHC9W Ml+l+gPHDk2Q989VhCd3X1vEfgBR5wwU6LEZ+9NeqzdscHMzx9isRFNwaxLenerzCwZ0 U3OScBaE1x66yvSeBHydx+lZMT2hTnPBDp6gw2bGGr1icIN7V/83rWrvQwYczYWvP7Nh H4Rw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733196891; x=1733801691; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=o7u1S0eHhsN4mYxNA4iXN1JMBrK9KSvAJK6vFPRdxHE=; b=n2Cg8UPqc5N6gemzv9UHq3zbokPbbfBY6NMTmzu2lTgLZptcinsl8ugkTfqbOaZdDr MrMrPxtaOtwJGVB3d7/mpllRvbJmBHIRMZIXC6yRuYqq3MWXN6LXRC6jVdX9SME4Uwe+ hYKnZPY6LFq2G4Tcm28S8tXSOaRM6q1S7JnTjgshskgHwE0l7JegkqMHY9vhGqanLV7h YmBNbDId/ef7AFsm0NGzUxoEm7e5SApkG3MX3OVP602rGKFG+tSBn5HRG9dIagFfZhNP jPKuT6DU5kKZuckYg3l8D7mjqd6Jd3A7VDZNyIu/N9Ql3KX1X1H5qrjpnnvPewXg6ZZM IZTw== X-Forwarded-Encrypted: i=1; AJvYcCUgIhE807+1OS24yQaedorAThanyY88qvyjpfjP7NZLG/lgbzyZioy88h24A6qEyWrVWy/rAuVQK7G22hU=@vger.kernel.org X-Gm-Message-State: AOJu0Yz5BoRNsrkd2N/IzQnDlTd+8UcWoaJFivSqfMDqS5Dkqgy6mGnC XcMGsuVA3aKVDyn1vCc99ing9Ec/qyeSI7YxbfbGmXOix1CI9mx2WDBRu7xvAIg= X-Gm-Gg: ASbGncsHf+V1f6Fj/fQNlLXXFlVMEr4RYfLBObDqFgNC/876UX7dZzdTjuZSQxite8Y M157KVuGrKZn7yhckIuY4FVinypnCMaTsziH0Q5YBEWGt/44UPJu5pOq/jCuXR5odefMlojqbvF /mZYCdWtT8JN+ArUytq3CZudD0veBzHjJUwDBs3XJqqEhJn0lgR0yLFfX6guOaltPy78LmL8fyV YYboFe4z/WCD2TOAX7ygZ3jXRBKrZdwAlqwSZAA7tMJ6HZwXkFQIqn5ebE+NA== X-Google-Smtp-Source: AGHT+IEQVYb1UMuUdfZdRH588z4/zfIk7I6L4N+qQj1+gNpi0vAJ5WzL3BoXukZp5mc5P8q8Z5nYaQ== X-Received: by 2002:a17:903:1c1:b0:215:6e28:8260 with SMTP id d9443c01a7336-215bd266031mr10635355ad.50.1733196890290; Mon, 02 Dec 2024 19:34:50 -0800 (PST) Received: from localhost.localdomain ([143.92.64.17]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-215a17a7be1sm20749645ad.255.2024.12.02.19.34.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 19:34:49 -0800 (PST) From: "brookxu.cn" To: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: hare@suse.de, lengchao@huawei.com Subject: [PATCH v3 1/4] nvme-tcp: fix the memleak while create new ctrl failed Date: Tue, 3 Dec 2024 11:34:40 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Chunguang.xu" Now while we create new ctrl failed, we have not free the tagset occupied by admin_q, here try to fix it. Fixes: fd1418de10b9 ("nvme-tcp: avoid open-coding nvme_tcp_teardown_admin_q= ueue()") Signed-off-by: Chunguang.xu Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/nvme/host/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 3e416af2659f..55abfe5e1d25 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -2278,7 +2278,7 @@ static int nvme_tcp_setup_ctrl(struct nvme_ctrl *ctrl= , bool new) } destroy_admin: nvme_stop_keep_alive(ctrl); - nvme_tcp_teardown_admin_queue(ctrl, false); + nvme_tcp_teardown_admin_queue(ctrl, new); return ret; } =20 --=20 2.25.1 From nobody Wed Dec 4 18:52:54 2024 Received: from mail-pg1-f175.google.com (mail-pg1-f175.google.com [209.85.215.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C5B2C17BB1C for ; Tue, 3 Dec 2024 03:34:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733196895; cv=none; b=Ut7rTlxU27CQR1XrneDTPEArqDcUSjpuOW2QFB3OjI+Qi3LN2zTI4SAJ3EUgP8RUSIRU8pQpXBN083QdkXP+92Qxtr/+xmZgt28mYqcQPqDb4aid/3GhcCGahPIcJJEV3zWGAtYcbSGaJnF3JGSIEBpDi77QnxTX6tAwTs/P9C8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733196895; c=relaxed/simple; bh=CUhS4LCnPr4917pX7wfMGN/U4666R2kGGQUuNdvs5Fg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=eJFtd5SJAA43WsLK9SeyRRqCfg8/Mfd1r9ssGA7+eyFRues3ccC0XjBBsul2OKM9Pp6HQK3+6nIPrrZwL2sIFd84L2u1btum3DDYXA7QZyMctPzmfHbbGlW5Ax1cVtKpuEi5BTKve4rvj29EfVf3uKM5aWG4l/YDMhbnr7E3nLM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=T2RIWTeY; arc=none smtp.client-ip=209.85.215.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T2RIWTeY" Received: by mail-pg1-f175.google.com with SMTP id 41be03b00d2f7-7fbce800ee5so4978111a12.2 for ; Mon, 02 Dec 2024 19:34:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733196893; x=1733801693; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=XmxvTcrzfwp5mh+amZ33Odw2AKzrv2TrqCm0sLIaCwc=; b=T2RIWTeYFrgh3/PcXfMjZTIorSW87xwhgniLurZ99rW9JImdWCsy/DdgjyF1vLXk6u INw9xN8ZTT21nhfxxWzR+6wkL1xfgrUMfrK0UB7TmLjTlXj7J1kYHJS3AIocrweogyph mSiFCsmoiFXJwh8NmEsSvbp4Wbx6sRarpVqxb7z85/Pp6K7tX/VlOnUGMbymz/NV3RyW PK888UovP18EaXmPXmVpaa2F3MTekQt9Smxu59A/9blSZSBrwWX7Y/iyQ0JluAsRN/z7 bhUtKmRowJPhJ7t3nJr4q3ptuWqK6gZGRj6oOFlRLMiFDtTHl1/oQ+CfrFD5A67ZPkxd 8rsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733196893; x=1733801693; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XmxvTcrzfwp5mh+amZ33Odw2AKzrv2TrqCm0sLIaCwc=; b=GtIqWw7a2XgeJag9uc0AgXKK8ODJeA64wBBSF6Cz0eRXtpAFtGbjPgl/FNy3/DAbyd Y2FRVboasJQ6BJSuh4lPC4pEAeFj88sla05W+WewLXBEyqtNGfKkRv23vjslIEW/0ZXB QqQhLqe1EovVVP76i2rKToKcOF+ytVwubRC9HbUfP+1xzTzB9N0jCJPsR/7OCmxVK6HZ juOIvKucv0Ov0hbDOh2UbN4eF480bSFDpgyKNJ+ZUeLEDEEtpbcW5WK+TxyEGT/tdBTh psQjRWeWh/our2AKT5KRdfEIE1uFpAIkjbvuFXFH3SLixhQpYyHZG+pjmDjjhg0J3i9P sWmA== X-Forwarded-Encrypted: i=1; AJvYcCWN7XQN+qV/gUybThtFbLGgyKqfd3yb4Mkq4eb+tHLj8wuueNJZW9ILhoOvKlpZW4wr4TmuBLXBBDV/g0w=@vger.kernel.org X-Gm-Message-State: AOJu0YyO53/EiSmYK4fmmP7FAT6RU+Uc+52FRPaDvbtQmT6cYViRFzRJ 7uIWQ1jiZ/h4FISUouG9YnsSu4KElvmT7i5c+Nexyh7vhbLsdBd8 X-Gm-Gg: ASbGnctV41V9sfJX73fE/bAl3hiJjM6ulOqjpjMcYCieVGtl82/ub9JcwB+2DIGR8gn dRzTBXhr8BoLqUuZcDlcsfw7IDhc93n4UY44RXIBqW6565CmblYAbnRm1A8wLBqUuAmgBB+AWAX 38X95gNTc14MogVsc20BlDBTYB3adMM0Kv0iIXSUF/a9eJHjZrTkXY9Hzq22pNyF9ZZOyhiYIyS bzDhULR7UDz1fb5RHzl3C7TIPN5NOYzYMRSyH0qG82PCDTOvh/8vf0kzjE+PQ== X-Google-Smtp-Source: AGHT+IFm0LGFirXaTvKZaSoFvKfpRDLZlmiFQ/VjBQ22pAFs7108tr2ExxyERlRXw4lHHOX4mkDyBg== X-Received: by 2002:a05:6a20:6a28:b0:1db:f01a:cf12 with SMTP id adf61e73a8af0-1e1653f28e6mr1801738637.34.1733196893014; Mon, 02 Dec 2024 19:34:53 -0800 (PST) Received: from localhost.localdomain ([143.92.64.17]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-215a17a7be1sm20749645ad.255.2024.12.02.19.34.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 19:34:52 -0800 (PST) From: "brookxu.cn" To: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: hare@suse.de, lengchao@huawei.com Subject: [PATCH v3 2/4] nvme-rdma: unquiesce admin_q before destroy it Date: Tue, 3 Dec 2024 11:34:41 +0800 Message-Id: <4ba9a8547c5cce3ee358e26890e16edbba94f789.1733196360.git.chunguang.xu@shopee.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Chunguang.xu" Kernel will hang on destroy admin_q while we create ctrl failed, such as following calltrace: PID: 23644 TASK: ff2d52b40f439fc0 CPU: 2 COMMAND: "nvme" #0 [ff61d23de260fb78] __schedule at ffffffff8323bc15 #1 [ff61d23de260fc08] schedule at ffffffff8323c014 #2 [ff61d23de260fc28] blk_mq_freeze_queue_wait at ffffffff82a3dba1 #3 [ff61d23de260fc78] blk_freeze_queue at ffffffff82a4113a #4 [ff61d23de260fc90] blk_cleanup_queue at ffffffff82a33006 #5 [ff61d23de260fcb0] nvme_rdma_destroy_admin_queue at ffffffffc12686ce #6 [ff61d23de260fcc8] nvme_rdma_setup_ctrl at ffffffffc1268ced #7 [ff61d23de260fd28] nvme_rdma_create_ctrl at ffffffffc126919b #8 [ff61d23de260fd68] nvmf_dev_write at ffffffffc024f362 #9 [ff61d23de260fe38] vfs_write at ffffffff827d5f25 RIP: 00007fda7891d574 RSP: 00007ffe2ef06958 RFLAGS: 00000202 RAX: ffffffffffffffda RBX: 000055e8122a4d90 RCX: 00007fda7891d574 RDX: 000000000000012b RSI: 000055e8122a4d90 RDI: 0000000000000004 RBP: 00007ffe2ef079c0 R8: 000000000000012b R9: 000055e8122a4d90 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000000000004 R13: 000055e8122923c0 R14: 000000000000012b R15: 00007fda78a54500 ORIG_RAX: 0000000000000001 CS: 0033 SS: 002b This due to we have quiesced admi_q before cancel requests, but forgot to unquiesce before destroy it, as a result we fail to drain the pending requests, and hang on blk_mq_freeze_queue_wait() forever. Here try to reuse nvme_rdma_teardown_admin_queue() to fix this issue and simplify the code. Fixes: 958dc1d32c80 ("nvme-rdma: add clean action for failed reconnection") Reported-by: Yingfu.zhou Signed-off-by: Chunguang.xu Signed-off-by: Yue.zhao Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/nvme/host/rdma.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/nvme/host/rdma.c b/drivers/nvme/host/rdma.c index baf7d2490152..86a2891d9bcc 100644 --- a/drivers/nvme/host/rdma.c +++ b/drivers/nvme/host/rdma.c @@ -1091,13 +1091,7 @@ static int nvme_rdma_setup_ctrl(struct nvme_rdma_ctr= l *ctrl, bool new) } destroy_admin: nvme_stop_keep_alive(&ctrl->ctrl); - nvme_quiesce_admin_queue(&ctrl->ctrl); - blk_sync_queue(ctrl->ctrl.admin_q); - nvme_rdma_stop_queue(&ctrl->queues[0]); - nvme_cancel_admin_tagset(&ctrl->ctrl); - if (new) - nvme_remove_admin_tag_set(&ctrl->ctrl); - nvme_rdma_destroy_admin_queue(ctrl); + nvme_rdma_teardown_admin_queue(ctrl, new); return ret; } =20 --=20 2.25.1 From nobody Wed Dec 4 18:52:54 2024 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7040418785C for ; Tue, 3 Dec 2024 03:34:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733196897; cv=none; b=AZIvI6NFxQ1nhmxUbxC/xdj0glR4pP+Q8Jl0cXSbJiejA7DETKgkVBsa6RLmHGLolUr/0wSO40q9//2s7NSpWeCW0ykIQJtqP208RvBfQPCGFs//JYXz4YLTpiCAZ1FhhJnCAt0vs+2oObApY27xQSGjFvgyaSCF3QPMsN6A9hk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733196897; c=relaxed/simple; bh=gG8MoTVX1P2xZqP+L+DggxSp584tVnqDd56pAULoHFg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=JATpr1w/IeR+/EBetOMjtU/aGTHPzMiVHS1GEEaQvbX8dPkUEWesU7brP5TYcAy3YbvDN1Rdw60bkrF5LDssFNjNbWEcbj587w3DC4o+GdDF8N9bQH9p2Kl+Y5YhRKobZxK7JgFHxYg6cAytVoedCkY9ETFdG07Y//e5UbtXssE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=LzQxG0Oq; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LzQxG0Oq" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-7fbd70f79f2so4825700a12.2 for ; Mon, 02 Dec 2024 19:34:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733196896; x=1733801696; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Y6AV0h7FNjp9FEqh641JiaIQjrd1pHaDZb70DiuzgZI=; b=LzQxG0Oq5XzSQzg7D1WHIsmBh6EsNDTO+uvCK6X7zV311nnbRkf4vtFRW356b5ATsu WGoQE1cCJ5G+oYiclF0J5KESFAT1ORqdo+mwTjvHbBBTebfbe4MWsE1XYhDbQf6zxU9A VyqMz31K74oapjnwI4uMHNKVhi+3hL4yo5m76LItTITvjvrQUjKcQ+TZTVkmbtc+ONfO f86JFq1NH0NVNT5cVv8wjHoVgC/WjPdG6Ipr7LvKHF1PPS7yjV6R1+Kxe2haAzdNiB96 Jo0PBb3rqJFTyR4snugGpZSwKNrCOHxoobbHQgOs5R4Ef/tAgtTTMEAK/wSCnxowcFh2 /0eA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733196896; x=1733801696; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Y6AV0h7FNjp9FEqh641JiaIQjrd1pHaDZb70DiuzgZI=; b=MaXf6t1tib8V1g7A2uH40tHc+ZIObczLukvh36sqGiUQQyUth030l3WRCsIrJ4/TQl m86bQaZalxZV5ReY5/06J9eRGpxcIVH2MLFPcKsh+EUq127svHEQtSqK565aLivrMdWG 913IInt2GdUdY2pAH0fnGD5QaNgzxnPEoHfbVTLnjCTqC7mnfWLsvZ9SBmRBd/BUwRqb 8nqGZf1f7ehepk7CBnCWZq5tkRzbx4nKcGq8APgVDba6G71heHM+6S08+499GfZg66NC 7KtufIt9hzbQBxseB+bN3lmR9/ZjkiPl2fwebtgfLHWXoTNTsyehWRH8I/CqBQpicnfb MkvA== X-Forwarded-Encrypted: i=1; AJvYcCWKede1lcg5OEtYnbBqbtloQNFg9LuIfPB+T1bn7M4Xuq473hpWMuIZ9uDi5cbXyX4Q062+PJjWjUDhk88=@vger.kernel.org X-Gm-Message-State: AOJu0YwGvXRTHxyFUhBrZc3NLdCmGCpNfBuKiWg/pzwqhvRt8woJvTbE js6cdKy/u9fZNTPNK1fWj1sr9ivGBCzfM3KEebpLNUsVde+jqlyL X-Gm-Gg: ASbGnct0/hujkQOmtPZKtqL5dDcewM5TLeY+oR24VYpmnK7dgoHxqQzcHgROH7J89B/ 9aHEvgwQ+6mkXFR5ugXXfBmiUVLHlXoa3zeIVTybCI7ZOg0JdpAMwKDbC3BGuRVbB8HfBaQelmd yh9MRvroiakSvl/4TjZyQngZ3JiZdFalz/4L5o7z7s1sdhO9iUA0E6Q585zud8ob26RcylUQUyU IcWG+hd/SinG0tW9IxqDs2HguAv8M2LRPwKzteauH69aInQGYCOKe/apV2APg== X-Google-Smtp-Source: AGHT+IG/3v6d0HhuojT/rCyNJmBTQDwDmQb89wyTD19L5RRZmIzLFQmfix9M6IAIezSRwrhdjHrdYw== X-Received: by 2002:a05:6a20:748e:b0:1e0:d1f7:9437 with SMTP id adf61e73a8af0-1e1654134a8mr1688465637.38.1733196895660; Mon, 02 Dec 2024 19:34:55 -0800 (PST) Received: from localhost.localdomain ([143.92.64.17]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-215a17a7be1sm20749645ad.255.2024.12.02.19.34.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 19:34:55 -0800 (PST) From: "brookxu.cn" To: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: hare@suse.de, lengchao@huawei.com Subject: [PATCH v3 3/4] nvme-tcp: no need to quiesce admin_q in nvme_tcp_teardown_io_queues() Date: Tue, 3 Dec 2024 11:34:42 +0800 Message-Id: <1562477fe9a03adefddf551148882d27a01529d7.1733196360.git.chunguang.xu@shopee.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Chunguang.xu" As we quiesce admin_q in nvme_tcp_teardown_admin_queue(), so we should no need to quiesce it in nvme_tcp_reaardown_io_queues(), make things simple. Signed-off-by: Chunguang.xu Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/nvme/host/tcp.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 55abfe5e1d25..98bf758dc6fc 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -2178,7 +2178,6 @@ static void nvme_tcp_teardown_io_queues(struct nvme_c= trl *ctrl, { if (ctrl->queue_count <=3D 1) return; - nvme_quiesce_admin_queue(ctrl); nvme_quiesce_io_queues(ctrl); nvme_sync_io_queues(ctrl); nvme_tcp_stop_io_queues(ctrl); --=20 2.25.1 From nobody Wed Dec 4 18:52:54 2024 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 58855188CB1 for ; Tue, 3 Dec 2024 03:34:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733196901; cv=none; b=KJnux4o5l2gC5TatFIstIt9rOzIjatiJ0CK0ZRmxiJeSCtLDGyiFAuPbaOUknEJ0nidjRT6fAo2A9JMCR67lmQsp0N7m5rS6iArzAm/V+gVv0Zm6+u36fMWBtReHr/bJ6w2FvaIOOrBwEa5UlUkdSo6mX5VG1HMIj99U49q9ge0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1733196901; c=relaxed/simple; bh=wRFFWhV51UY3eY6JPegQSq0QhJ/YS+D+vZ7fhC+pyII=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fznvYdAbqurADXz/3P3yDP7dELMsjT5QxdkdP1o2HgwANCY92BQSxRjbq8Qo+p2SQVE3Lt9B+cI2eDnodhhidRo3iYJLybXgYugB4LbPadWjYb6pZdJnR4uvgExJEZ8TA9w9B/qxl9mSuVc6eKNikTew49sJmazlsqdyOWJLDGg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=kVDE1El/; arc=none smtp.client-ip=209.85.210.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kVDE1El/" Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-724e14b90cfso5022503b3a.2 for ; Mon, 02 Dec 2024 19:34:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733196898; x=1733801698; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=y605Yoqum/jZcE7U0+5pZo9sFjv/Z/YWwjaxKaUzHJk=; b=kVDE1El/hkFM+uovMNJ3jR0G5dqKAHn+Vyl2d3jrJPYerREEG/+3EgR7Qnrh4b/Vwg NThEGxf8sG5eGwXCZTjHrnprWCTMPiJIFPl7WXuv3r3mLzqigaghwF08UgPNclgEfyJD e0bV+iEj0n7d03cWHFwJvEwzd1zBbhMmIGWmNemoR05AySARFNjW3tAbfKYrHm1kr/po C2gzhUUwGEgLnw4IEhQ/4c6Kx9LfzzuKeFXYr1G4IkaPrF4jVPV3/E/tPg0/iX6IqrTM 5czdnTUry/nFyo5SlOLYKrpzKjmgPeX7N73pE5X3ZZiQPZIwnpHWKt1mkHAoR/lBYLCC Wi2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733196898; x=1733801698; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=y605Yoqum/jZcE7U0+5pZo9sFjv/Z/YWwjaxKaUzHJk=; b=wdPBA6CY2kveb8V4GZm1RlhbJg7LzJvyKESx65jfyMRKSgTj2FdPl8heGkaJsExz/x zG2nNm9QS88ju7JXP9tM/z1FVCGlh/8pfLvWVzfye6q0FufarL1tkhm2o+bNvRBU4Ypi eJ8Qp1bPRU0ntoeuiIi7zx5C5aukntQutDzxjBbwKoJpE/v4CqbphA1kxSrxqWlzc7iU U5S9rdBS4qdM/4GSotbnC13wM92EyVGqyQ0+Fns8tZXX/59poJRKCjr5qXpMY6beDM/G LwmKTPYZWw5Mshv4RzXmUS5Ykg46IrgClWT+/cWIV9efHWWrPEXmrkGNRR8UG9rxC9ba z+lg== X-Forwarded-Encrypted: i=1; AJvYcCXmWVuZk9HSp3SvSJEdBCIAs7SGsD8Fhu/Cq8v5zITwSrkpjZYNueRqN1t7T64/8vZ6KUt53WQBStEEbbk=@vger.kernel.org X-Gm-Message-State: AOJu0YxYNMQjgHQKeg8JjVm6oClS65mRdWlYf5r3NZ2ywPs6mu0UOfqg Cea6nd/6GcvwUCbKbcLVV2U6RBs0aME4ooV98WvFe0kbDGm4vvdg X-Gm-Gg: ASbGncvL8bvYJqagJeOp32njOs2tVH03tR/UcIbgwbd+aBHruLadshEkF6HU6pZDqRe rlyMH7Tfles31O09ES/l9m8aDKTIdn7ekfnGRknxSfFUsI7rM80E5hsSN+l54czr6DpATG3BLHY XCzYT3ZAMLzQ2PQiFE+C/y/DA4zL578yrQcIqunUIkUgaAI1Btzu+uJrKQFhwPlXPS2Q88LdW9m ywAFB2yKHGviFlHG/r5ISjK7+0V7LJjZj7LSJ9xxOMm+tUP03RJPOTl3W58yQ== X-Google-Smtp-Source: AGHT+IE5D0txWF2LyZfs5ncf+l0eY3tlyVCpC6uLbHvVEXZiiJms0ww6O9iF/3o7GF7mHDnYmdng+Q== X-Received: by 2002:a17:903:41cc:b0:215:603c:2f15 with SMTP id d9443c01a7336-215bd0f2a87mr14653445ad.21.1733196898556; Mon, 02 Dec 2024 19:34:58 -0800 (PST) Received: from localhost.localdomain ([143.92.64.17]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-215a17a7be1sm20749645ad.255.2024.12.02.19.34.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 Dec 2024 19:34:57 -0800 (PST) From: "brookxu.cn" To: kbusch@kernel.org, axboe@kernel.dk, hch@lst.de, sagi@grimberg.me, linux-nvme@lists.infradead.org, linux-kernel@vger.kernel.org Cc: hare@suse.de, lengchao@huawei.com Subject: [PATCH v3 4/4] nvme-tcp: simplify nvme_tcp_teardown_io_queues() Date: Tue, 3 Dec 2024 11:34:43 +0800 Message-Id: X-Mailer: git-send-email 2.25.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: "Chunguang.xu" As nvme_tcp_teardown_io_queues() is the only one caller of nvme_tcp_destroy_admin_queue(), so we can merge it into nvme_tcp_teardown_io_queues() to simplify the code. Signed-off-by: Chunguang.xu Reviewed-by: Christoph Hellwig Reviewed-by: Hannes Reinecke --- drivers/nvme/host/tcp.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) v3: Update the commit log, no code changed. diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 98bf758dc6fc..28c76a3e1bd2 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -2101,14 +2101,6 @@ static int nvme_tcp_configure_io_queues(struct nvme_= ctrl *ctrl, bool new) return ret; } =20 -static void nvme_tcp_destroy_admin_queue(struct nvme_ctrl *ctrl, bool remo= ve) -{ - nvme_tcp_stop_queue(ctrl, 0); - if (remove) - nvme_remove_admin_tag_set(ctrl); - nvme_tcp_free_admin_queue(ctrl); -} - static int nvme_tcp_configure_admin_queue(struct nvme_ctrl *ctrl, bool new) { int error; @@ -2163,9 +2155,11 @@ static void nvme_tcp_teardown_admin_queue(struct nvm= e_ctrl *ctrl, blk_sync_queue(ctrl->admin_q); nvme_tcp_stop_queue(ctrl, 0); nvme_cancel_admin_tagset(ctrl); - if (remove) + if (remove) { nvme_unquiesce_admin_queue(ctrl); - nvme_tcp_destroy_admin_queue(ctrl, remove); + nvme_remove_admin_tag_set(ctrl); + } + nvme_tcp_free_admin_queue(ctrl); if (ctrl->tls_pskid) { dev_dbg(ctrl->device, "Wipe negotiated TLS_PSK %08x\n", ctrl->tls_pskid); --=20 2.25.1