include/uapi/linux/openvswitch.h
Source file repositories/reference/linux-study-clean/include/uapi/linux/openvswitch.h
File Facts
- System
- Linux kernel
- Corpus path
include/uapi/linux/openvswitch.h- Extension
.h- Size
- 45337 bytes
- Lines
- 1203
- Domain
- Core OS
- Bucket
- Core Kernel Interface
- Inferred role
- Core OS: implementation source
- Status
- source implementation candidate
Why This File Exists
Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/types.hlinux/if_ether.h
Detected Declarations
struct ovs_headerstruct ovs_dp_statsstruct ovs_dp_megaflow_statsstruct ovs_vport_statsstruct ovs_flow_statsstruct ovs_key_ethernetstruct ovs_key_mplsstruct ovs_key_ipv4struct ovs_key_ipv6struct ovs_key_ipv6_exthdrsstruct ovs_key_tcpstruct ovs_key_udpstruct ovs_key_sctpstruct ovs_key_icmpstruct ovs_key_icmpv6struct ovs_key_arpstruct ovs_key_ndstruct ovs_key_ct_labelsstruct ovs_key_ct_tuple_ipv4struct ovs_key_ct_tuple_ipv6struct ovs_nsh_key_basestruct ovs_nsh_key_md1struct sample_argstruct ovs_action_truncstruct ovs_action_push_mplsstruct ovs_action_add_mplsstruct ovs_action_push_vlanstruct ovs_action_hashstruct ovs_action_push_ethstruct check_pkt_len_argstruct ovs_zone_limitenum ovs_datapath_cmdenum ovs_datapath_attrenum ovs_packet_cmdenum ovs_packet_attrenum ovs_vport_cmdenum ovs_vport_typeenum ovs_vport_attrenum ovs_vport_upcall_attrenum ovs_flow_cmdenum ovs_key_attrenum ovs_tunnel_key_attrenum ovs_frag_typeenum ovs_nsh_key_attrenum ovs_flow_attrenum ovs_sample_attrenum ovs_userspace_attrenum ovs_hash_alg
Annotated Snippet
struct ovs_header {
int dp_ifindex;
};
/* Datapaths. */
#define OVS_DATAPATH_FAMILY "ovs_datapath"
#define OVS_DATAPATH_MCGROUP "ovs_datapath"
/* V2:
* - API users are expected to provide OVS_DP_ATTR_USER_FEATURES
* when creating the datapath.
*/
#define OVS_DATAPATH_VERSION 2
/* First OVS datapath version to support features */
#define OVS_DP_VER_FEATURES 2
enum ovs_datapath_cmd {
OVS_DP_CMD_UNSPEC,
OVS_DP_CMD_NEW,
OVS_DP_CMD_DEL,
OVS_DP_CMD_GET,
OVS_DP_CMD_SET
};
/**
* enum ovs_datapath_attr - attributes for %OVS_DP_* commands.
* @OVS_DP_ATTR_NAME: Name of the network device that serves as the "local
* port". This is the name of the network device whose dp_ifindex is given in
* the &struct ovs_header. Always present in notifications. Required in
* %OVS_DP_NEW requests. May be used as an alternative to specifying
* dp_ifindex in other requests (with a dp_ifindex of 0).
* @OVS_DP_ATTR_UPCALL_PID: The Netlink socket in userspace that is initially
* set on the datapath port (for OVS_ACTION_ATTR_MISS). Only valid on
* %OVS_DP_CMD_NEW requests. A value of zero indicates that upcalls should
* not be sent.
* @OVS_DP_ATTR_MASKS_CACHE_SIZE: Number of the entries in the flow table
* masks cache.
* @OVS_DP_ATTR_PER_CPU_PIDS: Per-cpu array of PIDs for upcalls when
* OVS_DP_F_DISPATCH_UPCALL_PER_CPU feature is set.
* @OVS_DP_ATTR_STATS: Statistics about packets that have passed through the
* datapath. Always present in notifications.
* @OVS_DP_ATTR_MEGAFLOW_STATS: Statistics about mega flow masks usage for the
* datapath. Always present in notifications.
* @OVS_DP_ATTR_USER_FEATURES: OVS_DP_F_* flags.
* @OVS_DP_ATTR_IFINDEX: Interface index for a new datapath netdev. Only
* valid for %OVS_DP_CMD_NEW requests.
*
* These attributes follow the &struct ovs_header within the Generic Netlink
* payload for %OVS_DP_* commands.
*/
enum ovs_datapath_attr {
/* private: */
OVS_DP_ATTR_UNSPEC,
/* public: */
OVS_DP_ATTR_NAME, /* name of dp_ifindex netdev */
OVS_DP_ATTR_UPCALL_PID, /* Netlink PID to receive upcalls */
OVS_DP_ATTR_STATS, /* struct ovs_dp_stats */
OVS_DP_ATTR_MEGAFLOW_STATS, /* struct ovs_dp_megaflow_stats */
OVS_DP_ATTR_USER_FEATURES, /* OVS_DP_F_* */
/* private: */
OVS_DP_ATTR_PAD,
/* public: */
OVS_DP_ATTR_MASKS_CACHE_SIZE,
OVS_DP_ATTR_PER_CPU_PIDS, /* Netlink PIDS to receive upcalls in
* per-cpu dispatch mode
*/
OVS_DP_ATTR_IFINDEX,
/* private: */
__OVS_DP_ATTR_MAX
};
#define OVS_DP_ATTR_MAX (__OVS_DP_ATTR_MAX - 1)
struct ovs_dp_stats {
__u64 n_hit; /* Number of flow table matches. */
__u64 n_missed; /* Number of flow table misses. */
__u64 n_lost; /* Number of misses not sent to userspace. */
__u64 n_flows; /* Number of flows present */
};
struct ovs_dp_megaflow_stats {
__u64 n_mask_hit; /* Number of masks used for flow lookups. */
__u32 n_masks; /* Number of masks for the datapath. */
__u32 pad0; /* Pad for future expension. */
__u64 n_cache_hit; /* Number of cache matches for flow lookups. */
__u64 pad1; /* Pad for future expension. */
};
Annotation
- Immediate include surface: `linux/types.h`, `linux/if_ether.h`.
- Detected declarations: `struct ovs_header`, `struct ovs_dp_stats`, `struct ovs_dp_megaflow_stats`, `struct ovs_vport_stats`, `struct ovs_flow_stats`, `struct ovs_key_ethernet`, `struct ovs_key_mpls`, `struct ovs_key_ipv4`, `struct ovs_key_ipv6`, `struct ovs_key_ipv6_exthdrs`.
- Atlas domain: Core OS / Core Kernel Interface.
- Implementation status: source 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.