Skip to content

smb: smbdirect/client/server: make use of common structures

Stefan Metzmacher linux-cifs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest142 patches 11 repliesIn review
  2. v117 patches 0 repliesSuperseded

Changes in v4 from the cover letter

rebased on v6.17-rc3 and current sfrench-cifs-2.6/for-next A lot of additional patches are added in order to use struct smbdirect_socket almost everywhere.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/142smb: smbdirect: introduce smbdirect_socket.status_waitfs/smb/common/smbdirect/smbdirect_socket.h+1 -00 replies
2/142smb: smbdirect: introduce smbdirect_socket_init()fs/smb/common/smbdirect/smbdirect_socket.h+16 -00 replies
3/142smb: smbdirect: introduce smbdirect_socket.disconnect_workfs/smb/common/smbdirect/smbdirect_socket.h+2 -00 replies
4/142smb: smbdirect: introduce smbdirect_socket.send_io.pending.{count,wait_queue}fs/smb/common/smbdirect/smbdirect_socket.h+11 -01 reply
5/142smb: smbdirect: introduce smbdirect_socket.send_io.credits.{count,wait_queue}fs/smb/common/smbdirect/smbdirect_socket.h+11 -00 replies
6/142smb: smbdirect: introduce struct smbdirect_send_batchfs/smb/common/smbdirect/smbdirect_socket.h+17 -00 replies
7/142smb: smbdirect: introduce smbdirect_socket.rw_io.creditsfs/smb/common/smbdirect/smbdirect_socket.h+24 -00 replies
8/142smb: smbdirect: introduce struct smbdirect_rw_iofs/smb/common/smbdirect/smbdirect_socket.h+16 -00 replies
9/142smb: smbdirect: introduce smbdirect_socket.recv_io.{posted,credits}fs/smb/common/smbdirect/smbdirect_socket.h+21 -00 replies
10/142smb: smbdirect: introduce smbdirect_socket_parameters.{resolve_{addr,route},rdma_connect,negotiate}_timeout_msecfs/smb/common/smbdirect/smbdirect.h+4 -00 replies
11/142smb: smbdirect: introduce smbdirect_socket_parameters.{initiator_depth,responder_resources}fs/smb/common/smbdirect/smbdirect.h+2 -00 replies
12/142smb: smbdirect: introduce smbdirect_socket.rdma.legacy_iwarpfs/smb/common/smbdirect/smbdirect_socket.h+4 -00 replies
13/142smb: smbdirect: introduce smbdirect_socket.idle.{keepalive,immediate_work,timer_work}fs/smb/common/smbdirect/smbdirect_socket.h+15 -00 replies
14/142smb: smbdirect: introduce smbdirect_socket.statisticsfs/smb/common/smbdirect/smbdirect_socket.h+11 -00 replies
15/142smb: smbdirect: introduce smbdirect_socket.workqueuefs/smb/common/smbdirect/smbdirect_socket.h+8 -00 replies
16/142smb: smbdirect: introduce struct smbdirect_mr_iofs/smb/common/smbdirect/smbdirect_socket.h+26 -00 replies
17/142smb: smbdirect: introduce smbdirect_socket_parameters.max_frmr_depthfs/smb/common/smbdirect/smbdirect.h+1 -00 replies
18/142smb: smbdirect: introduce smbdirect_socket.mr_io.*fs/smb/common/smbdirect/smbdirect_socket.h+45 -00 replies
19/142smb: client/smbdirect: replace SMBDIRECT_SOCKET_CONNECTING with more detailed statesfs/smb/client/smbdirect.c fs/smb/common/smbdirect/smbdirect_socket.h+79 -80 replies
20/142smb: client: use status_wait and SMBDIRECT_SOCKET_NEGOTIATE_RUNNING for completionfs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+10 -120 replies
21/142smb: client: use status_wait and SMBDIRECT_SOCKET_RESOLVE_{ADDR,ROUTE}_RUNNING for completionfs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+28 -230 replies
22/142smb: client: make use of smbdirect_socket.status_waitfs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+16 -180 replies
23/142smb: client: make only use of wake_up[_all]() in smbdirect.cfs/smb/client/smbdirect.c+21 -190 replies
24/142smb: client: make use of smbdirect_socket_init()fs/smb/client/smbdirect.c+1 -120 replies
25/142smb: client: make use of smbdirect_socket.disconnect_workfs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+7 -60 replies
26/142smb: client: make use of smbdirect_socket.send_io.pending.{count,wait_queue}fs/smb/client/cifs_debug.c fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+12 -171 reply
27/142smb: client: make use of smbdirect_socket.send_io.credits.{count,wait_queue}fs/smb/client/cifs_debug.c fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+10 -140 replies
28/142smb: client: make sure smbd_disconnect_rdma_work() doesn't run after smbd_destroy() took overfs/smb/client/smbdirect.c+19 -20 replies
29/142smb: client: use disable[_delayed]_work_sync in smbdirect.cfs/smb/client/smbdirect.c+3 -30 replies
30/142smb: client: let smbd_destroy() call disable_work_sync(&info->post_send_credits_work)fs/smb/client/smbdirect.c+3 -00 replies
31/142smb: client: queue post_recv_credits_work also if the peer raises the credit targetfs/smb/client/smbdirect.c+5 -00 replies
32/142smb: client: make use of ib_wc_status_msg() and skip IB_WC_WR_FLUSH_ERR loggingfs/smb/client/smbdirect.c+12 -80 replies
33/142smb: client: remove info->wait_receive_queues handling in smbd_destroy()fs/smb/client/cifs_debug.c fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+0 -190 replies
34/142smb: client: limit the range of info->receive_credit_targetfs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+8 -20 replies
35/142smb: client: count the number of posted recv_io messages in order to calculated creditsfs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+15 -190 replies
36/142smb: client: make use of smbdirect_socket.recv_io.{posted,credits}fs/smb/client/cifs_debug.c fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+33 -400 replies
37/142smb: client: remove useless smbd_connection.send_immediatefs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+2 -100 replies
38/142smb: client: fill smbdirect_socket_parameters at the beginning and use the values from therefs/smb/client/smbdirect.c+13 -130 replies
39/142smb: client: make use of smbdirect_socket_parameters.{resolve_{addr,route},rdma_connect,negotiate}_timeout_msecfs/smb/client/smbdirect.c+16 -60 replies
40/142smb: client: make use of smbdirect_socket_parameters.{initiator_depth,responder_resources}fs/smb/client/cifs_debug.c fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+16 -170 replies
41/142smb: client: make use of smbdirect_socket.rdma.legacy_iwarpfs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+1 -30 replies
42/142smb: client: send empty packets via send_immediate_workfs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+22 -40 replies
43/142smb: client: fix smbdirect keep alive handling to match the documentationfs/smb/client/smbdirect.c+38 -140 replies
44/142smb: client: make use of smbdirect_socket.idle.{keepalive,immediate_work,timer_work}fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+30 -380 replies
45/142smb: client: remove unused smbd_connection->protocolfs/smb/client/cifs_debug.c fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+3 -50 replies
46/142smb: client: remove unused smbd_connection.count_reassembly_queuefs/smb/client/cifs_debug.c fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+1 -50 replies
47/142smb: client: make use of smbdirect_socket.statisticsfs/smb/client/cifs_debug.c fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+15 -210 replies
48/142smb: client: don't check sc->send_io.pending.count is below sp->send_credit_targetfs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+4 -271 reply
49/142smb: client: move rdma_readwrite_threshold from smbd_connection to TCP_Server_Infofs/smb/client/cifs_debug.c fs/smb/client/cifsglob.h fs/smb/client/smb2pdu.c +2 more+20 -130 replies
50/142smb: client: make use of smbdirect_socket.workqueuefs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+16 -180 replies
51/142smb: client: add and use smbd_get_parameters()fs/smb/client/smb2ops.c fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+13 -40 replies
52/142smb: client: make use of struct smbdirect_mr_iofs/smb/client/cifsglob.h fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+37 -580 replies
53/142smb: client: make use of smbdirect_socket_parameters.max_frmr_depthfs/smb/client/cifs_debug.c fs/smb/client/file.c fs/smb/client/smbdirect.c +1 more+31 -230 replies
54/142smb: client: make use of smbdirect_socket.mr_iofs/smb/client/cifs_debug.c fs/smb/client/smbdirect.c fs/smb/client/smbdirect.h+40 -600 replies
55/142smb: client: pass struct smbdirect_socket to {get,put}_receive_buffer()fs/smb/client/smbdirect.c+13 -150 replies
56/142smb: client: pass struct smbdirect_socket to {allocate,destroy}_receive_buffers()fs/smb/client/smbdirect.c+7 -90 replies
57/142smb: client: pass struct smbdirect_socket to {allocate,destroy}_caches_and_workqueue()fs/smb/client/smbdirect.c+7 -100 replies
58/142smb: client: pass struct smbdirect_socket to {enqueue,_get_first}_reassembly()fs/smb/client/smbdirect.c+7 -100 replies
59/142smb: client: pass struct smbdirect_socket to {allocate,destroy}_mr_list()fs/smb/client/smbdirect.c+6 -80 replies
60/142smb: client: pass struct smbdirect_socket to smbd_disconnect_rdma_connection()fs/smb/client/smbdirect.c+14 -270 replies
61/142smb: client: pass struct smbdirect_socket to smbd_post_recv()fs/smb/client/smbdirect.c+4 -70 replies
62/142smb: client: pass struct smbdirect_socket to manage_credits_prior_sending()fs/smb/client/smbdirect.c+2 -30 replies
63/142smb: client: pass struct smbdirect_socket to smbd_post_send()fs/smb/client/smbdirect.c+2 -30 replies
64/142smb: client: pass struct smbdirect_socket to manage_keep_alive_before_sending()fs/smb/client/smbdirect.c+2 -30 replies
65/142smb: client: pass struct smbdirect_socket to smbd_post_send_iter()fs/smb/client/smbdirect.c+4 -40 replies
66/142smb: client: pass struct smbdirect_socket to smbd_post_send_empty()fs/smb/client/smbdirect.c+3 -60 replies
67/142smb: client: pass struct smbdirect_socket to smbd_post_send_full_iter()fs/smb/client/smbdirect.c+3 -40 replies
68/142smb: client: pass struct smbdirect_socket to smbd_conn_upcall()fs/smb/client/smbdirect.c+2 -30 replies
69/142smb: client: pass struct smbdirect_socket to smbd_qp_async_error_upcall()fs/smb/client/smbdirect.c+6 -70 replies
70/142smb: client: pass struct smbdirect_socket to smbd_create_id()fs/smb/client/smbdirect.c+2 -30 replies
71/142smb: client: pass struct smbdirect_socket to smbd_ia_open()fs/smb/client/smbdirect.c+2 -30 replies
72/142smb: client: pass struct smbdirect_socket to smbd_post_send_negotiate_req()fs/smb/client/smbdirect.c+2 -30 replies
73/142smb: client: pass struct smbdirect_socket to smbd_negotiate()fs/smb/client/smbdirect.c+2 -30 replies
74/142smb: client: pass struct smbdirect_socket to get_mr()fs/smb/client/smbdirect.c+2 -30 replies
75/142smb: client: remove unused struct smbdirect_socket argument of smbd_iter_to_mr()fs/smb/client/smbdirect.c+2 -30 replies
76/142smb: server: make use of common smbdirect_pdu.hfs/smb/server/transport_rdma.c fs/smb/server/transport_rdma.h+25 -650 replies
77/142smb: server: make use of common smbdirect.hfs/smb/server/connection.c fs/smb/server/connection.h fs/smb/server/smb2pdu.c +2 more+18 -200 replies
78/142smb: server: make use of common smbdirect_socketfs/smb/server/transport_rdma.c+133 -1080 replies
79/142smb: server: make use of common smbdirect_socket_parametersfs/smb/server/transport_rdma.c+44 -410 replies
80/142smb: server: make use of smbdirect_socket->recv_io.expectedfs/smb/server/transport_rdma.c+25 -190 replies
81/142smb: server: make use of struct smbdirect_recv_iofs/smb/server/transport_rdma.c+26 -350 replies
82/142smb: server: make use of smbdirect_socket.recv_io.free.{list,lock}fs/smb/server/transport_rdma.c+12 -150 replies
83/142smb: server: make use of smbdirect_socket.recv_io.reassembly.*fs/smb/server/transport_rdma.c+43 -470 replies
84/142smb: server: make use of SMBDIRECT_RECV_IO_MAX_SGEfs/smb/server/transport_rdma.c+2 -30 replies
85/142smb: server: make use of struct smbdirect_send_iofs/smb/server/transport_rdma.c+36 -450 replies
86/142smb: server: make use of smbdirect_socket.{send,recv}_io.mem.{cache,pool}fs/smb/server/transport_rdma.c+23 -270 replies
87/142smb: server: make only use of wake_up[_all]() in transport_rdma.cfs/smb/server/transport_rdma.c+9 -90 replies
88/142smb: server: add a pr_info() when the server starts runningfs/smb/server/server.c+1 -00 replies
89/142smb: server: don't use delayed_work for post_recv_credits_workfs/smb/server/transport_rdma.c+8 -100 replies
90/142smb: server: queue post_recv_credits_work in put_recvmsg() and avoid count_avail_recvmsgfs/smb/server/transport_rdma.c+11 -340 replies
91/142smb: server: make use of smbdirect_socket.status_waitfs/smb/server/transport_rdma.c+7 -90 replies
92/142smb: server: only turn into SMBDIRECT_SOCKET_CONNECTED when negotiation is donefs/smb/server/transport_rdma.c+68 -150 replies
93/142smb: server: use disable_work_sync in transport_rdma.cfs/smb/server/transport_rdma.c+3 -30 replies
94/142smb: server: move smb_direct_disconnect_rdma_work() into free_transport()fs/smb/server/transport_rdma.c+7 -40 replies
95/142smb: server: don't wait for info->send_pending == 0 on errorfs/smb/server/transport_rdma.c+11 -60 replies
96/142smb: server: make use of smbdirect_socket_init()fs/smb/server/transport_rdma.c+1 -110 replies
97/142smb: server: make use of smbdirect_socket.disconnect_workfs/smb/server/transport_rdma.c+12 -100 replies
98/142smb: server: make use of smbdirect_socket.send_io.pending.{count,wait_queue}fs/smb/server/transport_rdma.c+10 -161 reply
99/142smb: server: make use of smbdirect_socket.send_io.credits.{count,wait_queue}fs/smb/server/transport_rdma.c+13 -150 replies
100/142smb: server: make use of struct smbdirect_send_batchfs/smb/server/transport_rdma.c+7 -140 replies
101/142smb: server: make use smbdirect_socket.rw_io.creditsfs/smb/server/transport_rdma.c+22 -220 replies
102/142smb: server: make use of struct smbdirect_rw_iofs/smb/server/transport_rdma.c+14 -230 replies
103/142smb: server: take the recv_credit_target from the negotiate req and always limit the rangefs/smb/server/transport_rdma.c+12 -30 replies
104/142smb: server: manage recv credits by counting posted recv_io and granted creditsfs/smb/server/transport_rdma.c+21 -320 replies
105/142smb: server: make use of smbdirect_socket.recv_io.{posted,credits}fs/smb/server/transport_rdma.c+30 -350 replies
106/142smb: server: replace smb_trans_direct_transfort() with SMBD_TRANS()fs/smb/server/transport_rdma.c+7 -130 replies
107/142smb: server: remove useless casts from KSMBD_TRANS/SMBD_TRANSfs/smb/server/transport_rdma.c+2 -20 replies
108/142smb: server: pass ksmbd_transport to get_smbd_max_read_write_size()fs/smb/server/smb2pdu.c fs/smb/server/transport_rdma.c fs/smb/server/transport_rdma.h+25 -60 replies
109/142smb: server: fill smbdirect_socket_parameters at the beginning and use the values from therefs/smb/server/transport_rdma.c+15 -140 replies
110/142smb: server: make use of smbdirect_socket_parameters.negotiate_timeout_msec and change to 5sfs/smb/server/transport_rdma.c+4 -30 replies
111/142smb: server: make use of smbdirect_socket_parameters.{initiator_depth,responder_resources}fs/smb/server/transport_rdma.c+14 -120 replies
112/142smb: server: make use of smbdirect_socket.rdma.legacy_iwarpfs/smb/server/transport_rdma.c+2 -40 replies
113/142smb: server: make use of smbdirect_socket.idle.immediate_workfs/smb/server/transport_rdma.c+9 -120 replies
114/142smb: server: implement correct keepalive and timeout handling for smbdirectfs/smb/server/transport_rdma.c+74 -00 replies
115/142smb: server: make use of smbdirect_socket.workqueuefs/smb/server/transport_rdma.c+12 -100 replies
116/142smb: server: pass struct smbdirect_socket to {get_free,put}_recvmsg()fs/smb/server/transport_rdma.c+16 -190 replies
117/142smb: server: pass struct smbdirect_socket to smb_direct_{create,destroy}_pools()fs/smb/server/transport_rdma.c+9 -100 replies
118/142smb: server: pass struct smbdirect_socket to smb_direct_get_max_fr_pages()fs/smb/server/transport_rdma.c+2 -40 replies
119/142smb: server: pass struct smbdirect_socket to smb_direct_init_params()fs/smb/server/transport_rdma.c+2 -30 replies
120/142smb: server: pass struct smbdirect_socket to smb_direct_disconnect_rdma_connection()fs/smb/server/transport_rdma.c+12 -180 replies
121/142smb: server: pass struct smbdirect_socket to smb_direct_cm_handler()fs/smb/server/transport_rdma.c+2 -30 replies
122/142smb: server: pass struct smbdirect_socket to smb_direct_qpair_handler()fs/smb/server/transport_rdma.c+4 -50 replies
123/142smb: server: pass struct smbdirect_socket to smb_direct_create_qpair()fs/smb/server/transport_rdma.c+2 -30 replies
124/142smb: server: pass struct smbdirect_socket to smb_direct_post_recv()fs/smb/server/transport_rdma.c+3 -60 replies
125/142smb: server: pass struct smbdirect_socket to smb_direct_accept_client()fs/smb/server/transport_rdma.c+2 -30 replies
126/142smb: server: pass struct smbdirect_socket to smb_direct_prepare_negotiation()fs/smb/server/transport_rdma.c+3 -40 replies
127/142smb: server: pass struct smbdirect_socket to smb_direct_connect()fs/smb/server/transport_rdma.c+3 -40 replies
128/142smb: server: pass struct smbdirect_socket to smb_direct_{alloc,free}_sendmsg()fs/smb/server/transport_rdma.c+11 -150 replies
129/142smb: server: remove unused struct struct smb_direct_transport argument from smb_direct_send_ctx_init()fs/smb/server/transport_rdma.c+3 -40 replies
130/142smb: server: pass struct smbdirect_socket to smb_direct_post_send()fs/smb/server/transport_rdma.c+3 -40 replies
131/142smb: server: pass struct smbdirect_socket to smb_direct_flush_send_list()fs/smb/server/transport_rdma.c+3 -40 replies
132/142smb: server: pass struct smbdirect_socket to wait_for_credits()fs/smb/server/transport_rdma.c+3 -40 replies
133/142smb: server: pass struct smbdirect_socket to wait_for_send_credits()fs/smb/server/transport_rdma.c+2 -30 replies
134/142smb: server: pass struct smbdirect_socket to wait_for_rw_credits()fs/smb/server/transport_rdma.c+2 -40 replies
135/142smb: server: pass struct smbdirect_socket to calc_rw_credits()fs/smb/server/transport_rdma.c+2 -40 replies
136/142smb: server: pass struct smbdirect_socket to manage_credits_prior_sending()fs/smb/server/transport_rdma.c+3 -40 replies
137/142smb: server: pass struct smbdirect_socket to manage_keep_alive_before_sending()fs/smb/server/transport_rdma.c+2 -30 replies
138/142smb: server: pass struct smbdirect_socket to smb_direct_create_header()fs/smb/server/transport_rdma.c+2 -30 replies
139/142smb: server: pass struct smbdirect_socket to post_sendmsg()fs/smb/server/transport_rdma.c+3 -40 replies
140/142smb: server: pass struct smbdirect_socket to smb_direct_post_send_data()fs/smb/server/transport_rdma.c+6 -90 replies
141/142smb: server: pass struct smbdirect_socket to {enqueue,get_first}_reassembly()fs/smb/server/transport_rdma.c+7 -130 replies
142/142smb: server: pass struct smbdirect_socket to smb_direct_send_negotiate_response()fs/smb/server/transport_rdma.c+2 -30 replies

