smb: smbdirect: introduce smbdirect_connection_send_immediate_work()

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>
This commit is contained in:
Stefan Metzmacher 2025-10-17 22:10:50 +02:00 committed by Steve French
parent 54abc694eb
commit db3092ed2f

View File

@ -1302,6 +1302,28 @@ static void smbdirect_connection_send_io_done(struct ib_cq *cq, struct ib_wc *wc
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)
{