include/linux/smbdirect.h

Source file repositories/reference/linux-study-clean/include/linux/smbdirect.h

File Facts

System
Linux kernel
Corpus path
include/linux/smbdirect.h
Extension
.h
Size
5754 bytes
Lines
187
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct smbdirect_buffer_descriptor_v1 {
	__le64 offset;
	__le32 token;
	__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 {
	__u64 flags;
#define SMBDIRECT_FLAG_PORT_RANGE_ONLY_IB ((__u64)0x1)
#define SMBDIRECT_FLAG_PORT_RANGE_ONLY_IW ((__u64)0x2)
	__u32 resolve_addr_timeout_msec;
	__u32 resolve_route_timeout_msec;
	__u32 rdma_connect_timeout_msec;
	__u32 negotiate_timeout_msec;
	__u16 initiator_depth;     /* limited to U8_MAX */
	__u16 responder_resources; /* limited to U8_MAX */
	__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 max_frmr_depth;
	__u32 keepalive_interval_msec;
	__u32 keepalive_timeout_msec;
} __packed;

#define SMBDIRECT_FLAG_PORT_RANGE_MASK ( \
		SMBDIRECT_FLAG_PORT_RANGE_ONLY_IB | \
		SMBDIRECT_FLAG_PORT_RANGE_ONLY_IW)

struct smbdirect_socket;
struct smbdirect_send_batch;
struct smbdirect_mr_io;

#include <rdma/rw.h>

u8 smbdirect_netdev_rdma_capable_node_type(struct net_device *netdev);

bool smbdirect_frwr_is_supported(const struct ib_device_attr *attrs);

int smbdirect_socket_create_kern(struct net *net, struct smbdirect_socket **_sc);

int smbdirect_socket_create_accepting(struct rdma_cm_id *id, struct smbdirect_socket **_sc);

int smbdirect_socket_set_initial_parameters(struct smbdirect_socket *sc,
					    const struct smbdirect_socket_parameters *sp);

const struct smbdirect_socket_parameters *
smbdirect_socket_get_current_parameters(struct smbdirect_socket *sc);

int smbdirect_socket_set_kernel_settings(struct smbdirect_socket *sc,
					 enum ib_poll_context poll_ctx,
					 gfp_t gfp_mask);

#define SMBDIRECT_LOG_ERR		0x0
#define SMBDIRECT_LOG_INFO		0x1

#define SMBDIRECT_LOG_OUTGOING			0x1
#define SMBDIRECT_LOG_INCOMING			0x2
#define SMBDIRECT_LOG_READ			0x4
#define SMBDIRECT_LOG_WRITE			0x8
#define SMBDIRECT_LOG_RDMA_SEND			0x10
#define SMBDIRECT_LOG_RDMA_RECV			0x20
#define SMBDIRECT_LOG_KEEP_ALIVE		0x40
#define SMBDIRECT_LOG_RDMA_EVENT		0x80
#define SMBDIRECT_LOG_RDMA_MR			0x100
#define SMBDIRECT_LOG_RDMA_RW			0x200
#define SMBDIRECT_LOG_NEGOTIATE			0x400
void smbdirect_socket_set_logging(struct smbdirect_socket *sc,
				  void *private_ptr,
				  bool (*needed)(struct smbdirect_socket *sc,
						 void *private_ptr,
						 unsigned int lvl,
						 unsigned int cls),
				  void (*vaprintf)(struct smbdirect_socket *sc,
						   const char *func,
						   unsigned int line,
						   void *private_ptr,
						   unsigned int lvl,
						   unsigned int cls,

Annotation

Implementation Notes