ACTION_SET_TP_SRC_TP_SRC,
ACTION_SET_TP_DST,
ACTION_SET_TP_DST_TP_DST,
+ ACTION_MAC_SWAP,
};
/** Maximum size for pattern in struct rte_flow_item_raw. */
ACTION_SET_IPV6_DST,
ACTION_SET_TP_SRC,
ACTION_SET_TP_DST,
+ ACTION_MAC_SWAP,
ZERO,
};
(struct rte_flow_action_set_tp, port)),
.call = parse_vc_conf,
},
+ [ACTION_MAC_SWAP] = {
+ .name = "mac_swap",
+ .help = "Swap the source and destination MAC addresses"
+ " in the outermost Ethernet header",
+ .priv = PRIV_ACTION(MAC_SWAP, 0),
+ .next = NEXT(NEXT_ENTRY(ACTION_NEXT)),
+ .call = parse_vc,
+ },
};
/** Remove and return last entry from argument stack. */
| ``port`` | new TCP/UDP destination port |
+---------------+-------------------------+
+Action: ``MAC_SWAP``
+^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Swap the source and destination MAC addresses in the outermost Ethernet
+header.
+
+It must be used with a valid RTE_FLOW_ITEM_TYPE_ETH flow pattern item.
+Otherwise, RTE_FLOW_ERROR_TYPE_ACTION error will be returned.
+
+.. _table_rte_flow_action_mac_swap:
+
+.. table:: MAC_SWAP
+
+ +---------------+
+ | Field |
+ +===============+
+ | no properties |
+ +---------------+
+
Negative types
~~~~~~~~~~~~~~
* Modify source and destination port numbers in the outermost TCP/UDP
headers.
+* **Added new Flow API action to swap MAC addresses in Ethernet header.**
+
+ Added new Flow API action to swap the source and destination MAC
+ addresses in the outermost Ethernet header.
+
* **Add support to offload more flow match and actions for CXGBE PMD**
Flow API support has been enhanced for CXGBE Poll Mode Driver to offload:
- ``port``: New TCP/UDP destination port number.
+- ``mac_swap``: Swap the source and destination MAC addresses in the outermost
+ Ethernet header.
+
Destroying flow rules
~~~~~~~~~~~~~~~~~~~~~
sizeof(struct rte_flow_action_set_tp)),
MK_FLOW_ACTION(SET_TP_DST,
sizeof(struct rte_flow_action_set_tp)),
+ MK_FLOW_ACTION(MAC_SWAP, 0),
};
static int
* See struct rte_flow_action_set_tp.
*/
RTE_FLOW_ACTION_TYPE_SET_TP_DST,
+
+ /**
+ * Swap the source and destination MAC addresses in the outermost
+ * Ethernet header.
+ *
+ * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_ETH,
+ * then the PMD should return a RTE_FLOW_ERROR_TYPE_ACTION error.
+ *
+ * No associated configuration structure.
+ */
+ RTE_FLOW_ACTION_TYPE_MAC_SWAP,
};
/**