ITEM_ESP_SPI,
ITEM_AH,
ITEM_AH_SPI,
+ ITEM_PFCP,
+ ITEM_PFCP_S_FIELD,
+ ITEM_PFCP_SEID,
/* Validate/create actions. */
ACTIONS,
ITEM_L2TPV3OIP,
ITEM_ESP,
ITEM_AH,
+ ITEM_PFCP,
END_SET,
ZERO,
};
ZERO,
};
+static const enum index item_pfcp[] = {
+ ITEM_PFCP_S_FIELD,
+ ITEM_PFCP_SEID,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index next_set_raw[] = {
SET_RAW_INDEX,
ITEM_ETH,
.next = NEXT(item_ah, NEXT_ENTRY(UNSIGNED), item_param),
.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_ah, spi)),
},
+ [ITEM_PFCP] = {
+ .name = "pfcp",
+ .help = "match pfcp header",
+ .priv = PRIV_ITEM(PFCP, sizeof(struct rte_flow_item_pfcp)),
+ .next = NEXT(item_pfcp),
+ .call = parse_vc,
+ },
+ [ITEM_PFCP_S_FIELD] = {
+ .name = "s_field",
+ .help = "S field",
+ .next = NEXT(item_pfcp, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_pfcp,
+ s_field)),
+ },
+ [ITEM_PFCP_SEID] = {
+ .name = "seid",
+ .help = "session endpoint identifier",
+ .next = NEXT(item_pfcp, NEXT_ENTRY(UNSIGNED), item_param),
+ .args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_pfcp, seid)),
+ },
/* Validate/create actions. */
[ACTIONS] = {
.name = "actions",
case RTE_FLOW_ITEM_TYPE_AH:
mask = &rte_flow_item_ah_mask;
break;
+ case RTE_FLOW_ITEM_TYPE_PFCP:
+ mask = &rte_flow_item_pfcp_mask;
+ break;
default:
break;
}
size = sizeof(struct rte_flow_item_ah);
proto = 0x33;
break;
+ case RTE_FLOW_ITEM_TYPE_PFCP:
+ size = sizeof(struct rte_flow_item_pfcp);
+ break;
default:
printf("Error - Not supported item\n");
*total_size = 0;
- ``session_id``: L2TPv3 over IP session identifier.
- Default ``mask`` matches session_id only.
+Item: ``PFCP``
+^^^^^^^^^^^^^^
+
+Matches a PFCP Header.
+
+- ``s_field``: S field.
+- ``msg_type``: message type.
+- ``msg_len``: message length.
+- ``seid``: session endpoint identifier.
+- Default ``mask`` matches s_field and seid.
+
Actions
~~~~~~~
- ``spi {unsigned}``: security parameters index.
+- ``pfcp``: match PFCP header.
+
+ - ``s_field {unsigned}``: S field.
+ - ``seid {unsigned}``: session endpoint identifier.
+
Actions list
^^^^^^^^^^^^
testpmd> flow create 0 ingress pattern eth / ipv6 / udp / ah spi is 1 / end
actions queue index 3 / end
+Sample PFCP rules
+~~~~~~~~~~~~~~~~~
+
+PFCP rules can be created by the following commands(s_field need to be 1
+if seid is set)::
+
+ testpmd> flow create 0 ingress pattern eth / ipv4 / pfcp s_field is 0 / end
+ actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv4 / pfcp s_field is 1
+ seid is 1 / end actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv6 / pfcp s_field is 0 / end
+ actions queue index 3 / end
+ testpmd> flow create 0 ingress pattern eth / ipv6 / pfcp s_field is 1
+ seid is 1 / end actions queue index 3 / end
+
BPF Functions
--------------
MK_FLOW_ITEM(AH, sizeof(struct rte_flow_item_ah)),
MK_FLOW_ITEM(HIGIG2, sizeof(struct rte_flow_item_higig2_hdr)),
MK_FLOW_ITEM(L2TPV3OIP, sizeof(struct rte_flow_item_l2tpv3oip)),
+ MK_FLOW_ITEM(PFCP, sizeof(struct rte_flow_item_pfcp)),
};
/** Generate flow_action[] entry. */
*/
RTE_FLOW_ITEM_TYPE_L2TPV3OIP,
+ /**
+ * Matches PFCP Header.
+ * See struct rte_flow_item_pfcp.
+ *
+ */
+ RTE_FLOW_ITEM_TYPE_PFCP,
+
};
/**
};
#endif
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ITEM_TYPE_PFCP
+ *
+ * Match PFCP Header
+ */
+struct rte_flow_item_pfcp {
+ uint8_t s_field;
+ uint8_t msg_type;
+ rte_be16_t msg_len;
+ rte_be64_t seid;
+};
+
+/** Default mask for RTE_FLOW_ITEM_TYPE_PFCP. */
+#ifndef __cplusplus
+static const struct rte_flow_item_pfcp rte_flow_item_pfcp_mask = {
+ .s_field = 0x01,
+ .seid = RTE_BE64(0xffffffffffffffff),
+};
+#endif
+
/**
* Matching pattern item definition.
*