summaryrefslogtreecommitdiff
path: root/Documentation/netlink/specs/ovs_packet.yaml
blob: e4c5f24b3b01eb895ecda7ad6bfff86aa1271652 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)
---
name: ovs_packet
version: 1
protocol: genetlink-legacy
uapi-header: linux/openvswitch.h

doc: |
  OVS packet execution over generic netlink.

  Only OVS_PACKET_CMD_EXECUTE is exposed as a genl operation.
  OVS_PACKET_CMD_MISS and OVS_PACKET_CMD_ACTION are kernel-to-userspace
  upcalls sent via genlmsg_unicast() to the vport's upcall_pid and have
  no associated genl_ops or multicast group.

  Several attributes in the attribute set (userdata, egress-tun-key, len)
  exist for the upcall path and are not used by the EXECUTE operation.
  For EXECUTE, packet, key, and actions are mandatory (kernel returns
  -EINVAL without them).

definitions:
  -
    name: ovs-header
    type: struct
    members:
      -
        name: dp-ifindex
        type: u32

attribute-sets:
  -
    name: packet
    name-prefix: ovs-packet-attr-
    enum-name: ovs-packet-attr
    attributes:
      -
        name: packet
        type: binary
        doc: Packet data, from the start of the Ethernet header.
        checks:
          min-len: 14
      -
        name: key
        type: binary
        doc: |
          Nested OVS_KEY_ATTR_* attributes, extracted flow key.
          Defined as binary because the key attribute-set belongs to the
          ovs_flow family spec; cross-spec references are not supported.
      -
        name: actions
        type: binary
        doc: |
          Nested OVS_ACTION_ATTR_* attributes.
          Defined as binary for the same reason as key.
      -
        name: userdata
        type: binary
        doc: Opaque userspace cookie from OVS_USERSPACE_ATTR_USERDATA.
      -
        name: egress-tun-key
        type: binary
        doc: Nested OVS_TUNNEL_KEY_ATTR_* for output tunnel metadata.
      -
        name: unused1
        type: unused
      -
        name: unused2
        type: unused
      -
        name: probe
        type: flag
        doc: Packet operation is a feature probe, error logging suppressed.
      -
        name: mru
        type: u16
        doc: Maximum received IP fragment size.
      -
        name: len
        type: u32
        doc: Packet size before truncation.
      -
        name: hash
        type: u64
        doc: Packet hash, low 32 bits are skb hash, upper bits are flags.
      -
        name: upcall-pid
        type: u32
        doc: Netlink PID to use for upcalls during EXECUTE processing.

operations:
  fixed-header: ovs-header
  name-prefix: ovs-packet-cmd-
  list:
    -
      name: miss
      doc: Notify userspace of a flow table miss for a received packet.
      value: 1
      attribute-set: packet
      event:
        attributes: &event-attrs
          - packet
          - key
          - userdata
          - actions
          - egress-tun-key
          - mru
          - len
          - hash
    -
      name: action
      doc: Notify userspace as requested by an OVS_ACTION_ATTR_USERSPACE action.
      value: 2
      attribute-set: packet
      event:
        attributes: *event-attrs
    -
      name: execute
      doc: Apply actions to a packet.
      value: 3
      attribute-set: packet
      do:
        request:
          attributes:
            - packet
            - key
            - actions
            - probe
            - mru
            - hash
            - upcall-pid