drivers/net/vxlan/vxlan_mdb.c
Source file repositories/reference/linux-study-clean/drivers/net/vxlan/vxlan_mdb.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/vxlan/vxlan_mdb.c- Extension
.c- Size
- 44829 bytes
- Lines
- 1747
- 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.
- 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/if_bridge.hlinux/in.hlinux/list.hlinux/netdevice.hlinux/netlink.hlinux/rhashtable.hlinux/rhashtable-types.hlinux/rtnetlink.hlinux/skbuff.hlinux/types.hnet/netlink.hnet/vxlan.hvxlan_private.h
Detected Declarations
struct vxlan_mdb_entry_keystruct vxlan_mdb_entrystruct vxlan_mdb_remotestruct vxlan_mdb_src_entrystruct vxlan_mdb_dump_ctxstruct vxlan_mdb_config_src_entrystruct vxlan_mdb_configstruct vxlan_mdb_flush_descfunction vxlan_br_mdb_entry_fillfunction vxlan_mdb_entry_info_fill_srcsfunction hlist_for_each_entryfunction vxlan_mdb_entry_info_fillfunction vxlan_mdb_entry_fillfunction list_for_each_entryfunction vxlan_mdb_fillfunction hlist_for_each_entryfunction vxlan_mdb_dumpfunction vxlan_mdb_is_valid_sourcefunction vxlan_mdb_group_setfunction vxlan_mdb_is_star_gfunction vxlan_mdb_is_sgfunction vxlan_mdb_config_src_entry_initfunction vxlan_mdb_config_src_entry_finifunction vxlan_mdb_config_src_list_initfunction nla_for_each_nestedfunction vxlan_mdb_config_src_list_finifunction vxlan_mdb_config_attrs_initfunction vxlan_mdb_config_initfunction vxlan_mdb_config_finifunction vxlan_mdb_entry_lookupfunction vxlan_mdb_remote_lookupfunction list_for_each_entryfunction vxlan_mdb_rdst_freefunction vxlan_mdb_remote_rdst_initfunction vxlan_mdb_remote_rdst_finifunction vxlan_mdb_remote_initfunction vxlan_mdb_remote_finifunction vxlan_mdb_remote_src_entry_lookupfunction hlist_for_each_entryfunction vxlan_mdb_remote_src_entry_addfunction vxlan_mdb_remote_src_entry_delfunction vxlan_mdb_remote_src_fwd_addfunction vxlan_mdb_remote_src_fwd_delfunction vxlan_mdb_remote_src_addfunction vxlan_mdb_remote_src_delfunction vxlan_mdb_remote_srcs_addfunction list_for_each_entryfunction vxlan_mdb_remote_srcs_del
Annotated Snippet
struct vxlan_mdb_entry_key {
union vxlan_addr src;
union vxlan_addr dst;
__be32 vni;
};
struct vxlan_mdb_entry {
struct rhash_head rhnode;
struct list_head remotes;
struct vxlan_mdb_entry_key key;
struct hlist_node mdb_node;
struct rcu_head rcu;
};
#define VXLAN_MDB_REMOTE_F_BLOCKED BIT(0)
struct vxlan_mdb_remote {
struct list_head list;
struct vxlan_rdst __rcu *rd;
u8 flags;
u8 filter_mode;
u8 rt_protocol;
struct hlist_head src_list;
struct rcu_head rcu;
};
#define VXLAN_SGRP_F_DELETE BIT(0)
struct vxlan_mdb_src_entry {
struct hlist_node node;
union vxlan_addr addr;
u8 flags;
};
struct vxlan_mdb_dump_ctx {
long reserved;
long entry_idx;
long remote_idx;
};
struct vxlan_mdb_config_src_entry {
union vxlan_addr addr;
struct list_head node;
};
struct vxlan_mdb_config {
struct vxlan_dev *vxlan;
struct vxlan_mdb_entry_key group;
struct list_head src_list;
union vxlan_addr remote_ip;
u32 remote_ifindex;
__be32 remote_vni;
__be16 remote_port;
u16 nlflags;
u8 flags;
u8 filter_mode;
u8 rt_protocol;
};
struct vxlan_mdb_flush_desc {
union vxlan_addr remote_ip;
__be32 src_vni;
__be32 remote_vni;
__be16 remote_port;
u8 rt_protocol;
};
static const struct rhashtable_params vxlan_mdb_rht_params = {
.head_offset = offsetof(struct vxlan_mdb_entry, rhnode),
.key_offset = offsetof(struct vxlan_mdb_entry, key),
.key_len = sizeof(struct vxlan_mdb_entry_key),
.automatic_shrinking = true,
};
static int __vxlan_mdb_add(const struct vxlan_mdb_config *cfg,
struct netlink_ext_ack *extack);
static int __vxlan_mdb_del(const struct vxlan_mdb_config *cfg,
struct netlink_ext_ack *extack);
static void vxlan_br_mdb_entry_fill(const struct vxlan_dev *vxlan,
const struct vxlan_mdb_entry *mdb_entry,
const struct vxlan_mdb_remote *remote,
struct br_mdb_entry *e)
{
const union vxlan_addr *dst = &mdb_entry->key.dst;
memset(e, 0, sizeof(*e));
e->ifindex = vxlan->dev->ifindex;
e->state = MDB_PERMANENT;
Annotation
- Immediate include surface: `linux/if_bridge.h`, `linux/in.h`, `linux/list.h`, `linux/netdevice.h`, `linux/netlink.h`, `linux/rhashtable.h`, `linux/rhashtable-types.h`, `linux/rtnetlink.h`.
- Detected declarations: `struct vxlan_mdb_entry_key`, `struct vxlan_mdb_entry`, `struct vxlan_mdb_remote`, `struct vxlan_mdb_src_entry`, `struct vxlan_mdb_dump_ctx`, `struct vxlan_mdb_config_src_entry`, `struct vxlan_mdb_config`, `struct vxlan_mdb_flush_desc`, `function vxlan_br_mdb_entry_fill`, `function vxlan_mdb_entry_info_fill_srcs`.
- 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.