drivers/infiniband/core/sa_query.c

Source file repositories/reference/linux-study-clean/drivers/infiniband/core/sa_query.c

File Facts

System
Linux kernel
Corpus path
drivers/infiniband/core/sa_query.c
Extension
.c
Size
68959 bytes
Lines
2553
Domain
Driver Families
Bucket
drivers/infiniband
Inferred role
Driver Families: exported/initcall integration point
Status
integration implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct ib_sa_sm_ah {
	struct ib_ah        *ah;
	struct kref          ref;
	u16		     pkey_index;
	u8		     src_path_mask;
};

enum rdma_class_port_info_type {
	RDMA_CLASS_PORT_INFO_IB,
	RDMA_CLASS_PORT_INFO_OPA
};

struct rdma_class_port_info {
	enum rdma_class_port_info_type type;
	union {
		struct ib_class_port_info ib;
		struct opa_class_port_info opa;
	};
};

struct ib_sa_classport_cache {
	bool valid;
	int retry_cnt;
	struct rdma_class_port_info data;
};

struct ib_sa_port {
	struct ib_mad_agent *agent;
	struct ib_sa_sm_ah  *sm_ah;
	struct work_struct   update_task;
	struct ib_sa_classport_cache classport_info;
	struct delayed_work ib_cpi_work;
	spinlock_t                   classport_lock; /* protects class port info set */
	spinlock_t           ah_lock;
	u32		     port_num;
};

struct ib_sa_device {
	int                     start_port, end_port;
	struct ib_event_handler event_handler;
	struct ib_sa_port port[];
};

struct ib_sa_query {
	void (*callback)(struct ib_sa_query *sa_query, int status,
			 struct ib_sa_mad *mad);
	void (*rmpp_callback)(struct ib_sa_query *sa_query, int status,
			      struct ib_mad_recv_wc *mad);
	void (*release)(struct ib_sa_query *);
	struct ib_sa_client    *client;
	struct ib_sa_port      *port;
	struct ib_mad_send_buf *mad_buf;
	struct ib_sa_sm_ah     *sm_ah;
	int			id;
	u32			flags;
	struct list_head	list; /* Local svc request list */
	u32			seq; /* Local svc request sequence number */
	unsigned long		timeout; /* Local svc timeout */
	u8			path_use; /* How will the pathrecord be used */
};

#define IB_SA_ENABLE_LOCAL_SERVICE	0x00000001
#define IB_SA_CANCEL			0x00000002
#define IB_SA_QUERY_OPA			0x00000004

struct ib_sa_path_query {
	void (*callback)(int status, struct sa_path_rec *rec,
			 unsigned int num_paths, void *context);
	void *context;
	struct ib_sa_query sa_query;
	struct sa_path_rec *conv_pr;
};

struct ib_sa_guidinfo_query {
	void (*callback)(int, struct ib_sa_guidinfo_rec *, void *);
	void *context;
	struct ib_sa_query sa_query;
};

struct ib_sa_classport_info_query {
	void (*callback)(void *);
	void *context;
	struct ib_sa_query sa_query;
};

struct ib_sa_mcmember_query {
	void (*callback)(int, struct ib_sa_mcmember_rec *, void *);
	void *context;
	struct ib_sa_query sa_query;
};

Annotation

Implementation Notes