ITEM_POL_POLICY,
ITEM_PORT_REPRESENTOR,
ITEM_PORT_REPRESENTOR_PORT_ID,
+ ITEM_REPRESENTED_PORT,
+ ITEM_REPRESENTED_PORT_ETHDEV_PORT_ID,
/* Validate/create actions. */
ACTIONS,
ITEM_INTEGRITY,
ITEM_CONNTRACK,
ITEM_PORT_REPRESENTOR,
+ ITEM_REPRESENTED_PORT,
END_SET,
ZERO,
};
ZERO,
};
+static const enum index item_represented_port[] = {
+ ITEM_REPRESENTED_PORT_ETHDEV_PORT_ID,
+ ITEM_NEXT,
+ ZERO,
+};
+
static const enum index next_action[] = {
ACTION_END,
ACTION_VOID,
item_param),
.args = ARGS(ARGS_ENTRY(struct rte_flow_item_ethdev, port_id)),
},
+ [ITEM_REPRESENTED_PORT] = {
+ .name = "represented_port",
+ .help = "match traffic entering the embedded switch from the entity represented by the given ethdev",
+ .priv = PRIV_ITEM(REPRESENTED_PORT,
+ sizeof(struct rte_flow_item_ethdev)),
+ .next = NEXT(item_represented_port),
+ .call = parse_vc,
+ },
+ [ITEM_REPRESENTED_PORT_ETHDEV_PORT_ID] = {
+ .name = "ethdev_port_id",
+ .help = "ethdev port ID",
+ .next = NEXT(item_represented_port, NEXT_ENTRY(COMMON_UNSIGNED),
+ item_param),
+ .args = ARGS(ARGS_ENTRY(struct rte_flow_item_ethdev, port_id)),
+ },
/* Validate/create actions. */
[ACTIONS] = {
.name = "actions",
mask = &rte_flow_item_pfcp_mask;
break;
case RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR:
+ case RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT:
mask = &rte_flow_item_ethdev_mask;
break;
default:
pppoes =
pppoe_proto_id =
raw =
+represented_port =
sctp =
tag =
tcp =
- Default ``mask`` provides exact match behaviour.
+Item: ``REPRESENTED_PORT``
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Matches traffic entering the embedded switch from
+the entity represented by the given ethdev.
+
+Term **ethdev** and the concept of **port representor** are synonymous.
+The **represented port** is an *entity* plugged to the embedded switch
+at the opposite end of the "wire" leading to the ethdev.
+
+::
+
+ .--------------------.
+ | PORT_REPRESENTOR | Ethdev (Application Port Referred to by its ID)
+ '--------------------'
+ :
+ :
+ .----------------.
+ | Logical Port |
+ '----------------'
+ :
+ :
+ :
+ :
+ .----------.
+ | Switch |
+ '----------'
+ /\
+ ||
+ ||
+ ||
+ .----------------.
+ | Logical Port |
+ '----------------'
+ /\
+ ||
+ .--------------------.
+ | REPRESENTED_PORT | Net / Guest / Another Ethdev (Same Application)
+ '--------------------'
+
+
+- Incompatible with `Attribute: Traffic direction`_.
+- Requires `Attribute: Transfer`_.
+
+This item is meant to use the same structure as `Item: PORT_REPRESENTOR`_.
+
Actions
~~~~~~~
* net: Renamed ``s_addr`` and ``d_addr`` fields of ``rte_ether_hdr`` structure
to ``src_addr`` and ``dst_addr``, respectively.
-* ethdev: Added item ``PORT_REPRESENTOR`` to flow API.
+* ethdev: Added items ``PORT_REPRESENTOR``, ``REPRESENTED_PORT`` to flow API.
* cryptodev: The API rte_cryptodev_pmd_is_valid_dev is modified to
rte_cryptodev_is_valid_dev as it can be used by the application as
- ``port_id {unsigned}``: ethdev port ID
+- ``represented_port``: match traffic entering the embedded switch from
+ the entity represented by the given ethdev
+
+ - ``ethdev_port_id {unsigned}``: ethdev port ID
+
Actions list
^^^^^^^^^^^^
MK_FLOW_ITEM(INTEGRITY, sizeof(struct rte_flow_item_integrity)),
MK_FLOW_ITEM(CONNTRACK, sizeof(uint32_t)),
MK_FLOW_ITEM(PORT_REPRESENTOR, sizeof(struct rte_flow_item_ethdev)),
+ MK_FLOW_ITEM(REPRESENTED_PORT, sizeof(struct rte_flow_item_ethdev)),
};
/** Generate flow_action[] entry. */
* @see struct rte_flow_item_ethdev
*/
RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR,
+
+ /**
+ * [META]
+ *
+ * Matches traffic entering the embedded switch from
+ * the entity represented by the given ethdev.
+ *
+ * @see struct rte_flow_item_ethdev
+ */
+ RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT,
};
/**
* @b EXPERIMENTAL: this structure may change without prior notice
*
* Provides an ethdev port ID for use with the following items:
- * RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR.
+ * RTE_FLOW_ITEM_TYPE_PORT_REPRESENTOR,
+ * RTE_FLOW_ITEM_TYPE_REPRESENTED_PORT.
*/
struct rte_flow_item_ethdev {
uint16_t port_id; /**< ethdev port ID */