Reviews trailers per patch

11 of 142 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchNamjae Jeon
SeriesA-b
1/142
2/142
3/142
4/142
5/142
6/142
7/142
8/142
9/142
10/142
11/142
12/142
13/142
14/142
15/142
16/142
17/142
18/142
19/142
20/142
21/142
22/142
23/142
24/142
25/142
26/142
27/142
28/142
29/142
30/142
31/142
32/142
33/142
34/142
35/142
36/142
37/142
38/142
39/142
40/142
41/142
42/142
43/142
44/142
45/142
46/142
47/142
48/142
49/142
50/142
51/142
52/142
53/142
54/142
55/142
56/142
57/142
58/142
59/142
60/142
61/142
62/142
63/142
64/142
65/142
66/142
67/142
68/142
69/142
70/142
71/142
72/142
73/142
74/142
75/142
76/142A-b
77/142A-b
78/142A-b
79/142A-b
80/142A-b
81/142A-b
82/142A-b
83/142A-b
84/142A-b
85/142A-b
86/142A-b
87/142
88/142
89/142
90/142
91/142
92/142
93/142
94/142
95/142
96/142
97/142
98/142
99/142
100/142
101/142
102/142
103/142
104/142
105/142
106/142
107/142
108/142
109/142
110/142
111/142
112/142
113/142
114/142
115/142
116/142
117/142
118/142
119/142
120/142
121/142
122/142
123/142
124/142
125/142
126/142
127/142
128/142
129/142
130/142
131/142
132/142
133/142
134/142
135/142
136/142
137/142
138/142
139/142
140/142
141/142
142/142

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 000/142] smb: smbdirect/client/server: make use of common structures

