- RTE_FLOW_ITEM_TYPE_PPPOES: matches a PPPoE session header.
- RTE_FLOW_ITEM_TYPE_PPPOED: matches a PPPoE discovery header.
- RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID: matches a PPPoE session
protocol identifier.
Signed-off-by: Ying A Wang <ying.a.wang@intel.com>
Acked-by: Ori Kam <orika@mellanox.com>
Reviewed-by: Qi Zhang <qi.z.zhang@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
ITEM_GTP_PSC,
ITEM_GTP_PSC_QFI,
ITEM_GTP_PSC_PDU_T,
+ ITEM_PPPOES,
+ ITEM_PPPOED,
+ ITEM_PPPOE_SEID,
+ ITEM_PPPOE_PROTO_ID,
/* Validate/create actions. */
ACTIONS,
ITEM_META,
ITEM_GRE_KEY,
ITEM_GTP_PSC,
+ ITEM_PPPOES,
+ ITEM_PPPOED,
+ ITEM_PPPOE_PROTO_ID,
END_SET,
ZERO,
};
ZERO,
};
+static const enum index item_pppoed[] = {
+ ITEM_PPPOE_SEID,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_pppoes[] = {
+ ITEM_PPPOE_SEID,
+ ITEM_NEXT,
+ ZERO,
+};
+
+static const enum index item_pppoe_proto_id[] = {
+ ITEM_PPPOE_PROTO_ID,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index next_action[] = {
ACTION_END,
ACTION_VOID,
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gtp_psc,
pdu_type)),
},
-
+ [ITEM_PPPOES] = {
+ .name = "pppoes",
+ .help = "match PPPoE session header",
+ .priv = PRIV_ITEM(PPPOES, sizeof(struct rte_flow_item_pppoe)),
+ .next = NEXT(item_pppoes),
+ .call = parse_vc,
+ },
+ [ITEM_PPPOED] = {
+ .name = "pppoed",
+ .help = "match PPPoE discovery header",
+ .priv = PRIV_ITEM(PPPOED, sizeof(struct rte_flow_item_pppoe)),
+ .next = NEXT(item_pppoed),
+ .call = parse_vc,
+ },
+ [ITEM_PPPOE_SEID] = {
+ .name = "seid",
+ .help = "session identifier",
+ .next = NEXT(item_pppoes, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_pppoe,
+ session_id)),
+ },
+ [ITEM_PPPOE_PROTO_ID] = {
+ .name = "proto_id",
+ .help = "match PPPoE session protocol identifier",
+ .priv = PRIV_ITEM(PPPOE_PROTO_ID,
+ sizeof(struct rte_flow_item_pppoe_proto_id)),
+ .next = NEXT(item_pppoe_proto_id),
+ .call = parse_vc,
+ },
/* Validate/create actions. */
[ACTIONS] = {
.name = "actions",
case RTE_FLOW_ITEM_TYPE_GTP_PSC:
mask = &rte_flow_item_gtp_psc_mask;
break;
+ case RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID:
+ mask = &rte_flow_item_pppoe_proto_id_mask;
default:
break;
}
- ``qfi``: QoS flow identifier.
- Default ``mask`` matches QFI only.
+Item: ``PPPOES``, ``PPPOED``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Matches a PPPoE header.
+
+- ``version_type``: version (4b), type (4b).
+- ``code``: message type.
+- ``session_id``: session identifier.
+- ``length``: payload length.
+
+Item: ``PPPOE_PROTO_ID``
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+Matches a PPPoE session protocol identifier.
+
+- ``proto_id``: PPP protocol identifier.
+- Default ``mask`` matches proto_id only.
+
+
.. _table_rte_flow_item_meta:
.. table:: META
- ``pdu_type {unsigned}``: PDU type.
- ``qfi {unsigned}``: QoS flow identifier.
+- ``pppoes``, ``pppoed``: match PPPoE header.
+
+ - ``session_id {unsigned}``: session identifier.
+
+- ``pppoe_proto_id``: match PPPoE session protocol identifier.
+
+ - ``proto_id {unsigned}``: PPP protocol identifier.
+
Actions list
^^^^^^^^^^^^
MK_FLOW_ITEM(META, sizeof(struct rte_flow_item_meta)),
MK_FLOW_ITEM(GRE_KEY, sizeof(rte_be32_t)),
MK_FLOW_ITEM(GTP_PSC, sizeof(struct rte_flow_item_gtp_psc)),
+ MK_FLOW_ITEM(PPPOES, sizeof(struct rte_flow_item_pppoe)),
+ MK_FLOW_ITEM(PPPOED, sizeof(struct rte_flow_item_pppoe)),
+ MK_FLOW_ITEM(PPPOE_PROTO_ID,
+ sizeof(struct rte_flow_item_pppoe_proto_id)),
};
/** Generate flow_action[] entry. */
* See struct rte_flow_item_gtp_psc.
*/
RTE_FLOW_ITEM_TYPE_GTP_PSC,
+
+ /**
+ * Matches a PPPoE header.
+ *
+ * Configure flow for PPPoE session packets.
+ *
+ * See struct rte_flow_item_pppoe.
+ */
+ RTE_FLOW_ITEM_TYPE_PPPOES,
+
+ /**
+ * Matches a PPPoE header.
+ *
+ * Configure flow for PPPoE discovery packets.
+ *
+ * See struct rte_flow_item_pppoe.
+ */
+ RTE_FLOW_ITEM_TYPE_PPPOED,
+
+ /**
+ * Matches a PPPoE optional proto_id field.
+ *
+ * It only applies to PPPoE session packets.
+ *
+ * See struct rte_flow_item_pppoe_proto_id.
+ */
+ RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID,
};
/**
};
#endif
+/**
+ * RTE_FLOW_ITEM_TYPE_PPPOE.
+ *
+ * Matches a PPPoE header.
+ */
+struct rte_flow_item_pppoe {
+ /**
+ * Version (4b), type (4b).
+ */
+ uint8_t version_type;
+ uint8_t code; /**< Message type. */
+ rte_be16_t session_id; /**< Session identifier. */
+ rte_be16_t length; /**< Payload length. */
+};
+
+/**
+ * RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID.
+ *
+ * Matches a PPPoE optional proto_id field.
+ *
+ * It only applies to PPPoE session packets.
+ *
+ * Normally preceded by any of:
+ *
+ * - RTE_FLOW_ITEM_TYPE_PPPOE
+ * - RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID
+ */
+struct rte_flow_item_pppoe_proto_id {
+ rte_be16_t proto_id; /**< PPP protocol identifier. */
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_PPPOE_PROTO_ID. */
+#ifndef __cplusplus
+static const struct rte_flow_item_pppoe_proto_id
+rte_flow_item_pppoe_proto_id_mask = {
+ .proto_id = RTE_BE16(0xffff),
+};
+#endif
+
/**
* @warning
* @b EXPERIMENTAL: this structure may change without prior notice