loopback/hairpin packet, metadata set on Rx/Tx may or may not be propagated to
the other path depending on HW capability.
+In hairpin case with Tx explicit flow mode, metadata could (not mandatory) be
+used to connect the Rx and Tx flows if it can be propagated from Rx to Tx path.
+
.. _table_rte_flow_action_set_meta:
.. table:: SET_META
* **Updated the ethdev library to support hairpin between two ports.**
New APIs are introduced to support binding / unbinding 2 ports hairpin.
+ Hairpin Tx part flow rules can be inserted explicitly.
* **Updated Broadcom bnxt driver.**
Applications should use the new values for identification of existing
extensions in the packet header.
+ * ``struct rte_eth_hairpin_conf`` has two new members:
+
+ * ``uint32_t tx_explicit:1;``
+ * ``uint32_t manual_bind:1;``
+
* eventdev: Following structures are modified to support DLB/DLB2 PMDs
and future extensions:
}
if (conf->peer_count > cap.max_rx_2_tx) {
RTE_ETHDEV_LOG(ERR,
- "Invalid value for number of peers for Rx queue(=%hu), should be: <= %hu",
+ "Invalid value for number of peers for Rx queue(=%u), should be: <= %hu",
conf->peer_count, cap.max_rx_2_tx);
return -EINVAL;
}
if (conf->peer_count == 0) {
RTE_ETHDEV_LOG(ERR,
- "Invalid value for number of peers for Rx queue(=%hu), should be: > 0",
+ "Invalid value for number of peers for Rx queue(=%u), should be: > 0",
conf->peer_count);
return -EINVAL;
}
}
if (conf->peer_count > cap.max_tx_2_rx) {
RTE_ETHDEV_LOG(ERR,
- "Invalid value for number of peers for Tx queue(=%hu), should be: <= %hu",
+ "Invalid value for number of peers for Tx queue(=%u), should be: <= %hu",
conf->peer_count, cap.max_tx_2_rx);
return -EINVAL;
}
if (conf->peer_count == 0) {
RTE_ETHDEV_LOG(ERR,
- "Invalid value for number of peers for Tx queue(=%hu), should be: > 0",
+ "Invalid value for number of peers for Tx queue(=%u), should be: > 0",
conf->peer_count);
return -EINVAL;
}
* A structure used to configure hairpin binding.
*/
struct rte_eth_hairpin_conf {
- uint16_t peer_count; /**< The number of peers. */
+ uint32_t peer_count:16; /**< The number of peers. */
+
+ /**
+ * Explicit Tx flow rule mode.
+ * One hairpin pair of queues should have the same attribute.
+ *
+ * - When set, the user should be responsible for inserting the hairpin
+ * Tx part flows and removing them.
+ * - When clear, the PMD will try to handle the Tx part of the flows,
+ * e.g., by splitting one flow into two parts.
+ */
+ uint32_t tx_explicit:1;
+
+ /**
+ * Manually bind hairpin queues.
+ * One hairpin pair of queues should have the same attribute.
+ *
+ * - When set, to enable hairpin, the user should call the hairpin bind
+ * function after all the queues are set up properly and the ports are
+ * started. Also, the hairpin unbind function should be called
+ * accordingly before stopping a port that with hairpin configured.
+ * - When clear, the PMD will try to enable the hairpin with the queues
+ * configured automatically during port start.
+ */
+ uint32_t manual_bind:1;
+ uint32_t reserved:14; /**< Reserved bits. */
struct rte_eth_hairpin_peer peers[RTE_ETH_MAX_HAIRPIN_PEERS];
};