net/8021q/vlan_dev.c
Source file repositories/reference/linux-study-clean/net/8021q/vlan_dev.c
File Facts
- System
- Linux kernel
- Corpus path
net/8021q/vlan_dev.c- Extension
.c- Size
- 28760 bytes
- Lines
- 1088
- Domain
- Networking Core
- Bucket
- Sockets, Protocols, Packet Path, And Network Policy
- Inferred role
- Networking Core: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- 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/module.hlinux/slab.hlinux/skbuff.hlinux/netdevice.hlinux/net_tstamp.hlinux/etherdevice.hlinux/ethtool.hlinux/phy.hnet/arp.hnet/macsec.hnet/netdev_lock.hvlan.hvlanproc.hlinux/if_vlan.hlinux/netpoll.h
Detected Declarations
function vlan_dev_hard_headerfunction vlan_netpoll_send_skbfunction vlan_dev_hard_start_xmitfunction vlan_dev_change_mtufunction vlan_dev_set_ingress_priorityfunction vlan_dev_set_egress_priorityfunction vlan_dev_change_flagsfunction vlan_dev_get_realdev_namefunction vlan_dev_inherit_addressfunction vlan_dev_openfunction vlan_dev_stopfunction vlan_dev_set_mac_addressfunction vlan_hwtstamp_getfunction vlan_hwtstamp_setfunction vlan_dev_ioctlfunction vlan_dev_neigh_setupfunction vlan_dev_fcoe_ddp_setupfunction vlan_dev_fcoe_ddp_donefunction vlan_dev_fcoe_enablefunction vlan_dev_fcoe_disablefunction vlan_dev_fcoe_ddp_targetfunction vlan_dev_fcoe_get_wwnfunction vlan_dev_change_rx_flagsfunction vlan_dev_set_rx_modefunction vlan_parse_protocolfunction vlan_passthru_hard_headerfunction vlan_dev_initfunction vlan_dev_free_egress_priorityfunction vlan_dev_uninitfunction vlan_dev_fix_featuresfunction vlan_ethtool_get_link_ksettingsfunction vlan_ethtool_get_drvinfofunction vlan_ethtool_get_ts_infofunction vlan_dev_get_stats64function for_each_possible_cpufunction vlan_dev_poll_controllerfunction vlan_dev_netpoll_setupfunction vlan_dev_netpoll_cleanupfunction vlan_dev_get_iflinkfunction vlan_dev_fill_forward_pathfunction vlan_macsec_offloadfunction vlan_macsec_dev_openfunction vlan_macsec_dev_stopfunction vlan_macsec_add_secyfunction vlan_macsec_upd_secyfunction vlan_macsec_del_secyfunction vlan_macsec_add_rxscfunction vlan_macsec_upd_rxsc
Annotated Snippet
const struct net_device_ops *ops = real_dev->netdev_ops;
int err = 0;
if (netif_device_present(real_dev) && ops->ndo_neigh_setup)
err = ops->ndo_neigh_setup(real_dev, pa);
return err;
}
#if IS_ENABLED(CONFIG_FCOE)
static int vlan_dev_fcoe_ddp_setup(struct net_device *dev, u16 xid,
struct scatterlist *sgl, unsigned int sgc)
{
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
const struct net_device_ops *ops = real_dev->netdev_ops;
int rc = 0;
if (ops->ndo_fcoe_ddp_setup)
rc = ops->ndo_fcoe_ddp_setup(real_dev, xid, sgl, sgc);
return rc;
}
static int vlan_dev_fcoe_ddp_done(struct net_device *dev, u16 xid)
{
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
const struct net_device_ops *ops = real_dev->netdev_ops;
int len = 0;
if (ops->ndo_fcoe_ddp_done)
len = ops->ndo_fcoe_ddp_done(real_dev, xid);
return len;
}
static int vlan_dev_fcoe_enable(struct net_device *dev)
{
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
const struct net_device_ops *ops = real_dev->netdev_ops;
int rc = -EINVAL;
if (ops->ndo_fcoe_enable)
rc = ops->ndo_fcoe_enable(real_dev);
return rc;
}
static int vlan_dev_fcoe_disable(struct net_device *dev)
{
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
const struct net_device_ops *ops = real_dev->netdev_ops;
int rc = -EINVAL;
if (ops->ndo_fcoe_disable)
rc = ops->ndo_fcoe_disable(real_dev);
return rc;
}
static int vlan_dev_fcoe_ddp_target(struct net_device *dev, u16 xid,
struct scatterlist *sgl, unsigned int sgc)
{
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
const struct net_device_ops *ops = real_dev->netdev_ops;
int rc = 0;
if (ops->ndo_fcoe_ddp_target)
rc = ops->ndo_fcoe_ddp_target(real_dev, xid, sgl, sgc);
return rc;
}
#endif
#ifdef NETDEV_FCOE_WWNN
static int vlan_dev_fcoe_get_wwn(struct net_device *dev, u64 *wwn, int type)
{
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
const struct net_device_ops *ops = real_dev->netdev_ops;
int rc = -EINVAL;
if (ops->ndo_fcoe_get_wwn)
rc = ops->ndo_fcoe_get_wwn(real_dev, wwn, type);
return rc;
}
#endif
static void vlan_dev_change_rx_flags(struct net_device *dev, int change)
{
struct net_device *real_dev = vlan_dev_priv(dev)->real_dev;
if (change & IFF_ALLMULTI)
dev_set_allmulti(real_dev, dev->flags & IFF_ALLMULTI ? 1 : -1);
Annotation
- Immediate include surface: `linux/module.h`, `linux/slab.h`, `linux/skbuff.h`, `linux/netdevice.h`, `linux/net_tstamp.h`, `linux/etherdevice.h`, `linux/ethtool.h`, `linux/phy.h`.
- Detected declarations: `function vlan_dev_hard_header`, `function vlan_netpoll_send_skb`, `function vlan_dev_hard_start_xmit`, `function vlan_dev_change_mtu`, `function vlan_dev_set_ingress_priority`, `function vlan_dev_set_egress_priority`, `function vlan_dev_change_flags`, `function vlan_dev_get_realdev_name`, `function vlan_dev_inherit_address`, `function vlan_dev_open`.
- Atlas domain: Networking Core / Sockets, Protocols, Packet Path, And Network Policy.
- Implementation status: pattern implementation candidate.
- 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.