drivers/net/ethernet/freescale/enetc/enetc_qos.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/freescale/enetc/enetc_qos.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/freescale/enetc/enetc_qos.c- Extension
.c- Size
- 39453 bytes
- Lines
- 1690
- 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.
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
enetc.hnet/pkt_sched.hlinux/math64.hlinux/refcount.hnet/pkt_cls.hnet/tc_act/tc_gate.h
Detected Declarations
struct actions_fwdstruct psfp_streamfilter_countersstruct enetc_streamidstruct enetc_psfp_filterstruct enetc_psfp_gatestruct enetc_psfp_meterstruct enetc_stream_filterstruct enetc_psfpenum streamid_typeenum streamid_vlan_taggedenum forward_typefunction enetc_get_max_gcl_lenfunction enetc_sched_speed_setfunction enetc_setup_tapriofunction enetc_reset_taprio_statsfunction enetc_reset_tapriofunction enetc_taprio_destroyfunction enetc_taprio_statsfunction enetc_taprio_queue_statsfunction enetc_taprio_replacefunction enetc_setup_tc_tapriofunction enetc_get_cbs_enablefunction enetc_get_cbs_bwfunction enetc_setup_tc_cbsfunction enetc_setup_tc_txtimefunction enetc_streamid_hw_setfunction enetc_streamfilter_hw_setfunction enetc_streamcounter_hw_getfunction get_ptp_nowfunction get_start_nsfunction enetc_streamgate_hw_setfunction enetc_flowmeter_hw_setfunction enetc_get_free_indexfunction stream_filter_unreffunction stream_gate_unreffunction flow_meter_unreffunction remove_one_chainfunction enetc_psfp_hw_setfunction enetc_check_flow_actionsfunction enetc_psfp_policer_validatefunction enetc_psfp_parse_clsflowerfunction enetc_config_clsflowerfunction enetc_psfp_destroy_clsflowerfunction enetc_destroy_clsflowerfunction enetc_psfp_get_statsfunction enetc_setup_tc_cls_flowerfunction clean_psfp_sfi_bitmapfunction clean_stream_list
Annotated Snippet
struct actions_fwd {
u64 actions;
u64 keys; /* include the must needed keys */
enum forward_type output;
};
struct psfp_streamfilter_counters {
u64 matching_frames_count;
u64 passing_frames_count;
u64 not_passing_frames_count;
u64 passing_sdu_count;
u64 not_passing_sdu_count;
u64 red_frames_count;
};
struct enetc_streamid {
u32 index;
union {
u8 src_mac[6];
u8 dst_mac[6];
};
u8 filtertype;
u16 vid;
u8 tagged;
s32 handle;
};
struct enetc_psfp_filter {
u32 index;
s32 handle;
s8 prio;
u32 maxsdu;
u32 gate_id;
s32 meter_id;
refcount_t refcount;
struct hlist_node node;
};
struct enetc_psfp_gate {
u32 index;
s8 init_ipv;
u64 basetime;
u64 cycletime;
u64 cycletimext;
u32 num_entries;
refcount_t refcount;
struct hlist_node node;
struct action_gate_entry entries[] __counted_by(num_entries);
};
/* Only enable the green color frame now
* Will add eir and ebs color blind, couple flag etc when
* policing action add more offloading parameters
*/
struct enetc_psfp_meter {
u32 index;
u32 cir;
u32 cbs;
refcount_t refcount;
struct hlist_node node;
};
#define ENETC_PSFP_FLAGS_FMI BIT(0)
struct enetc_stream_filter {
struct enetc_streamid sid;
u32 sfi_index;
u32 sgi_index;
u32 flags;
u32 fmi_index;
struct flow_stats stats;
struct hlist_node node;
};
struct enetc_psfp {
unsigned long dev_bitmap;
unsigned long *psfp_sfi_bitmap;
struct hlist_head stream_list;
struct hlist_head psfp_filter_list;
struct hlist_head psfp_gate_list;
struct hlist_head psfp_meter_list;
spinlock_t psfp_lock; /* spinlock for the struct enetc_psfp r/w */
};
static struct actions_fwd enetc_act_fwd[] = {
{
BIT(FLOW_ACTION_GATE),
BIT_ULL(FLOW_DISSECTOR_KEY_ETH_ADDRS),
FILTER_ACTION_TYPE_PSFP
},
Annotation
- Immediate include surface: `enetc.h`, `net/pkt_sched.h`, `linux/math64.h`, `linux/refcount.h`, `net/pkt_cls.h`, `net/tc_act/tc_gate.h`.
- Detected declarations: `struct actions_fwd`, `struct psfp_streamfilter_counters`, `struct enetc_streamid`, `struct enetc_psfp_filter`, `struct enetc_psfp_gate`, `struct enetc_psfp_meter`, `struct enetc_stream_filter`, `struct enetc_psfp`, `enum streamid_type`, `enum streamid_vlan_tagged`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.