@@ -462,6 +462,8 @@ enum index {
ACTION_POL_R,
ACTION_PORT_REPRESENTOR,
ACTION_PORT_REPRESENTOR_PORT_ID,
+ ACTION_REPRESENTED_PORT,
+ ACTION_REPRESENTED_PORT_ETHDEV_PORT_ID,
};
/** Maximum size for pattern in struct rte_flow_item_raw. */
@@ -1455,6 +1457,7 @@ static const enum index next_action[] = {
ACTION_CONNTRACK,
ACTION_CONNTRACK_UPDATE,
ACTION_PORT_REPRESENTOR,
+ ACTION_REPRESENTED_PORT,
ZERO,
};
@@ -1742,6 +1745,12 @@ static const enum index action_port_representor[] = {
ZERO,
};
+static const enum index action_represented_port[] = {
+ ACTION_REPRESENTED_PORT_ETHDEV_PORT_ID,
+ ACTION_NEXT,
+ ZERO,
+};
+
static int parse_set_raw_encap_decap(struct context *, const struct token *,
const char *, unsigned int,
void *, unsigned int);
@@ -4846,6 +4855,23 @@ static const struct token token_list[] = {
port_id)),
.call = parse_vc_conf,
},
+ [ACTION_REPRESENTED_PORT] = {
+ .name = "represented_port",
+ .help = "at embedded switch level, send matching traffic to the entity represented by the given ethdev",
+ .priv = PRIV_ACTION(REPRESENTED_PORT,
+ sizeof(struct rte_flow_action_ethdev)),
+ .next = NEXT(action_represented_port),
+ .call = parse_vc,
+ },
+ [ACTION_REPRESENTED_PORT_ETHDEV_PORT_ID] = {
+ .name = "ethdev_port_id",
+ .help = "ethdev port ID",
+ .next = NEXT(action_represented_port,
+ NEXT_ENTRY(COMMON_UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY(struct rte_flow_action_ethdev,
+ port_id)),
+ .call = parse_vc_conf,
+ },
/* Indirect action destroy arguments. */
[INDIRECT_ACTION_DESTROY_ID] = {
.name = "action_id",
@@ -1532,6 +1532,8 @@ at the opposite end of the "wire" leading to the ethdev.
This item is meant to use the same structure as `Item: PORT_REPRESENTOR`_.
+See also `Action: REPRESENTED_PORT`_.
+
Actions
~~~~~~~
@@ -3160,6 +3162,53 @@ at the opposite end of the "wire" leading to the ethdev.
See also `Item: PORT_REPRESENTOR`_.
+Action: ``REPRESENTED_PORT``
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+At embedded switch level, send matching traffic to
+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 | <== | Matching Traffic |
+ '----------' '--------------------'
+ ||
+ ||
+ ||
+ \/
+ .----------------.
+ | Logical Port |
+ '----------------'
+ ||
+ \/
+ .--------------------.
+ | REPRESENTED_PORT | Net / Guest / Another Ethdev (Same Application)
+ '--------------------'
+
+
+- Requires `Attribute: Transfer`_.
+
+This action is meant to use the same structure as `Action: PORT_REPRESENTOR`_.
+
+See also `Item: REPRESENTED_PORT`_.
+
Negative types
~~~~~~~~~~~~~~
@@ -188,7 +188,7 @@ API Changes
Also, make sure to start the actual text at the margin.
=======================================================
-* ethdev: Added items ``PORT_REPRESENTOR``, ``REPRESENTED_PORT`` and action ``PORT_REPRESENTOR`` to flow API.
+* ethdev: Added items and actions ``PORT_REPRESENTOR``, ``REPRESENTED_PORT`` to flow API.
* kvargs: The experimental function ``rte_kvargs_strcmp()`` has been
removed. Its usages have been replaced by a new function
@@ -4084,6 +4084,11 @@ This section lists supported actions and their attributes, if any.
- ``port_id {unsigned}``: ethdev port ID
+- ``represented_port``: at embedded switch level, send matching traffic to
+ the entity represented by the given ethdev
+
+ - ``ethdev_port_id {unsigned}``: ethdev port ID
+
Destroying flow rules
~~~~~~~~~~~~~~~~~~~~~
@@ -192,6 +192,7 @@ static const struct rte_flow_desc_data rte_flow_desc_action[] = {
MK_FLOW_ACTION(INDIRECT, 0),
MK_FLOW_ACTION(CONNTRACK, sizeof(struct rte_flow_action_conntrack)),
MK_FLOW_ACTION(PORT_REPRESENTOR, sizeof(struct rte_flow_action_ethdev)),
+ MK_FLOW_ACTION(REPRESENTED_PORT, sizeof(struct rte_flow_action_ethdev)),
};
int
@@ -2454,6 +2454,14 @@ enum rte_flow_action_type {
* @see struct rte_flow_action_ethdev
*/
RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR,
+
+ /**
+ * At embedded switch level, send matching traffic to
+ * the entity represented by the given ethdev.
+ *
+ * @see struct rte_flow_action_ethdev
+ */
+ RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT,
};
/**
@@ -3218,7 +3226,8 @@ struct rte_flow_action_meter_color {
* @b EXPERIMENTAL: this structure may change without prior notice
*
* Provides an ethdev port ID for use with the following actions:
- * RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR.
+ * RTE_FLOW_ACTION_TYPE_PORT_REPRESENTOR,
+ * RTE_FLOW_ACTION_TYPE_REPRESENTED_PORT.
*/
struct rte_flow_action_ethdev {
uint16_t port_id; /**< ethdev port ID */