1# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 2--- 3name: ovs_packet 4version: 1 5protocol: genetlink-legacy 6uapi-header: linux/openvswitch.h 7 8doc: | 9 OVS packet execution over generic netlink. 10 11 Only OVS_PACKET_CMD_EXECUTE is exposed as a genl operation. 12 OVS_PACKET_CMD_MISS and OVS_PACKET_CMD_ACTION are kernel-to-userspace 13 upcalls sent via genlmsg_unicast() to the vport's upcall_pid and have 14 no associated genl_ops or multicast group. 15 16 Several attributes in the attribute set (userdata, egress-tun-key, len) 17 exist for the upcall path and are not used by the EXECUTE operation. 18 For EXECUTE, packet, key, and actions are mandatory (kernel returns 19 -EINVAL without them). 20 21definitions: 22 - 23 name: ovs-header 24 type: struct 25 members: 26 - 27 name: dp-ifindex 28 type: u32 29 30attribute-sets: 31 - 32 name: packet 33 name-prefix: ovs-packet-attr- 34 enum-name: ovs-packet-attr 35 attributes: 36 - 37 name: packet 38 type: binary 39 doc: Packet data, from the start of the Ethernet header. 40 checks: 41 min-len: 14 42 - 43 name: key 44 type: binary 45 doc: | 46 Nested OVS_KEY_ATTR_* attributes, extracted flow key. 47 Defined as binary because the key attribute-set belongs to the 48 ovs_flow family spec; cross-spec references are not supported. 49 - 50 name: actions 51 type: binary 52 doc: | 53 Nested OVS_ACTION_ATTR_* attributes. 54 Defined as binary for the same reason as key. 55 - 56 name: userdata 57 type: binary 58 doc: Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA. 59 - 60 name: egress-tun-key 61 type: binary 62 doc: Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata. 63 - 64 name: unused1 65 type: unused 66 - 67 name: unused2 68 type: unused 69 - 70 name: probe 71 type: flag 72 doc: Packet operation is a feature probe, error logging suppressed. 73 - 74 name: mru 75 type: u16 76 doc: Maximum received IP fragment size. 77 - 78 name: len 79 type: u32 80 doc: Packet size before truncation. 81 - 82 name: hash 83 type: u64 84 doc: Packet hash, low 32 bits are skb hash, upper bits are flags. 85 - 86 name: upcall-pid 87 type: u32 88 doc: Netlink PID to use for upcalls during EXECUTE processing. 89 90operations: 91 fixed-header: ovs-header 92 name-prefix: ovs-packet-cmd- 93 list: 94 - 95 name: miss 96 doc: Notify userspace of a flow table miss for a received packet. 97 value: 1 98 attribute-set: packet 99 event: 100 attributes: &event-attrs 101 - packet 102 - key 103 - userdata 104 - actions 105 - egress-tun-key 106 - mru 107 - len 108 - hash 109 - 110 name: action 111 doc: Notify userspace as requested by an OVS_ACTION_ATTR_USERSPACE action. 112 value: 2 113 attribute-set: packet 114 event: 115 attributes: *event-attrs 116 - 117 name: execute 118 doc: Apply actions to a packet. 119 value: 3 120 attribute-set: packet 121 do: 122 request: 123 attributes: 124 - packet 125 - key 126 - actions 127 - probe 128 - mru 129 - hash 130 - upcall-pid 131