Hi,

this is the next step towards a common smbdirect layer between cifs.ko and ksmbd.ko, with the aim to provide a socket layer for userspace usage at the end of the road.

Note the patchset is based on v6.17-rc3 plus the following
patches from sfrench-cifs-2.6/for-next:
21d14611210d0bdf6b0c6db45c2361e96e6673d4
smb3 client: fix return code mapping of remap_file_range a21e20edf966db8d3e0e0748a9201fbd62fd961a
smb: client: Fix mount deadlock by avoiding super block iteration in DFS reconnect plus the client and server fixes for the IRD/ORD negotiation:
https://lore.kernel.org/linux-cifs/[email protected]/
https://lore.kernel.org/linux-cifs/[email protected]/
But only the IRD/ORD patches are really required in order to
apply the patchset. It can also be found as branch for-6.18/fs-smb-20250825-v4 in https://git.samba.org/metze/linux/wip.git, see
https://git.samba.org/?p=metze/linux/wip.git;a=shortlog;h=refs/heads/for-6.18/fs-smb-20250825-v4

This patchset introduces more common structures and elements to struct smbdirect_socket[_parameters]. (Patches 001-018)

The client side is modified in tiny steps in order to use the new common structures. At the end struct smbd_connection is only a simple container arround struct smbdirect_socket. For now I left
it that way in order to avoid changing the smb layer to use struct smbdirect_socket. In the end I'd like to expose only an anonymous structure to the smb layer and struct smbdirect_socket will become a private structure. (Patches 019-075). In between there are some fixes for the keepalive and timeout handling.

