Stefan Metzmacher
ab83128e65
smb: server: pass struct smbdirect_socket to post_sendmsg()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:54 -05:00
Stefan Metzmacher
0a715db380
smb: server: pass struct smbdirect_socket to smb_direct_create_header()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:54 -05:00
Stefan Metzmacher
4d1dffe0a0
smb: server: pass struct smbdirect_socket to manage_keep_alive_before_sending()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:54 -05:00
Stefan Metzmacher
663b3c3c86
smb: server: pass struct smbdirect_socket to manage_credits_prior_sending()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:54 -05:00
Stefan Metzmacher
b156d2c559
smb: server: pass struct smbdirect_socket to calc_rw_credits()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:54 -05:00
Stefan Metzmacher
cae2d9a229
smb: server: pass struct smbdirect_socket to wait_for_rw_credits()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:54 -05:00
Stefan Metzmacher
2dc6c7e8ba
smb: server: pass struct smbdirect_socket to wait_for_send_credits()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
7f4805b7db
smb: server: pass struct smbdirect_socket to wait_for_credits()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
d14910bbf6
smb: server: pass struct smbdirect_socket to smb_direct_flush_send_list()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
ecb56dbc93
smb: server: pass struct smbdirect_socket to smb_direct_post_send()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
56b442a248
smb: server: remove unused struct struct smb_direct_transport argument from smb_direct_send_ctx_init()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
789cfc2ffa
smb: server: pass struct smbdirect_socket to smb_direct_{alloc,free}_sendmsg()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
100aec545a
smb: server: pass struct smbdirect_socket to smb_direct_connect()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
7cb0ab73f8
smb: server: pass struct smbdirect_socket to smb_direct_prepare_negotiation()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
56bcc18d24
smb: server: pass struct smbdirect_socket to smb_direct_accept_client()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
9221b12b35
smb: server: pass struct smbdirect_socket to smb_direct_post_recv()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
cf78939647
smb: server: pass struct smbdirect_socket to smb_direct_create_qpair()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
f75c226db0
smb: server: pass struct smbdirect_socket to smb_direct_qpair_handler()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
56227a7aa5
smb: server: pass struct smbdirect_socket to smb_direct_cm_handler()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
ece37ea815
smb: server: pass struct smbdirect_socket to smb_direct_disconnect_rdma_connection()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
a25075f112
smb: server: pass struct smbdirect_socket to smb_direct_init_params()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
57131bf9e8
smb: server: pass struct smbdirect_socket to smb_direct_get_max_fr_pages()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
ce85071d2c
smb: server: pass struct smbdirect_socket to smb_direct_{create,destroy}_pools()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
01721df4e3
smb: server: pass struct smbdirect_socket to {get_free,put}_recvmsg()
...
This will make it easier to move function to the common code
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
da7d45b9a3
smb: server: make use of smbdirect_socket.workqueue
...
We still use the single global workqueue, but this
will allow us to share common code soon.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
8ad3a97eab
smb: server: implement correct keepalive and timeout handling for smbdirect
...
Now client and server behave in the same way and we can start to
share common functions.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
b8c7776583
smb: server: make use of smbdirect_socket.idle.immediate_work
...
With this commit the server only uses struct smbdirect_socket!
It doesn't use the idle timer yet, but it will be added soon,
from there we'll be ready split common functions.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
d0b9b967b3
smb: server: make use of smbdirect_socket.rdma.legacy_iwarp
...
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:53 -05:00
Stefan Metzmacher
49635103e8
smb: server: make use of smbdirect_socket_parameters.{initiator_depth,responder_resources}
...
This will make it easier to specify these from the outside of the core
code first and then negotiate the value with the peer.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
be3c1d032f
smb: server: make use of smbdirect_socket_parameters.negotiate_timeout_msec and change to 5s
...
The server negotiations timer is just 5 seconds in Windows, so use the
same. See [MS-SMBD] 3.1.7.2 Connection Arrival.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
d70e458239
smb: server: fill smbdirect_socket_parameters at the beginning and use the values from there
...
This is what we should do and it also simplifies the following changes.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
03a38d8467
smb: server: pass ksmbd_transport to get_smbd_max_read_write_size()
...
We should use the per connection value.
And for TCP return NT_STATUS_INVALID_PARAMETER if any
SMB2_CHANNEL_RDMA_V1* is used.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
341b6c69b9
smb: server: remove useless casts from KSMBD_TRANS/SMBD_TRANS
...
At best they gain nothing, at worst we procude real bugs.
Note container_of() already casts to a pointer of the
given type.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
4d2e333dab
smb: server: replace smb_trans_direct_transfort() with SMBD_TRANS()
...
The spelling of smb_trans_direct_transfort was wrong anyway
and we don't need the logic twice.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
e8bc71986c
smb: server: make use of smbdirect_socket.recv_io.{posted,credits}
...
This will make it possible to introduce common helper functions
in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
89b021a726
smb: server: manage recv credits by counting posted recv_io and granted credits
...
(At least for me) the logic maintaining the count of posted
recv_io messages and the count of granted credits is much
easier to understand.
From there we can easily calculate the number of new_credits we'll
grant to the peer in outgoing send_io messages.
This will simplify the move to common logic that can be
shared between client and server in the following patches.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
113ed9d56f
smb: server: take the recv_credit_target from the negotiate req and always limit the range
...
The clients sends the initial recv_credit_target in the negotiate req,
so we should use that.
We also limit the range between 1 and our local defined
sp->recv_credit_max. This will simplify further logic changes.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
780ccb0fb6
smb: server: make use of struct smbdirect_rw_io
...
This will allow us to create functions in the common
smbdirect code to be used by the server in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
95475d8886
smb: server: make use smbdirect_socket.rw_io.credits
...
This will allow to us to have functions moved into
common code in future (even if it's only used by the server).
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
73430a6446
smb: server: make use of struct smbdirect_send_batch
...
This makes it easier to move functions to the common
smbdirect code in future.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
2def28338a
smb: server: make use of smbdirect_socket.send_io.credits.{count,wait_queue}
...
This will is used by the client already and will allow to create
common helper functions.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
fd0ad9c521
smb: server: make use of smbdirect_socket.send_io.pending.{count,zero_wait_queue}
...
This will is used by the client already and will allow to create
common helper functions.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
bb12617ecb
smb: server: make use of smbdirect_socket.disconnect_work
...
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
16ba90e52b
smb: server: make use of smbdirect_socket_init()
...
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
b4d56ced9e
smb: server: don't wait for info->send_pending == 0 on error
...
Instead we just wake up the waiters and let them return -ENOTCONN.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
b31606097d
smb: server: move smb_direct_disconnect_rdma_work() into free_transport()
...
The logic is also needed when smb_direct_handle_connect_request()
calls free_transport(), because rdma_accept() and RDMA_CM_EVENT_ESTABLISHED
could already be reached.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
e2d5e516c6
smb: server: only turn into SMBDIRECT_SOCKET_CONNECTED when negotiation is done
...
From SMBDIRECT_SOCKET_CREATED we now go via the following
stages:
1. SMBDIRECT_SOCKET_RDMA_CONNECT_NEEDED
This indicated rdma_accept needs to be called
2. SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING
This waits for RDMA_CM_EVENT_ESTABLISHED to
arrive
3. SMBDIRECT_SOCKET_NEGOTIATE_NEEDED
This waits for the negotiate request to
arrive
4. SMBDIRECT_SOCKET_NEGOTIATE_RUNNING
This indicates the negotiate request
arrived and needs to be processed
5. SMBDIRECT_SOCKET_CONNECTED
The connection is ready to use
This avoids the extra 'bool negotiation_requested'
and makes the steps more clear.
In future we may want to add trace points when
changing the states, which would be useful for
debugging.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
c82a53211a
smb: server: make use of smbdirect_socket.status_wait
...
This will allow us to have common helper functions soon.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
a7eef6144c
smb: server: queue post_recv_credits_work in put_recvmsg() and avoid count_avail_recvmsg
...
This is basically what the client is doing in put_receive_buffer().
It means we don't need complicated work to maintain count_avail_recvmsg.
But we keep the logic to queue post_recv_credits_work if the
peer raises the requested credit_target and put_receive_buffer()
is not called.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00
Stefan Metzmacher
d4b86b4909
smb: server: add a pr_info() when the server starts running
...
We already have a message like:
ksmbd: kill command received
when the server stops running.
This makes it easier for debugging in order to match any possible
warnings/errors in dmesg with restarted server.
Cc: Namjae Jeon <linkinjeon@kernel.org >
Cc: Steve French <smfrench@gmail.com >
Cc: Tom Talpey <tom@talpey.com >
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 >
2025-09-28 18:29:52 -05:00