]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
smb: smbdirect: introduce smbdirect_connection_send_immediate_work()
authorStefan Metzmacher <metze@samba.org>
Fri, 17 Oct 2025 20:10:50 +0000 (22:10 +0200)
committerSteve French <stfrench@microsoft.com>
Thu, 16 Apr 2026 02:58:19 +0000 (21:58 -0500)
This is a combination of smb_direct_send_immediate_work() in the server
as well as send_immediate_empty_message() and smbd_post_send_empty() in
the client.

smbdirect_connection_send_immediate_work() replace all of them in
client and server.

Cc: Steve French <smfrench@gmail.com>
Cc: Tom Talpey <tom@talpey.com>
Cc: Long Li <longli@microsoft.com>
Cc: Namjae Jeon <linkinjeon@kernel.org>
Cc: linux-cifs@vger.kernel.org
Cc: samba-technical@lists.samba.org
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/common/smbdirect/smbdirect_connection.c

index bebee5bf072cd18cff7bc91417c8dd50b183ef6d..69b00192cb081d6836c52b1a3a3f4f44ff54d548 100644 (file)
@@ -1302,6 +1302,28 @@ skip_free:
        wake_up(&sc->send_io.pending.dec_wait_queue);
 }
 
+__maybe_unused /* this is temporary while this file is included in others */
+static void smbdirect_connection_send_immediate_work(struct work_struct *work)
+{
+       struct smbdirect_socket *sc =
+               container_of(work, struct smbdirect_socket, idle.immediate_work);
+       int ret;
+
+       if (sc->status != SMBDIRECT_SOCKET_CONNECTED)
+               return;
+
+       smbdirect_log_keep_alive(sc, SMBDIRECT_LOG_INFO,
+               "send an empty message\n");
+       sc->statistics.send_empty++;
+       ret = smbdirect_connection_send_single_iter(sc, NULL, NULL, 0, 0);
+       if (ret < 0) {
+               smbdirect_log_write(sc, SMBDIRECT_LOG_ERR,
+                       "smbdirect_connection_send_single_iter ret=%1pe\n",
+                       SMBDIRECT_DEBUG_ERR_PTR(ret));
+               smbdirect_socket_schedule_cleanup(sc, ret);
+       }
+}
+
 __maybe_unused /* this is temporary while this file is included in others */
 static int smbdirect_connection_post_recv_io(struct smbdirect_recv_io *msg)
 {