net/dsa/dsa.c
Source file repositories/reference/linux-study-clean/net/dsa/dsa.c
File Facts
- System
- Linux kernel
- Corpus path
net/dsa/dsa.c- Extension
.c- Size
- 41454 bytes
- Lines
- 1901
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: exported/initcall integration point
- Status
- integration implementation candidate
Why This File Exists
Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Networking stack implementation surface: socket APIs, protocol dispatch, packet flow, routing, filtering, and network namespaces.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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
linux/device.hlinux/err.hlinux/if_hsr.hlinux/list.hlinux/module.hlinux/netdevice.hlinux/slab.hlinux/rtnetlink.hlinux/of.hlinux/of_net.hnet/dsa_stubs.hnet/sch_generic.hconduit.hdevlink.hdsa.hnetlink.hport.hswitch.htag.huser.h
Detected Declarations
function dsa_schedule_workfunction dsa_flush_workqueuefunction dsa_lag_mapfunction dsa_lag_unmapfunction dsa_lags_foreach_idfunction dsa_bridge_num_findfunction list_for_each_entryfunction dsa_bridge_num_getfunction dsa_bridge_num_putfunction list_for_each_entryfunction list_for_each_entryfunction dsa_tree_freefunction dsa_tree_releasefunction dsa_tree_putfunction dsa_port_setup_routing_tablefunction of_for_each_phandlefunction dsa_tree_setup_routing_tablefunction list_for_each_entryfunction dsa_tree_setup_default_cpufunction list_for_each_entryfunction dsa_switch_preferred_default_local_cpu_portfunction dsa_tree_setup_cpu_portsfunction list_for_each_entryfunction dsa_switch_for_each_portfunction dsa_tree_teardown_cpu_portsfunction dsa_port_setupfunction dsa_port_teardownfunction dsa_port_setup_as_unusedfunction dsa_switch_setup_tag_protocolfunction dsa_switch_teardown_tag_protocolfunction dsa_switch_setupfunction dsa_switch_teardownfunction dsa_tree_teardown_portsfunction dsa_tree_teardown_switchesfunction dsa_tree_setup_portsfunction list_for_each_entryfunction list_for_each_entryfunction dsa_tree_setup_switchesfunction list_for_each_entryfunction dsa_tree_setup_conduitfunction dsa_tree_for_each_cpu_portfunction dsa_tree_teardown_conduitfunction dsa_tree_for_each_cpu_portfunction dsa_tree_setup_lagsfunction list_for_each_entryfunction dsa_tree_teardown_lagsfunction dsa_tree_teardown_routing_tablefunction list_for_each_entry_safe
Annotated Snippet
module_init(dsa_init_module);
static void __exit dsa_cleanup_module(void)
{
dsa_unregister_stubs();
rtnl_link_unregister(&dsa_link_ops);
dsa_user_unregister_notifier();
dev_remove_pack(&dsa_pack_type);
destroy_workqueue(dsa_owq);
}
module_exit(dsa_cleanup_module);
MODULE_AUTHOR("Lennert Buytenhek <buytenh@wantstofly.org>");
MODULE_DESCRIPTION("Driver for Distributed Switch Architecture switch chips");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:dsa");
MODULE_IMPORT_NS("NETDEV_INTERNAL");
Annotation
- Immediate include surface: `linux/device.h`, `linux/err.h`, `linux/if_hsr.h`, `linux/list.h`, `linux/module.h`, `linux/netdevice.h`, `linux/slab.h`, `linux/rtnetlink.h`.
- Detected declarations: `function dsa_schedule_work`, `function dsa_flush_workqueue`, `function dsa_lag_map`, `function dsa_lag_unmap`, `function dsa_lags_foreach_id`, `function dsa_bridge_num_find`, `function list_for_each_entry`, `function dsa_bridge_num_get`, `function dsa_bridge_num_put`, `function list_for_each_entry`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: integration 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.