drivers/net/ethernet/netronome/nfp/abm/main.h

Source file repositories/reference/linux-study-clean/drivers/net/ethernet/netronome/nfp/abm/main.h

File Facts

System
Linux kernel
Corpus path
drivers/net/ethernet/netronome/nfp/abm/main.h
Extension
.h
Size
8152 bytes
Lines
274
Domain
Driver Families
Bucket
drivers/net
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 nfp_abm {
	struct nfp_app *app;
	unsigned int pf_id;

	unsigned int red_support;
	unsigned int num_prios;
	unsigned int num_bands;
	unsigned int action_mask;

	u32 *thresholds;
	unsigned long *threshold_undef;
	u8 *actions;
	size_t num_thresholds;

	unsigned int prio_map_len;
	u8 dscp_mask;

	enum devlink_eswitch_mode eswitch_mode;

	const struct nfp_rtsym *q_lvls;
	const struct nfp_rtsym *qm_stats;
	const struct nfp_rtsym *q_stats;
};

/**
 * struct nfp_alink_stats - ABM NIC statistics
 * @tx_pkts:		number of TXed packets
 * @tx_bytes:		number of TXed bytes
 * @backlog_pkts:	momentary backlog length (packets)
 * @backlog_bytes:	momentary backlog length (bytes)
 * @overlimits:		number of ECN marked TXed packets (accumulative)
 * @drops:		number of tail-dropped packets (accumulative)
 */
struct nfp_alink_stats {
	u64 tx_pkts;
	u64 tx_bytes;
	u64 backlog_pkts;
	u64 backlog_bytes;
	u64 overlimits;
	u64 drops;
};

/**
 * struct nfp_alink_xstats - extended ABM NIC statistics
 * @ecn_marked:		number of ECN marked TXed packets
 * @pdrop:		number of hard drops due to queue limit
 */
struct nfp_alink_xstats {
	u64 ecn_marked;
	u64 pdrop;
};

enum nfp_qdisc_type {
	NFP_QDISC_NONE = 0,
	NFP_QDISC_MQ,
	NFP_QDISC_RED,
	NFP_QDISC_GRED,
};

#define NFP_QDISC_UNTRACKED	((struct nfp_qdisc *)1UL)

/**
 * struct nfp_qdisc - tracked TC Qdisc
 * @netdev:		netdev on which Qdisc was created
 * @type:		Qdisc type
 * @handle:		handle of this Qdisc
 * @parent_handle:	handle of the parent (unreliable if Qdisc was grafted)
 * @use_cnt:		number of attachment points in the hierarchy
 * @num_children:	current size of the @children array
 * @children:		pointers to children
 *
 * @params_ok:		parameters of this Qdisc are OK for offload
 * @offload_mark:	offload refresh state - selected for offload
 * @offloaded:		Qdisc is currently offloaded to the HW
 *
 * @mq:			MQ Qdisc specific parameters and state
 * @mq.stats:		current stats of the MQ Qdisc
 * @mq.prev_stats:	previously reported @mq.stats
 *
 * @red:		RED Qdisc specific parameters and state
 * @red.num_bands:	Number of valid entries in the @red.band table
 * @red.band:		Per-band array of RED instances
 * @red.band.ecn:		ECN marking is enabled (rather than drop)
 * @red.band.threshold:		ECN marking threshold
 * @red.band.stats:		current stats of the RED Qdisc
 * @red.band.prev_stats:	previously reported @red.stats
 * @red.band.xstats:		extended stats for RED - current
 * @red.band.prev_xstats:	extended stats for RED - previously reported
 */
struct nfp_qdisc {

Annotation

Implementation Notes