summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2025-08-11 15:57:04 +0200
committerSteve French <stfrench@microsoft.com>2025-09-28 18:29:47 -0500
commitec76e3cc6bbcb17815a4bfa6450d4bae1e708c9b (patch)
tree6d9021d701892ca66a0df8eeec7287856e50e898
parentb5a4242fb902f3780ef85d4027ba5987b7ce1e2d (diff)
downloadlinux-ec76e3cc6bbcb17815a4bfa6450d4bae1e708c9b.tar.gz
linux-ec76e3cc6bbcb17815a4bfa6450d4bae1e708c9b.zip
smb: smbdirect: introduce smbdirect_socket.recv_io.{posted,credits}
This will be used by client and server soon in order to maintain the state of posted recv_io messages and granted credits. Cc: Steve French <smfrench@gmail.com> Cc: Tom Talpey <tom@talpey.com> Cc: Long Li <longli@microsoft.com> Acked-by: 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> Signed-off-by: Steve French <stfrench@microsoft.com>
-rw-r--r--fs/smb/common/smbdirect/smbdirect_socket.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/fs/smb/common/smbdirect/smbdirect_socket.h b/fs/smb/common/smbdirect/smbdirect_socket.h
index d7f3b25c022d..1abfcd230f9a 100644
--- a/fs/smb/common/smbdirect/smbdirect_socket.h
+++ b/fs/smb/common/smbdirect/smbdirect_socket.h
@@ -136,6 +136,23 @@ struct smbdirect_socket {
} free;
/*
+ * The state for posted recv_io messages
+ * and the refill work struct.
+ */
+ struct {
+ atomic_t count;
+ struct work_struct refill_work;
+ } posted;
+
+ /*
+ * The credit state for the recv side
+ */
+ struct {
+ u16 target;
+ atomic_t count;
+ } credits;
+
+ /*
* The list of arrived non-empty smbdirect_recv_io
* structures
*
@@ -204,6 +221,10 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc)
INIT_LIST_HEAD(&sc->recv_io.free.list);
spin_lock_init(&sc->recv_io.free.lock);
+ atomic_set(&sc->recv_io.posted.count, 0);
+
+ atomic_set(&sc->recv_io.credits.count, 0);
+
INIT_LIST_HEAD(&sc->recv_io.reassembly.list);
spin_lock_init(&sc->recv_io.reassembly.lock);
init_waitqueue_head(&sc->recv_io.reassembly.wait_queue);