@@ -139,6 +139,11 @@ New Features
Hairpin Tx part flow rules can be inserted explicitly.
New API is added to get the hairpin peer ports list.
+* **ethdev: add 1 new EXPERIMENTAL API for PMD power management.**
+
+ * ``rte_eth_get_wake_addr()``
+ * add new eth_dev_ops ``get_wake_addr``
+
* **Updated Broadcom bnxt driver.**
Updated the Broadcom bnxt driver with new features and improvements, including:
@@ -5138,6 +5138,29 @@ rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
dev->dev_ops->tx_burst_mode_get(dev, queue_id, mode));
}
+int
+rte_eth_get_wake_addr(uint16_t port_id, uint16_t queue_id,
+ volatile void **wake_addr, uint64_t *expected, uint64_t *mask,
+ uint8_t *data_sz)
+{
+ struct rte_eth_dev *dev;
+
+ RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);
+
+ dev = &rte_eth_devices[port_id];
+
+ RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->get_wake_addr, -ENOTSUP);
+
+ if (queue_id >= dev->data->nb_rx_queues) {
+ RTE_ETHDEV_LOG(ERR, "Invalid RX queue_id=%u\n", queue_id);
+ return -EINVAL;
+ }
+
+ return eth_err(port_id,
+ dev->dev_ops->get_wake_addr(dev->data->rx_queues[queue_id],
+ wake_addr, expected, mask, data_sz));
+}
+
int
rte_eth_dev_set_mc_addr_list(uint16_t port_id,
struct rte_ether_addr *mc_addr_set,
@@ -4364,6 +4364,34 @@ __rte_experimental
int rte_eth_tx_burst_mode_get(uint16_t port_id, uint16_t queue_id,
struct rte_eth_burst_mode *mode);
+/**
+ * Retrieve the wake up address for the receive queue.
+ *
+ * @param port_id
+ * The port identifier of the Ethernet device.
+ * @param queue_id
+ * The Rx queue on the Ethernet device for which information will be
+ * retrieved.
+ * @param wake_addr
+ * The pointer to the address which will be monitored.
+ * @param expected
+ * The pointer to value to be expected when descriptor is set.
+ * @param mask
+ * The pointer to comparison bitmask for the expected value.
+ * @param data_sz
+ * The pointer to data size for the expected value and comparison bitmask.
+ *
+ * @return
+ * - 0: Success.
+ * -ENOTSUP: Operation not supported.
+ * -EINVAL: Invalid parameters.
+ * -ENODEV: Invalid port ID.
+ */
+__rte_experimental
+int rte_eth_get_wake_addr(uint16_t port_id, uint16_t queue_id,
+ volatile void **wake_addr, uint64_t *expected, uint64_t *mask,
+ uint8_t *data_sz);
+
/**
* Retrieve device registers and register attributes (number of registers and
* register size)
@@ -752,6 +752,32 @@ typedef int (*eth_hairpin_queue_peer_unbind_t)
(struct rte_eth_dev *dev, uint16_t cur_queue, uint32_t direction);
/**< @internal Unbind peer queue from the current queue. */
+/**
+ * @internal
+ * Get address of memory location whose contents will change whenever there is
+ * new data to be received on an RX queue.
+ *
+ * @param rxq
+ * Ethdev queue pointer.
+ * @param tail_desc_addr
+ * The pointer point to where the address will be stored.
+ * @param expected
+ * The pointer point to value to be expected when descriptor is set.
+ * @param mask
+ * The pointer point to comparison bitmask for the expected value.
+ * @param data_sz
+ * Data size for the expected value (can be 1, 2, 4, or 8 bytes)
+ * @return
+ * Negative errno value on error, 0 on success.
+ *
+ * @retval 0
+ * Success
+ * @retval -EINVAL
+ * Invalid parameters
+ */
+typedef int (*eth_get_wake_addr_t)(void *rxq, volatile void **tail_desc_addr,
+ uint64_t *expected, uint64_t *mask, uint8_t *data_sz);
+
/**
* @internal A structure containing the functions exported by an Ethernet driver.
*/
@@ -910,6 +936,8 @@ struct eth_dev_ops {
/**< Set up the connection between the pair of hairpin queues. */
eth_hairpin_queue_peer_unbind_t hairpin_queue_peer_unbind;
/**< Disconnect the hairpin queues of a pair from each other. */
+ eth_get_wake_addr_t get_wake_addr;
+ /**< Get next RX queue ring entry address. */
};
/**
@@ -244,6 +244,7 @@ EXPERIMENTAL {
rte_flow_get_restore_info;
rte_flow_tunnel_action_decap_release;
rte_flow_tunnel_item_release;
+ rte_eth_get_wake_addr;
};
INTERNAL {