summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2025-10-17 15:49:50 +0200
committerSteve French <stfrench@microsoft.com>2026-04-15 21:58:19 -0500
commit4908d19640f4e7834acf26a7de2b78b1c1880829 (patch)
tree1482cc804b178745e7739364cff3346b4437ef7b
parent3514195010828078173dd0608ba04340b718892f (diff)
downloadlwn-4908d19640f4e7834acf26a7de2b78b1c1880829.tar.gz
lwn-4908d19640f4e7834acf26a7de2b78b1c1880829.zip
smb: smbdirect: introduce smbdirect_connection_request_keep_alive()
This a copy of manage_keep_alive_before_sending() in client and server, it will replace these in future. 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>
-rw-r--r--fs/smb/common/smbdirect/smbdirect_connection.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/fs/smb/common/smbdirect/smbdirect_connection.c b/fs/smb/common/smbdirect/smbdirect_connection.c
index 40d830c58f19..45a7ff9b7354 100644
--- a/fs/smb/common/smbdirect/smbdirect_connection.c
+++ b/fs/smb/common/smbdirect/smbdirect_connection.c
@@ -727,6 +727,25 @@ static u16 smbdirect_connection_grant_recv_credits(struct smbdirect_socket *sc)
}
__maybe_unused /* this is temporary while this file is included in others */
+static bool smbdirect_connection_request_keep_alive(struct smbdirect_socket *sc)
+{
+ const struct smbdirect_socket_parameters *sp = &sc->parameters;
+
+ if (sc->idle.keepalive == SMBDIRECT_KEEPALIVE_PENDING) {
+ sc->idle.keepalive = SMBDIRECT_KEEPALIVE_SENT;
+ /*
+ * Now use the keepalive timeout (instead of keepalive interval)
+ * in order to wait for a response
+ */
+ mod_delayed_work(sc->workqueue, &sc->idle.timer_work,
+ msecs_to_jiffies(sp->keepalive_timeout_msec));
+ return true;
+ }
+
+ return false;
+}
+
+__maybe_unused /* this is temporary while this file is included in others */
static void smbdirect_connection_send_io_done(struct ib_cq *cq, struct ib_wc *wc)
{
struct smbdirect_send_io *msg =