drivers/net/ipvlan/ipvlan.h
Source file repositories/reference/linux-study-clean/drivers/net/ipvlan/ipvlan.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ipvlan/ipvlan.h- Extension
.h- Size
- 5575 bytes
- Lines
- 211
- 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
linux/kernel.hlinux/types.hlinux/module.hlinux/init.hlinux/rculist.hlinux/notifier.hlinux/netdevice.hlinux/etherdevice.hlinux/if_arp.hlinux/if_link.hlinux/if_vlan.hlinux/ip.hlinux/inetdevice.hlinux/netfilter.hnet/ip.hnet/ip6_route.hnet/netns/generic.hnet/rtnetlink.hnet/route.hnet/addrconf.hnet/l3mdev.h
Detected Declarations
struct ipvl_pcpu_statsstruct ipvl_portstruct ipvl_devstruct ipvl_addrstruct ipvl_portstruct ipvl_skb_cbfunction ipvlan_is_privatefunction ipvlan_mark_privatefunction ipvlan_clear_privatefunction ipvlan_is_vepafunction ipvlan_mark_vepafunction ipvlan_clear_vepafunction ipvlan_l3s_registerfunction ipvlan_l3s_unregisterfunction ipvlan_l3s_cleanup
Annotated Snippet
struct ipvl_pcpu_stats {
u64_stats_t rx_pkts;
u64_stats_t rx_bytes;
u64_stats_t rx_mcast;
u64_stats_t tx_pkts;
u64_stats_t tx_bytes;
struct u64_stats_sync syncp;
u32 rx_errs;
u32 tx_drps;
};
struct ipvl_port;
struct ipvl_dev {
struct net_device *dev;
struct list_head pnode;
struct ipvl_port *port;
struct net_device *phy_dev;
struct list_head addrs;
struct ipvl_pcpu_stats __percpu *pcpu_stats;
DECLARE_BITMAP(mac_filters, IPVLAN_MAC_FILTER_SIZE);
netdev_features_t sfeatures;
u32 msg_enable;
};
struct ipvl_addr {
struct ipvl_dev *master; /* Back pointer to master */
union {
struct in6_addr ip6; /* IPv6 address on logical interface */
struct in_addr ip4; /* IPv4 address on logical interface */
} ipu;
#define ip6addr ipu.ip6
#define ip4addr ipu.ip4
struct hlist_node hlnode; /* Hash-table linkage */
struct list_head anode; /* logical-interface linkage */
ipvl_hdr_type atype;
struct rcu_head rcu;
};
struct ipvl_port {
struct net_device *dev;
possible_net_t pnet;
struct hlist_head hlhead[IPVLAN_HASH_SIZE];
spinlock_t addrs_lock; /* guards hash-table and addrs */
struct list_head ipvlans;
u16 mode;
u16 flags;
u16 dev_id_start;
struct work_struct wq;
struct sk_buff_head backlog;
int count;
struct ida ida;
netdevice_tracker dev_tracker;
};
struct ipvl_skb_cb {
bool tx_pkt;
};
#define IPVL_SKB_CB(_skb) ((struct ipvl_skb_cb *)&((_skb)->cb[0]))
static inline struct ipvl_port *ipvlan_port_get_rcu(const struct net_device *d)
{
return rcu_dereference(d->rx_handler_data);
}
static inline struct ipvl_port *ipvlan_port_get_rcu_bh(const struct net_device *d)
{
return rcu_dereference_bh(d->rx_handler_data);
}
static inline struct ipvl_port *ipvlan_port_get_rtnl(const struct net_device *d)
{
return rtnl_dereference(d->rx_handler_data);
}
static inline bool ipvlan_is_private(const struct ipvl_port *port)
{
return !!(port->flags & IPVLAN_F_PRIVATE);
}
static inline void ipvlan_mark_private(struct ipvl_port *port)
{
port->flags |= IPVLAN_F_PRIVATE;
}
static inline void ipvlan_clear_private(struct ipvl_port *port)
{
port->flags &= ~IPVLAN_F_PRIVATE;
}
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/types.h`, `linux/module.h`, `linux/init.h`, `linux/rculist.h`, `linux/notifier.h`, `linux/netdevice.h`, `linux/etherdevice.h`.
- Detected declarations: `struct ipvl_pcpu_stats`, `struct ipvl_port`, `struct ipvl_dev`, `struct ipvl_addr`, `struct ipvl_port`, `struct ipvl_skb_cb`, `function ipvlan_is_private`, `function ipvlan_mark_private`, `function ipvlan_clear_private`, `function ipvlan_is_vepa`.
- 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.