smb: smbdirect: introduce smbdirect_socket_parameters
authorStefan Metzmacher <metze@samba.org>
Wed, 28 May 2025 16:01:39 +0000 (18:01 +0200)
committerSteve French <stfrench@microsoft.com>
Tue, 3 Jun 2025 23:42:47 +0000 (18:42 -0500)
This is the next step in the direction of a common smbdirect layer.

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: Hyunchul Lee <hyc.lee@gmail.com>
Cc: Meetakshi Setiya <meetakshisetiyaoss@gmail.com>
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>
fs/smb/client/smbdirect.h
fs/smb/common/smbdirect/smbdirect.h
fs/smb/common/smbdirect/smbdirect_socket.h

index 904c4e5b9e5c35ae2a388cfc69c1cc8e1f607242..3d325d73364a50061a5db265e9760291cf3d4899 100644 (file)
@@ -15,6 +15,7 @@
 #include <rdma/rdma_cm.h>
 #include <linux/mempool.h>
 
+#include "../common/smbdirect/smbdirect.h"
 #include "../common/smbdirect/smbdirect_socket.h"
 
 extern int rdma_readwrite_threshold;
index eedbdf0d04337424b382ad19397e66580de26c1c..b9a385344ff31ce549224494ccbf11418805a52e 100644 (file)
@@ -14,4 +14,24 @@ struct smbdirect_buffer_descriptor_v1 {
        __le32 length;
 } __packed;
 
+/*
+ * Connection parameters mostly from [MS-SMBD] 3.1.1.1
+ *
+ * These are setup and negotiated at the beginning of a
+ * connection and remain constant unless explicitly changed.
+ *
+ * Some values are important for the upper layer.
+ */
+struct smbdirect_socket_parameters {
+       __u16 recv_credit_max;
+       __u16 send_credit_target;
+       __u32 max_send_size;
+       __u32 max_fragmented_send_size;
+       __u32 max_recv_size;
+       __u32 max_fragmented_recv_size;
+       __u32 max_read_write_size;
+       __u32 keepalive_interval_msec;
+       __u32 keepalive_timeout_msec;
+} __packed;
+
 #endif /* __FS_SMB_COMMON_SMBDIRECT_SMBDIRECT_H__ */
index 69a55561f91ae91985e25fcef9a5e08a584e136e..e5b15cc44a7ba5f7d2a3a7c12a43f1f7b5b848a2 100644 (file)
@@ -36,6 +36,8 @@ struct smbdirect_socket {
                struct ib_qp *qp;
                struct ib_device *dev;
        } ib;
+
+       struct smbdirect_socket_parameters parameters;
 };
 
 #endif /* __FS_SMB_COMMON_SMBDIRECT_SMBDIRECT_SOCKET_H__ */