diff options
| author | Stefan Metzmacher <metze@samba.org> | 2025-08-14 11:41:59 +0200 |
|---|---|---|
| committer | Steve French <stfrench@microsoft.com> | 2025-09-28 18:29:47 -0500 |
| commit | 90255ed46774bda93a945a6dbf9228d9ecfcd79f (patch) | |
| tree | 732c887522309d7baab40bf5b21d4b5e78c9ae2f | |
| parent | smb: smbdirect: introduce struct smbdirect_send_batch (diff) | |
| download | linux-90255ed46774bda93a945a6dbf9228d9ecfcd79f.tar.gz linux-90255ed46774bda93a945a6dbf9228d9ecfcd79f.zip | |
smb: smbdirect: introduce smbdirect_socket.rw_io.credits
This will be used by the server to manage the state
for RDMA read/write requests.
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.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/fs/smb/common/smbdirect/smbdirect_socket.h b/fs/smb/common/smbdirect/smbdirect_socket.h index e1454ccf849b..148e8dbf1254 100644 --- a/fs/smb/common/smbdirect/smbdirect_socket.h +++ b/fs/smb/common/smbdirect/smbdirect_socket.h @@ -159,6 +159,27 @@ struct smbdirect_socket { bool full_packet_received; } reassembly; } recv_io; + + /* + * The state for RDMA read/write requests on the server + */ + struct { + /* + * The credit state for the send side + */ + struct { + /* + * The maximum number of rw credits + */ + size_t max; + /* + * The number of pages per credit + */ + size_t num_pages; + atomic_t count; + wait_queue_head_t wait_queue; + } credits; + } rw_io; }; static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc) @@ -184,6 +205,9 @@ static __always_inline void smbdirect_socket_init(struct smbdirect_socket *sc) 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); + + atomic_set(&sc->rw_io.credits.count, 0); + init_waitqueue_head(&sc->rw_io.credits.wait_queue); } struct smbdirect_send_io { |
