Skip to content

Commit 22234e3

Browse files
metze-sambasmfrench
authored andcommitted
smb: smbdirect: add smbdirect_socket.h
This abstracts the common smbdirect layer. Currently with just a few things in it, but that will change over time until everything is in common. Will be used in client and server in the next commits Cc: Steve French <[email protected]> Cc: Tom Talpey <[email protected]> Cc: Long Li <[email protected]> Cc: Namjae Jeon <[email protected]> Cc: Hyunchul Lee <[email protected]> Cc: Meetakshi Setiya <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Stefan Metzmacher <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 21604ed commit 22234e3

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/* SPDX-License-Identifier: GPL-2.0-or-later */
2+
/*
3+
* Copyright (c) 2025 Stefan Metzmacher
4+
*/
5+
6+
#ifndef __FS_SMB_COMMON_SMBDIRECT_SMBDIRECT_SOCKET_H__
7+
#define __FS_SMB_COMMON_SMBDIRECT_SMBDIRECT_SOCKET_H__
8+
9+
enum smbdirect_socket_status {
10+
SMBDIRECT_SOCKET_CREATED,
11+
SMBDIRECT_SOCKET_CONNECTING,
12+
SMBDIRECT_SOCKET_CONNECTED,
13+
SMBDIRECT_SOCKET_NEGOTIATE_FAILED,
14+
SMBDIRECT_SOCKET_DISCONNECTING,
15+
SMBDIRECT_SOCKET_DISCONNECTED,
16+
SMBDIRECT_SOCKET_DESTROYED
17+
};
18+
19+
struct smbdirect_socket {
20+
enum smbdirect_socket_status status;
21+
22+
/* RDMA related */
23+
struct {
24+
struct rdma_cm_id *cm_id;
25+
} rdma;
26+
27+
/* IB verbs related */
28+
struct {
29+
struct ib_pd *pd;
30+
struct ib_cq *send_cq;
31+
struct ib_cq *recv_cq;
32+
33+
/*
34+
* shortcuts for rdma.cm_id->{qp,device};
35+
*/
36+
struct ib_qp *qp;
37+
struct ib_device *dev;
38+
} ib;
39+
};
40+
41+
#endif /* __FS_SMB_COMMON_SMBDIRECT_SMBDIRECT_SOCKET_H__ */

0 commit comments

Comments
 (0)