-#define ODPL_ALL (ODPL_MISS | ODPL_ACTION)
-
-/* Format of messages read from datapath fd. */
-struct odp_msg {
- __u32 type; /* _ODPL_MISS_NR or _ODPL_ACTION_NR. */
- __u32 length; /* Message length, including header. */
- __u16 port; /* Port on which frame was received. */
- __u16 reserved;
- __u32 arg; /* Argument value specified in action. */
- /* Followed by packet data. */
+#define _ODPL_SFLOW_NR 2 /* sFlow samples. */
+#define ODPL_SFLOW (1 << _ODPL_SFLOW_NR)
+#define ODPL_ALL (ODPL_MISS | ODPL_ACTION | ODPL_SFLOW)
+
+enum odp_packet_type {
+ ODP_PACKET_ATTR_UNSPEC,
+ ODP_PACKET_ATTR_TYPE, /* 32-bit enum, one of _ODP_*_NR. */
+ ODP_PACKET_ATTR_PACKET, /* Packet data. */
+ ODP_PACKET_ATTR_KEY, /* Nested ODP_KEY_ATTR_* attributes. */
+ ODP_PACKET_ATTR_USERDATA, /* 64-bit data from ODPAT_CONTROLLER. */
+ ODP_PACKET_ATTR_SAMPLE_POOL, /* # sampling candidate packets so far. */
+ ODP_PACKET_ATTR_ACTIONS, /* Nested ODPAT_* attributes. */
+ __ODP_PACKET_ATTR_MAX
+};
+
+#define ODP_PACKET_ATTR_MAX (__ODP_PACKET_ATTR_MAX - 1)
+
+/**
+ * struct odp_packet - header for packets passed up between kernel and
+ * userspace.
+ * @dp_idx: Number of datapath to which the packet belongs.
+ * @len: Length of complete message, including this header.
+ *
+ * The header is followed by a sequence of Netlink attributes. The
+ * %ODP_PACKET_ATTR_TYPE, %ODP_PACKET_ATTR_PACKET, and %ODP_PACKET_ATTR_KEY
+ * attributes are always present. When @type == %_ODPL_ACTION_NR, the
+ * %ODP_PACKET_ATTR_USERDATA attribute is included if it would be nonzero.
+ * When @type == %_ODPL_SFLOW_NR, the %ODP_PACKET_ATTR_SAMPLE_POOL and
+ * %ODP_PACKET_ATTR_ACTIONS attributes are included.
+ *
+ * For @type of %_ODPL_ACTION_NR, %ODP_PACKET_ATTR_PACKET reflects changes made
+ * by actions preceding %ODPAT_CONTROLLER, but %ODP_PACKET_ATTR_KEY is the flow
+ * key extracted from the packet as originally received.
+ */
+struct odp_packet {
+ uint32_t dp_idx;
+ uint32_t len;