net/openvswitch/dp_notify.c
Source file repositories/reference/linux-study-clean/net/openvswitch/dp_notify.c
File Facts
- System
- Linux kernel
- Corpus path
net/openvswitch/dp_notify.c- Extension
.c- Size
- 2040 bytes
- Lines
- 87
- 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/netdevice.hnet/genetlink.hnet/netns/generic.hdatapath.hvport-internal_dev.hvport-netdev.h
Detected Declarations
function Copyrightfunction ovs_dp_notify_wqfunction hlist_for_each_entry_safefunction dp_device_event
Annotated Snippet
hlist_for_each_entry_safe(vport, n, &dp->ports[i], dp_hash_node) {
if (vport->ops->type == OVS_VPORT_TYPE_INTERNAL)
continue;
if (!(netif_is_ovs_port(vport->dev)))
dp_detach_port_notify(vport);
}
}
}
ovs_unlock();
}
static int dp_device_event(struct notifier_block *unused, unsigned long event,
void *ptr)
{
struct ovs_net *ovs_net;
struct net_device *dev = netdev_notifier_info_to_dev(ptr);
struct vport *vport = NULL;
if (!ovs_is_internal_dev(dev))
vport = ovs_netdev_get_vport(dev);
if (!vport)
return NOTIFY_DONE;
if (event == NETDEV_UNREGISTER) {
/* upper_dev_unlink and decrement promisc immediately */
ovs_netdev_detach_dev(vport);
/* schedule vport destroy, dev_put and genl notification */
ovs_net = net_generic(dev_net(dev), ovs_net_id);
queue_work(system_percpu_wq, &ovs_net->dp_notify_work);
}
return NOTIFY_DONE;
}
struct notifier_block ovs_dp_device_notifier = {
.notifier_call = dp_device_event
};
Annotation
- Immediate include surface: `linux/netdevice.h`, `net/genetlink.h`, `net/netns/generic.h`, `datapath.h`, `vport-internal_dev.h`, `vport-netdev.h`.
- Detected declarations: `function Copyright`, `function ovs_dp_notify_wq`, `function hlist_for_each_entry_safe`, `function dp_device_event`.
- 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.