@@ -462,6 +462,8 @@ enum index {
ACTION_POL_R,
ACTION_ETHDEV,
ACTION_ETHDEV_ID,
+ ACTION_ESWITCH_PORT,
+ ACTION_ESWITCH_PORT_ETHDEV_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_ETHDEV,
+ ACTION_ESWITCH_PORT,
ZERO,
};
@@ -1742,6 +1745,12 @@ static const enum index action_ethdev[] = {
ZERO,
};
+static const enum index action_eswitch_port[] = {
+ ACTION_ESWITCH_PORT_ETHDEV_ID,
+ ACTION_NEXT,
+ ZERO,
+};
+
static int parse_set_raw_encap_decap(struct context *, const struct token *,
const char *, unsigned int,
void *, unsigned int);
@@ -4844,6 +4853,21 @@ static const struct token token_list[] = {
.args = ARGS(ARGS_ENTRY(struct rte_flow_action_ethdev, id)),
.call = parse_vc_conf,
},
+ [ACTION_ESWITCH_PORT] = {
+ .name = "eswitch_port",
+ .help = "at e-switch level, direct matching packets to the external port associated with the given ethdev",
+ .priv = PRIV_ACTION(ESWITCH_PORT,
+ sizeof(struct rte_flow_action_ethdev)),
+ .next = NEXT(action_eswitch_port),
+ .call = parse_vc,
+ },
+ [ACTION_ESWITCH_PORT_ETHDEV_ID] = {
+ .name = "ethdev_id",
+ .help = "ethdev ID",
+ .next = NEXT(action_eswitch_port, NEXT_ENTRY(COMMON_UNSIGNED)),
+ .args = ARGS(ARGS_ENTRY(struct rte_flow_action_ethdev, id)),
+ .call = parse_vc_conf,
+ },
/* Indirect action destroy arguments. */
[INDIRECT_ACTION_DESTROY_ID] = {
.name = "action_id",
@@ -3087,6 +3087,30 @@ See `Item: ETHDEV`_.
| ``id`` | ethdev ID |
+--------+-----------+
+Action: ``ESWITCH_PORT``
+^^^^^^^^^^^^^^^^^^^^^^^^
+At e-switch level, directs matching packets to the external port
+associated with the given ethdev, that is, to net. port or guest.
+
+These packets can originate from any of e-switch ports, not
+just the ones associated with the given ethdev. They come
+from the match engine in general, as per some criteria.
+
+::
+
+ * (Ethdev) ~~~~~~~~~~~~ (Internal Port) ~~~~ [] >>>> (External Port)
+ * : SW : Logical Net / Guest :
+ * : : :
+ * | ---- PMD Layer ---- | ------------ E-Switch Layer ------------ |
+ *
+ * [] shows the effective ("transfer") standpoint, the action engine;
+ * >> shows the traffic flow in question established by the action;
+ * ~~ shows logical interconnects between the endpoints.
+
+See `Item: ESWITCH_PORT`_.
+
+This action is meant to use the same structure as `Action: ETHDEV`_.
+
Negative types
~~~~~~~~~~~~~~
@@ -167,7 +167,7 @@ API Changes
Also, make sure to start the actual text at the margin.
=======================================================
-* ethdev: Added items ``ETHDEV``, ``ESWITCH_PORT`` and action ``ETHDEV`` to flow API.
+* ethdev: Added items and actions ``ETHDEV``, ``ESWITCH_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
@@ -4107,6 +4107,10 @@ This section lists supported actions and their attributes, if any.
- ``id {unsigned}``: ethdev ID
+- ``eswitch_port``: at e-switch level, direct matching packets to the external port associated with the given ethdev
+
+ - ``ethdev_id {unsigned}``: ethdev 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(ETHDEV, sizeof(struct rte_flow_action_ethdev)),
+ MK_FLOW_ACTION(ESWITCH_PORT, sizeof(struct rte_flow_action_ethdev)),
};
int
@@ -2453,6 +2453,14 @@ enum rte_flow_action_type {
* @see struct rte_flow_action_ethdev
*/
RTE_FLOW_ACTION_TYPE_ETHDEV,
+
+ /**
+ * At e-switch level, directs matching packets to the external port
+ * associated with the given ethdev, that is, to net. port or guest.
+ *
+ * @see struct rte_flow_action_ethdev
+ */
+ RTE_FLOW_ACTION_TYPE_ESWITCH_PORT,
};
/**
@@ -3217,7 +3225,7 @@ struct rte_flow_action_meter_color {
* @b EXPERIMENTAL: this structure may change without prior notice
*
* Provides an ethdev ID for use with actions which are as follows:
- * RTE_FLOW_ACTION_TYPE_ETHDEV.
+ * RTE_FLOW_ACTION_TYPE_ETHDEV, RTE_FLOW_ACTION_TYPE_ESWITCH_PORT.
*/
struct rte_flow_action_ethdev {
uint16_t id; /**< Ethdev ID */