drivers/crypto/intel/qat/qat_common/adf_rl.h

Source file repositories/reference/linux-study-clean/drivers/crypto/intel/qat/qat_common/adf_rl.h

File Facts

System
Linux kernel
Corpus path
drivers/crypto/intel/qat/qat_common/adf_rl.h
Extension
.h
Size
5934 bytes
Lines
177
Domain
Driver Families
Bucket
drivers/crypto
Inferred role
Driver Families: implementation source
Status
source 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 adf_rl_sla_input_data {
	u64 rp_mask;
	int sla_id;
	int parent_id;
	unsigned int cir;
	unsigned int pir;
	enum rl_node_type type;
	enum adf_base_services srv;
};

struct rl_slice_cnt {
	u8 dcpr_cnt;
	u8 pke_cnt;
	u8 cph_cnt;
	u8 cpr_cnt;
};

struct adf_rl_interface_data {
	struct adf_rl_sla_input_data input;
	enum adf_base_services cap_rem_srv;
	struct rw_semaphore lock;
	bool sysfs_added;
};

struct adf_rl_hw_data {
	u32 scale_ref;
	u32 scan_interval;
	u32 r2l_offset;
	u32 l2c_offset;
	u32 c2s_offset;
	u32 pciin_tb_offset;
	u32 pciout_tb_offset;
	u32 pcie_scale_mul;
	u32 pcie_scale_div;
	u32 dcpr_correction;
	u32 max_tp[RL_ROOT_MAX];
	u32 svc_ae_mask[SVC_BASE_COUNT];
	struct rl_slice_cnt slices;
};

/**
 * struct adf_rl - ratelimiting data structure
 * @accel_dev: pointer to acceleration device data
 * @device_data: pointer to rate limiting data specific to a device type (or revision)
 * @sla: array of pointers to SLA objects
 * @root: array of pointers to root type SLAs, element number reflects node_id
 * @cluster: array of pointers to cluster type SLAs, element number reflects node_id
 * @leaf: array of pointers to leaf type SLAs, element number reflects node_id
 * @rp_in_use: array of ring pair IDs already used in one of SLAs
 * @rl_lock: mutex object which is protecting data in this structure
 * @input: structure which is used for holding the data received from user
 */
struct adf_rl {
	struct adf_accel_dev *accel_dev;
	struct adf_rl_hw_data *device_data;
	/* mapping sla_id to SLA objects */
	struct rl_sla *sla[RL_NODES_CNT_MAX];
	struct rl_sla *root[RL_ROOT_MAX];
	struct rl_sla *cluster[RL_CLUSTER_MAX];
	struct rl_sla *leaf[RL_LEAF_MAX];
	bool rp_in_use[RL_RP_CNT_MAX];
	/* Mutex protecting writing to SLAs lists */
	struct mutex rl_lock;
	struct adf_rl_interface_data user_input;
};

/**
 * struct rl_sla - SLA object data structure
 * @parent: pointer to the parent SLA (root/cluster)
 * @type: SLA type
 * @srv: service associated with this SLA
 * @sla_id: ID of the SLA, used as element number in SLA array and as identifier
 *	    shared with the user
 * @node_id: ID of node, each of SLA type have a separate ID list
 * @cir: committed information rate
 * @pir: peak information rate (PIR >= CIR)
 * @rem_cir: if this SLA is a parent then this field represents a remaining
 *	     value to be used by child SLAs.
 * @ring_pairs_ids: array with numeric ring pairs IDs assigned to this SLA
 * @ring_pairs_cnt: number of assigned ring pairs listed in the array above
 */
struct rl_sla {
	struct rl_sla *parent;
	enum rl_node_type type;
	enum adf_base_services srv;
	u32 sla_id;
	u32 node_id;
	u32 cir;
	u32 pir;
	u32 rem_cir;

Annotation

Implementation Notes