Note that 047 smb: client: make use of smbdirect_socket.statistics generates the following warnings from scripts/checkpatch.pl --quiet
WARNING: quoted string split across lines
#40: FILE: fs/smb/client/cifs_debug.c:464:
+ seq_printf(m, "\nDebug count_get_receive_buffer: %llx "
+ "count_put_receive_buffer: %llx count_send_empty: %llx",

WARNING: quoted string split across lines
#47: FILE: fs/smb/client/cifs_debug.c:469:
seq_printf(m, "\nRead Queue "
+ "count_enqueue_reassembly_queue: %llx "

WARNING: quoted string split across lines
#48: FILE: fs/smb/client/cifs_debug.c:470:
+ "count_enqueue_reassembly_queue: %llx "
+ "count_dequeue_reassembly_queue: %llx "

total: 0 errors, 3 warnings, 83 lines checked
scripts/checkpatch.pl: FAILED

But I left them in in order to keep the strange style like the other code before and after...

The server is also changed in tiny steps in order to make use of the common structures only. Patches 076-142. We only have this left at the end of the patchset:

   struct smb_direct_transport {
        struct ksmbd_transport  transport;
        struct smbdirect_socket socket;

};

The server also got patches to implement keepalive and timeout handling in order to match the client code.

The client patches and server patches are independent from each other, but both need their own IRD/ORD negotiation fix plus the common smbdirect patches.

From here I'll start to split out common functions. In the first step as static __maybe_unused functions in a common smbdirect_connection.c file that will be included in client/smbdirect.c and server/transport_rdma.c. This is strange, but it will allow me to continue in tiny steps until only common code it used.
If it's too strange I can use a smbdirect_connection.h and rename it later from .h to .c

At that point I'll introduce an smbdirect.ko and export some public functions which will replace the include of the .c. Then I can finally start to add the struct socket/sock glue in order to provide smbdirect support to userspace.

I used the following xfstests as regression tests:
cifs/001 generic/001 generic/002 generic/005 generic/006 generic/007 generic/010 generic/011

Between cifs.ko against ksmbd.ko via siw.ko and also the client via siw.ko against Windows 2025 using a Chelsio T520-BT card. I tested the modules once before and after the applied patches and also the combination.

V4:
rebased on v6.17-rc3 and current sfrench-cifs-2.6/for-next A lot of additional patches are added in order to use struct smbdirect_socket almost everywhere.

V3:
smbd_disconnect_rdma_work() needed to handle more than SMBDIRECT_SOCKET_CONNECTED in order to call rdma_disconnect.

V2:
init_waitqueue_head(&info->status_wait); was moved to the beginning so that it is correctly initialized in smbd_create_id().

Stefan Metzmacher (142):
smb: smbdirect: introduce smbdirect_socket.status_wait
smb: smbdirect: introduce smbdirect_socket_init()
smb: smbdirect: introduce smbdirect_socket.disconnect_work
smb: smbdirect: introduce

    smbdirect_socket.send_io.pending.{count,wait_queue}
  smb: smbdirect: introduce
    smbdirect_socket.send_io.credits.{count,wait_queue}
  smb: smbdirect: introduce struct smbdirect_send_batch
  smb: smbdirect: introduce smbdirect_socket.rw_io.credits
  smb: smbdirect: introduce struct smbdirect_rw_io
  smb: smbdirect: introduce smbdirect_socket.recv_io.{posted,credits}
  smb: smbdirect: introduce
    smbdirect_socket_parameters.{resolve_{addr,route},rdma_connect,negotiate}_timeout_msec
  smb: smbdirect: introduce
    smbdirect_socket_parameters.{initiator_depth,responder_resources}
  smb: smbdirect: introduce smbdirect_socket.rdma.legacy_iwarp
  smb: smbdirect: introduce
    smbdirect_socket.idle.{keepalive,immediate_work,timer_work}
  smb: smbdirect: introduce smbdirect_socket.statistics
  smb: smbdirect: introduce smbdirect_socket.workqueue
  smb: smbdirect: introduce struct smbdirect_mr_io
  smb: smbdirect: introduce smbdirect_socket_parameters.max_frmr_depth
  smb: smbdirect: introduce smbdirect_socket.mr_io.*
  smb: client/smbdirect: replace SMBDIRECT_SOCKET_CONNECTING with more
    detailed states
  smb: client: use status_wait and SMBDIRECT_SOCKET_NEGOTIATE_RUNNING
    for completion
  smb: client: use status_wait and
    SMBDIRECT_SOCKET_RESOLVE_{ADDR,ROUTE}_RUNNING for completion
  smb: client: make use of smbdirect_socket.status_wait
  smb: client: make only use of wake_up[_all]() in smbdirect.c
  smb: client: make use of smbdirect_socket_init()
  smb: client: make use of smbdirect_socket.disconnect_work
  smb: client: make use of
    smbdirect_socket.send_io.pending.{count,wait_queue}
  smb: client: make use of
    smbdirect_socket.send_io.credits.{count,wait_queue}
  smb: client: make sure smbd_disconnect_rdma_work() doesn't run after
    smbd_destroy() took over
  smb: client: use disable[_delayed]_work_sync in smbdirect.c
  smb: client: let smbd_destroy() call
    disable_work_sync(&info->post_send_credits_work)
  smb: client: queue post_recv_credits_work also if the peer raises the
    credit target
  smb: client: make use of ib_wc_status_msg() and skip
    IB_WC_WR_FLUSH_ERR logging
  smb: client: remove info->wait_receive_queues handling in
    smbd_destroy()
  smb: client: limit the range of info->receive_credit_target
  smb: client: count the number of posted recv_io messages in order to
    calculated credits
  smb: client: make use of smbdirect_socket.recv_io.{posted,credits}
  smb: client: remove useless smbd_connection.send_immediate
  smb: client: fill smbdirect_socket_parameters at the beginning and use
    the values from there
  smb: client: make use of
    smbdirect_socket_parameters.{resolve_{addr,route},rdma_connect,negotiate}_timeout_msec
  smb: client: make use of
    smbdirect_socket_parameters.{initiator_depth,responder_resources}
  smb: client: make use of smbdirect_socket.rdma.legacy_iwarp
  smb: client: send empty packets via send_immediate_work
  smb: client: fix smbdirect keep alive handling to match the
    documentation
  smb: client: make use of
    smbdirect_socket.idle.{keepalive,immediate_work,timer_work}
  smb: client: remove unused smbd_connection->protocol
  smb: client: remove unused smbd_connection.count_reassembly_queue
  smb: client: make use of smbdirect_socket.statistics
  smb: client: don't check sc->send_io.pending.count is below
    sp->send_credit_target
  smb: client: move rdma_readwrite_threshold from smbd_connection to
    TCP_Server_Info
  smb: client: make use of smbdirect_socket.workqueue
  smb: client: add and use smbd_get_parameters()
  smb: client: make use of struct smbdirect_mr_io
  smb: client: make use of smbdirect_socket_parameters.max_frmr_depth
  smb: client: make use of smbdirect_socket.mr_io
  smb: client: pass struct smbdirect_socket to
    {get,put}_receive_buffer()
  smb: client: pass struct smbdirect_socket to
    {allocate,destroy}_receive_buffers()
  smb: client: pass struct smbdirect_socket to
    {allocate,destroy}_caches_and_workqueue()
  smb: client: pass struct smbdirect_socket to
    {enqueue,_get_first}_reassembly()
  smb: client: pass struct smbdirect_socket to
    {allocate,destroy}_mr_list()
  smb: client: pass struct smbdirect_socket to
    smbd_disconnect_rdma_connection()
  smb: client: pass struct smbdirect_socket to smbd_post_recv()
  smb: client: pass struct smbdirect_socket to
    manage_credits_prior_sending()
  smb: client: pass struct smbdirect_socket to smbd_post_send()
  smb: client: pass struct smbdirect_socket to
    manage_keep_alive_before_sending()
  smb: client: pass struct smbdirect_socket to smbd_post_send_iter()
  smb: client: pass struct smbdirect_socket to smbd_post_send_empty()
  smb: client: pass struct smbdirect_socket to
    smbd_post_send_full_iter()
  smb: client: pass struct smbdirect_socket to smbd_conn_upcall()
  smb: client: pass struct smbdirect_socket to
    smbd_qp_async_error_upcall()
  smb: client: pass struct smbdirect_socket to smbd_create_id()
  smb: client: pass struct smbdirect_socket to smbd_ia_open()
  smb: client: pass struct smbdirect_socket to
    smbd_post_send_negotiate_req()
  smb: client: pass struct smbdirect_socket to smbd_negotiate()
  smb: client: pass struct smbdirect_socket to get_mr()
  smb: client: remove unused struct smbdirect_socket argument of
    smbd_iter_to_mr()
  smb: server: make use of common smbdirect_pdu.h
  smb: server: make use of common smbdirect.h
  smb: server: make use of common smbdirect_socket
  smb: server: make use of common smbdirect_socket_parameters
  smb: server: make use of smbdirect_socket->recv_io.expected
  smb: server: make use of struct smbdirect_recv_io
  smb: server: make use of smbdirect_socket.recv_io.free.{list,lock}
  smb: server: make use of smbdirect_socket.recv_io.reassembly.*
  smb: server: make use of SMBDIRECT_RECV_IO_MAX_SGE
  smb: server: make use of struct smbdirect_send_io
  smb: server: make use of
    smbdirect_socket.{send,recv}_io.mem.{cache,pool}
  smb: server: make only use of wake_up[_all]() in transport_rdma.c
  smb: server: add a pr_info() when the server starts running
  smb: server: don't use delayed_work for post_recv_credits_work
  smb: server: queue post_recv_credits_work in put_recvmsg() and avoid
    count_avail_recvmsg
  smb: server: make use of smbdirect_socket.status_wait
  smb: server: only turn into SMBDIRECT_SOCKET_CONNECTED when
    negotiation is done
  smb: server: use disable_work_sync in transport_rdma.c
  smb: server: move smb_direct_disconnect_rdma_work() into
    free_transport()
  smb: server: don't wait for info->send_pending == 0 on error
  smb: server: make use of smbdirect_socket_init()
  smb: server: make use of smbdirect_socket.disconnect_work
  smb: server: make use of
    smbdirect_socket.send_io.pending.{count,wait_queue}
  smb: server: make use of
    smbdirect_socket.send_io.credits.{count,wait_queue}
  smb: server: make use of struct smbdirect_send_batch
  smb: server: make use smbdirect_socket.rw_io.credits
  smb: server: make use of struct smbdirect_rw_io
  smb: server: take the recv_credit_target from the negotiate req and
    always limit the range
  smb: server: manage recv credits by counting posted recv_io and
    granted credits
  smb: server: make use of smbdirect_socket.recv_io.{posted,credits}
  smb: server: replace smb_trans_direct_transfort() with SMBD_TRANS()
  smb: server: remove useless casts from KSMBD_TRANS/SMBD_TRANS
  smb: server: pass ksmbd_transport to get_smbd_max_read_write_size()
  smb: server: fill smbdirect_socket_parameters at the beginning and use
    the values from there
  smb: server: make use of
    smbdirect_socket_parameters.negotiate_timeout_msec and change to 5s
  smb: server: make use of
    smbdirect_socket_parameters.{initiator_depth,responder_resources}

smb: server: make use of smbdirect_socket.rdma.legacy_iwarp
smb: server: make use of smbdirect_socket.idle.immediate_work
smb: server: implement correct keepalive and timeout handling for
smbdirect
smb: server: make use of smbdirect_socket.workqueue
smb: server: pass struct smbdirect_socket to {get_free,put}_recvmsg()
smb: server: pass struct smbdirect_socket to
smb_direct_{create,destroy}_pools()
smb: server: pass struct smbdirect_socket to
smb_direct_get_max_fr_pages()
smb: server: pass struct smbdirect_socket to smb_direct_init_params()
smb: server: pass struct smbdirect_socket to
smb_direct_disconnect_rdma_connection()
smb: server: pass struct smbdirect_socket to smb_direct_cm_handler()
smb: server: pass struct smbdirect_socket to
smb_direct_qpair_handler()
smb: server: pass struct smbdirect_socket to smb_direct_create_qpair()
smb: server: pass struct smbdirect_socket to smb_direct_post_recv()
smb: server: pass struct smbdirect_socket to
smb_direct_accept_client()
smb: server: pass struct smbdirect_socket to
smb_direct_prepare_negotiation()
smb: server: pass struct smbdirect_socket to smb_direct_connect()
smb: server: pass struct smbdirect_socket to
smb_direct_{alloc,free}_sendmsg()
smb: server: remove unused struct struct smb_direct_transport argument
from smb_direct_send_ctx_init()
smb: server: pass struct smbdirect_socket to smb_direct_post_send()
smb: server: pass struct smbdirect_socket to
smb_direct_flush_send_list()
smb: server: pass struct smbdirect_socket to wait_for_credits()
smb: server: pass struct smbdirect_socket to wait_for_send_credits()
smb: server: pass struct smbdirect_socket to wait_for_rw_credits()
smb: server: pass struct smbdirect_socket to calc_rw_credits()
smb: server: pass struct smbdirect_socket to
manage_credits_prior_sending()
smb: server: pass struct smbdirect_socket to
manage_keep_alive_before_sending()
smb: server: pass struct smbdirect_socket to
smb_direct_create_header()
smb: server: pass struct smbdirect_socket to post_sendmsg()
smb: server: pass struct smbdirect_socket to
smb_direct_post_send_data()
smb: server: pass struct smbdirect_socket to
{enqueue,get_first}_reassembly()
smb: server: pass struct smbdirect_socket to
smb_direct_send_negotiate_response()

 fs/smb/client/cifs_debug.c                 |   48 +-
 fs/smb/client/cifsglob.h                   |    9 +-
 fs/smb/client/file.c                       |   16 +-
 fs/smb/client/smb2ops.c                    |    8 +-
 fs/smb/client/smb2pdu.c                    |    2 +-
 fs/smb/client/smbdirect.c                  |  943 +++++++------
 fs/smb/client/smbdirect.h                  |  104 +-
 fs/smb/common/smbdirect/smbdirect.h        |    7 +
 fs/smb/common/smbdirect/smbdirect_socket.h |  242 +++-
 fs/smb/server/connection.c                 |    4 +-
 fs/smb/server/connection.h                 |   10 +-
 fs/smb/server/server.c                     |    1 +
 fs/smb/server/smb2pdu.c                    |   23 +-
 fs/smb/server/smb2pdu.h                    |    6 -
 fs/smb/server/transport_rdma.c             | 1434 ++++++++++----------
 fs/smb/server/transport_rdma.h             |   45 +-
 16 files changed, 1565 insertions(+), 1337 deletions(-)
Signature · 1 line
2.43.0