net/core/drop_monitor.c
Source file repositories/reference/linux-study-clean/net/core/drop_monitor.c
File Facts
- System
- Linux kernel
- Corpus path
net/core/drop_monitor.c- Extension
.c- Size
- 42819 bytes
- Lines
- 1789
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- 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/netdevice.hlinux/etherdevice.hlinux/string.hlinux/if_arp.hlinux/inetdevice.hlinux/inet.hlinux/interrupt.hlinux/netpoll.hlinux/sched.hlinux/delay.hlinux/types.hlinux/workqueue.hlinux/netlink.hlinux/net_dropmon.hlinux/bitfield.hlinux/percpu.hlinux/timer.hlinux/bitops.hlinux/slab.hlinux/module.hnet/genetlink.hnet/netevent.hnet/flow_offload.hnet/dropreason.hnet/devlink.htrace/events/skb.htrace/events/napi.htrace/events/devlink.hlinux/unaligned.h
Detected Declarations
struct net_dm_statsstruct net_dm_hw_entrystruct net_dm_hw_entriesstruct per_cpu_dm_datastruct dm_hw_stat_deltastruct net_dm_alert_opsstruct net_dm_skb_cbfunction send_dm_alertfunction sched_send_workfunction trace_drop_commonfunction trace_kfree_skb_hitfunction trace_napi_poll_hitfunction net_dm_hw_reset_per_cpu_datafunction net_dm_hw_entry_putfunction net_dm_hw_entries_putfunction net_dm_hw_summary_report_fillfunction net_dm_hw_summary_workfunction net_dm_hw_trap_summary_probefunction net_dm_packet_trace_kfree_skb_hitfunction net_dm_packet_trace_napi_poll_hitfunction net_dm_packet_report_sizefunction net_dm_packet_report_in_port_putfunction net_dm_packet_report_fillfunction strlenfunction net_dm_packet_reportfunction net_dm_packet_workfunction net_dm_flow_action_cookie_sizefunction net_dm_hw_packet_report_sizefunction net_dm_hw_packet_report_fillfunction net_dm_hw_metadata_copyfunction net_dm_hw_metadata_freefunction net_dm_hw_packet_reportfunction net_dm_hw_packet_workfunction net_dm_hw_trap_packet_probefunction net_dm_hw_probe_registerfunction net_dm_hw_probe_unregisterfunction net_dm_hw_probe_registerfunction net_dm_hw_probe_unregisterfunction for_each_possible_cpufunction net_dm_hw_monitor_stopfunction for_each_possible_cpufunction net_dm_trace_on_setfunction for_each_possible_cpufunction net_dm_trace_off_setfunction set_all_monitor_tracesfunction net_dm_is_monitoringfunction net_dm_alert_mode_get_from_infofunction net_dm_alert_mode_set
Annotated Snippet
module_init(init_net_drop_monitor);
module_exit(exit_net_drop_monitor);
MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Neil Horman <nhorman@tuxdriver.com>");
MODULE_ALIAS_GENL_FAMILY("NET_DM");
MODULE_DESCRIPTION("Monitoring code for network dropped packet alerts");
Annotation
- Immediate include surface: `linux/netdevice.h`, `linux/etherdevice.h`, `linux/string.h`, `linux/if_arp.h`, `linux/inetdevice.h`, `linux/inet.h`, `linux/interrupt.h`, `linux/netpoll.h`.
- Detected declarations: `struct net_dm_stats`, `struct net_dm_hw_entry`, `struct net_dm_hw_entries`, `struct per_cpu_dm_data`, `struct dm_hw_stat_delta`, `struct net_dm_alert_ops`, `struct net_dm_skb_cb`, `function send_dm_alert`, `function sched_send_work`, `function trace_drop_common`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.