drivers/net/ethernet/microchip/sparx5/sparx5_tc.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/microchip/sparx5/sparx5_tc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/microchip/sparx5/sparx5_tc.c- Extension
.c- Size
- 4204 bytes
- Lines
- 175
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
net/pkt_cls.hnet/pkt_sched.hsparx5_tc.hsparx5_main.hsparx5_qos.h
Detected Declarations
function sparx5_tc_block_cbfunction sparx5_tc_block_cb_ingressfunction sparx5_tc_block_cb_egressfunction sparx5_tc_setup_blockfunction sparx5_tc_get_layer_and_idxfunction sparx5_tc_setup_qdisc_mqpriofunction sparx5_tc_setup_qdisc_tbffunction sparx5_tc_setup_qdisc_etsfunction sparx5_port_setup_tc
Annotated Snippet
if (params->quanta[i] && params->weights[i] == 0) {
pr_err("Invalid ets configuration; band %d has weight zero",
i);
return -EINVAL;
}
}
return sparx5_tc_ets_add(port, params);
case TC_ETS_DESTROY:
return sparx5_tc_ets_del(port);
case TC_ETS_GRAFT:
return -EOPNOTSUPP;
default:
return -EOPNOTSUPP;
}
return -EOPNOTSUPP;
}
int sparx5_port_setup_tc(struct net_device *ndev, enum tc_setup_type type,
void *type_data)
{
switch (type) {
case TC_SETUP_BLOCK:
return sparx5_tc_setup_block(ndev, type_data);
case TC_SETUP_QDISC_MQPRIO:
return sparx5_tc_setup_qdisc_mqprio(ndev, type_data);
case TC_SETUP_QDISC_TBF:
return sparx5_tc_setup_qdisc_tbf(ndev, type_data);
case TC_SETUP_QDISC_ETS:
return sparx5_tc_setup_qdisc_ets(ndev, type_data);
default:
return -EOPNOTSUPP;
}
return 0;
}
Annotation
- Immediate include surface: `net/pkt_cls.h`, `net/pkt_sched.h`, `sparx5_tc.h`, `sparx5_main.h`, `sparx5_qos.h`.
- Detected declarations: `function sparx5_tc_block_cb`, `function sparx5_tc_block_cb_ingress`, `function sparx5_tc_block_cb_egress`, `function sparx5_tc_setup_block`, `function sparx5_tc_get_layer_and_idx`, `function sparx5_tc_setup_qdisc_mqprio`, `function sparx5_tc_setup_qdisc_tbf`, `function sparx5_tc_setup_qdisc_ets`, `function sparx5_port_setup_tc`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
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.