ethdev: add flow API actions to modify TCP/UDP port numbers
[dpdk.git] / lib / librte_ethdev / rte_flow.h
index 942165f..0805906 100644 (file)
@@ -1546,6 +1546,28 @@ enum rte_flow_action_type {
         * See struct rte_flow_action_set_ipv6.
         */
        RTE_FLOW_ACTION_TYPE_SET_IPV6_DST,
+
+       /**
+        * Modify source port number in the outermost TCP/UDP header.
+        *
+        * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_TCP
+        * or RTE_FLOW_ITEM_TYPE_UDP, then the PMD should return a
+        * RTE_FLOW_ERROR_TYPE_ACTION error.
+        *
+        * See struct rte_flow_action_set_tp.
+        */
+       RTE_FLOW_ACTION_TYPE_SET_TP_SRC,
+
+       /**
+        * Modify destination port number in the outermost TCP/UDP header.
+        *
+        * If flow pattern does not define a valid RTE_FLOW_ITEM_TYPE_TCP
+        * or RTE_FLOW_ITEM_TYPE_UDP, then the PMD should return a
+        * RTE_FLOW_ERROR_TYPE_ACTION error.
+        *
+        * See struct rte_flow_action_set_tp.
+        */
+       RTE_FLOW_ACTION_TYPE_SET_TP_DST,
 };
 
 /**
@@ -1939,6 +1961,21 @@ struct rte_flow_action_set_ipv6 {
        uint8_t ipv6_addr[16];
 };
 
+/**
+ * @warning
+ * @b EXPERIMENTAL: this structure may change without prior notice
+ *
+ * RTE_FLOW_ACTION_TYPE_SET_TP_SRC
+ * RTE_FLOW_ACTION_TYPE_SET_TP_DST
+ *
+ * Allows modification of source (RTE_FLOW_ACTION_TYPE_SET_TP_SRC)
+ * and destination (RTE_FLOW_ACTION_TYPE_SET_TP_DST) port numbers
+ * in the specified outermost TCP/UDP header.
+ */
+struct rte_flow_action_set_tp {
+       rte_be16_t port;
+};
+
 /*
  * Definition of a single action.
  *