From nobody Wed Apr 1 22:18:50 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DA699408249 for ; Wed, 1 Apr 2026 12:54:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775048065; cv=none; b=TTnJja6OhgvQFwQYXFoRsN8fF96kRrIR1adZ2HgeDlFM9msnTBQbDJJeny2QW/WL/gjlUiEf6vpokvPVcCos+KZFQTp+5CtJ5EU5cZ46lBnId4M3+Cl0AhR3oj+bZtDOfZ0Nm813q6vQMRMEdwhkC0+eDeWtDZ9DvuL728spZX0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1775048065; c=relaxed/simple; bh=AJWqOxlxo2+o2DiQiENh5RMMJiYZ6jjhJX0rPI7pr+4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OHhyaTOQlI+kDD8mjDgNIxwaUeZUQOzqSWmimtO+1lCTFq2Zng0Lq3fCcndOCNtCgOXguL3GWyPjRcFkvxYfmIods1VpgPdEAEhVvyQi3tRDJkgm7evNMD3y6IVLGSsGnAj8k13f7qamht6gyzlhwRPJH+K/OcL1ePZr16di6KA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZLJfgx94; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZLJfgx94" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D484C116C6; Wed, 1 Apr 2026 12:54:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1775048065; bh=AJWqOxlxo2+o2DiQiENh5RMMJiYZ6jjhJX0rPI7pr+4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZLJfgx94JEfYJuuJDdPHyMeJHMbxtM9tAvyf6f4HC36ZVJmLfSQXuqUPCGRP4/1xW GkkFa+TuvYiu3Il8Nizfyw6BHxab4v+OPUoykcL/WsI9jEYhspkmY40lZkApjQAGiv mtsq1+SpDwNwp7BdrmAIOZTpTGRUB5xlJBqoNLptTS1Zewa4/gbYRwVydL/aemrOO/ GiLNJ7g6VG5XpUgGMKrG9V9pfrWVhMihJyWpRjbmio0y+8LKBR88VStdh43UPZlOWv uAbvndWPVAeqwOu8HqJrT20iXeXYk54o4lp69CpQWe95IFBLGT/lkIM0+5uddl3u4L 5fEtOihpjFSug== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang , Hannes Reinecke , zhenwei pi , Hui Zhu , Gang Yan Subject: [RFC mptcp-next v8 5/7] nvme-tcp: register host mptcp transport Date: Wed, 1 Apr 2026 20:53:43 +0800 Message-ID: <0784d6f12b6f3e056c526a841fe8ad0e4ebb7cfe.1775047736.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.51.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Geliang Tang This patch defines a new nvmf_transport_ops named nvme_mptcp_transport, which is almost the same as nvme_tcp_transport except .type and .allowed_opts. MPTCP currently does not support TLS. The four TLS-related options (NVMF_OPT_TLS, NVMF_OPT_KEYRING, NVMF_OPT_TLS_KEY, and NVMF_OPT_CONCAT) have been removed from allowed_opts. They will be added back once MPTCP TLS is supported. It is registered in nvme_tcp_init_module() and unregistered in nvme_tcp_cleanup_module(). A separate nvme_mptcp_ctrl_ops structure with .name =3D "mptcp" is defined and used for MPTCP controllers. A MODULE_ALIAS("nvme-mptcp") declaration alongside the other module metadata is added at the end of the file. v2: - use 'trtype' instead of '--mptcp' (Hannes) v3: - check mptcp protocol from opts->transport instead of passing a parameter (Hannes). v4: - check CONFIG_MPTCP. Cc: Hannes Reinecke Co-developed-by: zhenwei pi Signed-off-by: zhenwei pi Co-developed-by: Hui Zhu Signed-off-by: Hui Zhu Co-developed-by: Gang Yan Signed-off-by: Gang Yan Signed-off-by: Geliang Tang --- drivers/nvme/host/tcp.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c index 30e4d915011e..30ff6e03b32f 100644 --- a/drivers/nvme/host/tcp.c +++ b/drivers/nvme/host/tcp.c @@ -3060,6 +3060,20 @@ static struct nvmf_transport_ops nvme_tcp_transport = =3D { .create_ctrl =3D nvme_tcp_create_ctrl, }; =20 +#ifdef CONFIG_MPTCP +static struct nvmf_transport_ops nvme_mptcp_transport =3D { + .name =3D "mptcp", + .module =3D THIS_MODULE, + .required_opts =3D NVMF_OPT_TRADDR, + .allowed_opts =3D NVMF_OPT_TRSVCID | NVMF_OPT_RECONNECT_DELAY | + NVMF_OPT_HOST_TRADDR | NVMF_OPT_CTRL_LOSS_TMO | + NVMF_OPT_HDR_DIGEST | NVMF_OPT_DATA_DIGEST | + NVMF_OPT_NR_WRITE_QUEUES | NVMF_OPT_NR_POLL_QUEUES | + NVMF_OPT_TOS | NVMF_OPT_HOST_IFACE, + .create_ctrl =3D nvme_tcp_create_ctrl, +}; +#endif + static int __init nvme_tcp_init_module(void) { unsigned int wq_flags =3D WQ_MEM_RECLAIM | WQ_HIGHPRI | WQ_SYSFS; @@ -3085,6 +3099,9 @@ static int __init nvme_tcp_init_module(void) atomic_set(&nvme_tcp_cpu_queues[cpu], 0); =20 nvmf_register_transport(&nvme_tcp_transport); +#ifdef CONFIG_MPTCP + nvmf_register_transport(&nvme_mptcp_transport); +#endif return 0; } =20 @@ -3092,6 +3109,9 @@ static void __exit nvme_tcp_cleanup_module(void) { struct nvme_tcp_ctrl *ctrl; =20 +#ifdef CONFIG_MPTCP + nvmf_unregister_transport(&nvme_mptcp_transport); +#endif nvmf_unregister_transport(&nvme_tcp_transport); =20 mutex_lock(&nvme_tcp_ctrl_mutex); @@ -3108,3 +3128,4 @@ module_exit(nvme_tcp_cleanup_module); =20 MODULE_DESCRIPTION("NVMe host TCP transport driver"); MODULE_LICENSE("GPL v2"); +MODULE_ALIAS("nvme-mptcp"); --=20 2.51.0