#include <rte_bitops.h>
#include <rte_mbuf.h>
#include <rte_mbuf_dyn.h>
+#include <rte_meter.h>
+#include <rte_gtp.h>
#ifdef __cplusplus
extern "C" {
* At least one direction must be specified.
*
* Specifying both directions at once for a given rule is not recommended
- * but may be valid in a few cases (e.g. shared counter).
+ * but may be valid in a few cases.
*/
struct rte_flow_attr {
uint32_t group; /**< Priority group. */
/** Default mask for RTE_FLOW_ITEM_TYPE_ETH. */
#ifndef __cplusplus
static const struct rte_flow_item_eth rte_flow_item_eth_mask = {
- .hdr.d_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
- .hdr.s_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+ .hdr.dst_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
+ .hdr.src_addr.addr_bytes = "\xff\xff\xff\xff\xff\xff",
.hdr.ether_type = RTE_BE16(0x0000),
};
#endif
* Matches a GTP PDU extension header with type 0x85.
*/
struct rte_flow_item_gtp_psc {
- uint8_t pdu_type; /**< PDU type. */
- uint8_t qfi; /**< PPP, RQI, QoS flow identifier. */
+ struct rte_gtp_psc_generic_hdr hdr; /**< gtp psc generic hdr. */
};
/** Default mask for RTE_FLOW_ITEM_TYPE_GTP_PSC. */
#ifndef __cplusplus
static const struct rte_flow_item_gtp_psc
rte_flow_item_gtp_psc_mask = {
- .qfi = 0xff,
+ .hdr.qfi = 0x3f,
};
#endif
};
#endif
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_INTEGRITY
+ *
+ * Match on packet integrity check result.
+ */
struct rte_flow_item_integrity {
- /**< Tunnel encapsulation level the item should apply to.
+ /** Tunnel encapsulation level the item should apply to.
* @see rte_flow_action_rss
*/
uint32_t level;
union {
__extension__
struct {
- /**< The packet is valid after passing all HW checks. */
+ /** The packet is valid after passing all HW checks. */
uint64_t packet_ok:1;
- /**< L2 layer is valid after passing all HW checks. */
+ /** L2 layer is valid after passing all HW checks. */
uint64_t l2_ok:1;
- /**< L3 layer is valid after passing all HW checks. */
+ /** L3 layer is valid after passing all HW checks. */
uint64_t l3_ok:1;
- /**< L4 layer is valid after passing all HW checks. */
+ /** L4 layer is valid after passing all HW checks. */
uint64_t l4_ok:1;
- /**< L2 layer CRC is valid. */
+ /** L2 layer CRC is valid. */
uint64_t l2_crc_ok:1;
- /**< IPv4 layer checksum is valid. */
+ /** IPv4 layer checksum is valid. */
uint64_t ipv4_csum_ok:1;
- /**< L4 layer checksum is valid. */
+ /** L4 layer checksum is valid. */
uint64_t l4_csum_ok:1;
- /**< The l3 length is smaller than the frame length. */
+ /** L3 length is smaller than frame length. */
uint64_t l3_len_ok:1;
uint64_t reserved:56;
};
* PKT_RX_FDIR_ID mbuf flags.
*
* See struct rte_flow_action_mark.
+ *
+ * One should negotiate mark delivery from the NIC to the PMD.
+ * @see rte_eth_rx_metadata_negotiate()
+ * @see RTE_ETH_RX_METADATA_USER_MARK
*/
RTE_FLOW_ACTION_TYPE_MARK,
* sets the PKT_RX_FDIR mbuf flag.
*
* No associated configuration structure.
+ *
+ * One should negotiate flag delivery from the NIC to the PMD.
+ * @see rte_eth_rx_metadata_negotiate()
+ * @see RTE_ETH_RX_METADATA_USER_FLAG
*/
RTE_FLOW_ACTION_TYPE_FLAG,
* @see struct rte_flow_action_conntrack.
*/
RTE_FLOW_ACTION_TYPE_CONNTRACK,
+
+ /**
+ * Color the packet to reflect the meter color result.
+ * Set the meter color in the mbuf to the selected color.
+ *
+ * See struct rte_flow_action_meter_color.
+ */
+ RTE_FLOW_ACTION_TYPE_METER_COLOR,
};
/**
* Counters can be retrieved and reset through ``rte_flow_query()``, see
* ``struct rte_flow_query_count``.
*
- * @deprecated Shared attribute is deprecated, use generic
- * RTE_FLOW_ACTION_TYPE_INDIRECT action.
- *
- * The shared flag indicates whether the counter is unique to the flow rule the
- * action is specified with, or whether it is a shared counter.
- *
- * For a count action with the shared flag set, then then a global device
- * namespace is assumed for the counter id, so that any matched flow rules using
- * a count action with the same counter id on the same port will contribute to
- * that counter.
- *
* For ports within the same switch domain then the counter id namespace extends
* to all ports within that switch domain.
*/
struct rte_flow_action_count {
- /** @deprecated Share counter ID with other flow rules. */
- uint32_t shared:1;
- uint32_t reserved:31; /**< Reserved, must be zero. */
uint32_t id; /**< Counter ID. */
};
uint32_t reserved:30;
};
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_METER_COLOR
+ *
+ * The meter color should be set in the packet meta-data
+ * (i.e. struct rte_mbuf::sched::color).
+ */
+struct rte_flow_action_meter_color {
+ enum rte_color color; /**< Packet color. */
+};
+
/**
* Field IDs for MODIFY_FIELD action.
*/
*RTE_FLOW_DYNF_METADATA(m) = v;
}
-/*
+/**
* Definition of a single action.
*
* A list of actions is terminated by a END action.
/**
* Populate the current packet processing state, if exists, for the given mbuf.
*
+ * One should negotiate tunnel metadata delivery from the NIC to the HW.
+ * @see rte_eth_rx_metadata_negotiate()
+ * @see RTE_ETH_RX_METADATA_TUNNEL_ID
+ *
* @param port_id
* Port identifier of Ethernet device.
* @param[in] m