net/core/dev.h
Source file repositories/reference/linux-study-clean/net/core/dev.h
File Facts
- System
- Linux kernel
- Corpus path
net/core/dev.h- Extension
.h- Size
- 12926 bytes
- Lines
- 408
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: implementation source
- Status
- source 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/cleanup.hlinux/types.hlinux/rwsem.hlinux/netdevice.hnet/netdev_lock.h
Detected Declarations
struct netstruct netlink_ext_ackstruct netdev_queue_configstruct cpumaskstruct pp_memory_provider_paramsstruct sd_flow_limitstruct netdev_name_nodefunction __netdev_put_lockfunction net_shaper_flush_netdevfunction netif_set_upfunction netif_set_gso_max_sizefunction netif_set_gso_max_segsfunction netif_set_gro_max_sizefunction netif_set_gso_ipv4_max_sizefunction netif_set_gro_ipv4_max_sizefunction napi_get_defer_hard_irqsfunction napi_set_defer_hard_irqsfunction netdev_set_defer_hard_irqsfunction napi_get_gro_flush_timeoutfunction napi_set_gro_flush_timeoutfunction netdev_set_gro_flush_timeoutfunction napi_get_irq_suspend_timeoutfunction napi_set_irq_suspend_timeoutfunction napi_get_threadedfunction napi_get_threaded_configfunction xdp_do_check_flushedfunction dev_isalive
Annotated Snippet
struct sd_flow_limit {
struct rcu_head rcu;
unsigned int count;
u8 log_buckets;
unsigned int history_head;
u16 history[FLOW_LIMIT_HISTORY];
u8 buckets[];
};
extern int netdev_flow_limit_table_len;
struct napi_struct *
netdev_napi_by_id_lock(struct net *net, unsigned int napi_id);
struct net_device *dev_get_by_napi_id(unsigned int napi_id);
struct net_device *netdev_put_lock(struct net_device *dev, struct net *net,
netdevice_tracker *tracker);
static inline struct net_device *
__netdev_put_lock(struct net_device *dev, struct net *net)
{
return netdev_put_lock(dev, net, NULL);
}
struct net_device *
netdev_xa_find_lock(struct net *net, struct net_device *dev,
unsigned long *index);
DEFINE_FREE(netdev_unlock, struct net_device *, if (_T) netdev_unlock(_T));
#define for_each_netdev_lock_scoped(net, var_name, ifindex) \
for (struct net_device *var_name __free(netdev_unlock) = NULL; \
(var_name = netdev_xa_find_lock(net, var_name, &ifindex)); \
ifindex++)
struct net_device *
netdev_get_by_index_lock_ops_compat(struct net *net, int ifindex);
struct net_device *
netdev_xa_find_lock_ops_compat(struct net *net, struct net_device *dev,
unsigned long *index);
DEFINE_FREE(netdev_unlock_ops_compat, struct net_device *,
if (_T) netdev_unlock_ops_compat(_T));
#define for_each_netdev_lock_ops_compat_scoped(net, var_name, ifindex) \
for (struct net_device *var_name __free(netdev_unlock_ops_compat) = NULL; \
(var_name = netdev_xa_find_lock_ops_compat(net, var_name, \
&ifindex)); \
ifindex++)
#ifdef CONFIG_PROC_FS
int __init dev_proc_init(void);
#else
#define dev_proc_init() 0
#endif
void linkwatch_init_dev(struct net_device *dev);
void linkwatch_run_queue(void);
void dev_addr_flush(struct net_device *dev);
int dev_addr_init(struct net_device *dev);
void dev_addr_check(struct net_device *dev);
void __hw_addr_flush(struct netdev_hw_addr_list *list);
#if IS_ENABLED(CONFIG_NET_SHAPER)
void net_shaper_flush_netdev(struct net_device *dev);
void net_shaper_set_real_num_tx_queues(struct net_device *dev,
unsigned int txq);
#else
static inline void net_shaper_flush_netdev(struct net_device *dev) {}
static inline void net_shaper_set_real_num_tx_queues(struct net_device *dev,
unsigned int txq) {}
#endif
/* sysctls not referred to from outside net/core/ */
extern int netdev_unregister_timeout_secs;
extern int weight_p;
extern int dev_weight_rx_bias;
extern int dev_weight_tx_bias;
extern struct rw_semaphore dev_addr_sem;
/* rtnl helpers */
extern struct list_head net_todo_list;
void netdev_run_todo(void);
int netdev_queue_config_validate(struct net_device *dev, int rxq_idx,
struct netdev_queue_config *qcfg,
struct netlink_ext_ack *extack);
Annotation
- Immediate include surface: `linux/cleanup.h`, `linux/types.h`, `linux/rwsem.h`, `linux/netdevice.h`, `net/netdev_lock.h`.
- Detected declarations: `struct net`, `struct netlink_ext_ack`, `struct netdev_queue_config`, `struct cpumask`, `struct pp_memory_provider_params`, `struct sd_flow_limit`, `struct netdev_name_node`, `function __netdev_put_lock`, `function net_shaper_flush_netdev`, `function netif_set_up`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- 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.