On 14 Oct 14:30, Anatoly Burakov wrote:
> From: Liang Ma <liang.j...@intel.com>
> 
> Add a simple API to allow getting address of next RX descriptor from the
> PMD, as well as release notes information.
> 
> Signed-off-by: Liang Ma <liang.j...@intel.com>
> Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com>
> Acked-by: Konstantin Ananyev <konstantin.anan...@intel.com>
<snip>
> diff --git a/lib/librte_ethdev/rte_ethdev.h b/lib/librte_ethdev/rte_ethdev.h
> index 3a31f94367..005faba455 100644
> --- a/lib/librte_ethdev/rte_ethdev.h
> +++ b/lib/librte_ethdev/rte_ethdev.h
> @@ -4119,6 +4119,32 @@ __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 point to the address which is used for monitoring.
> + * @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.
> + *
need add the comment of data_sz.
> + * @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)
> diff --git a/lib/librte_ethdev/rte_ethdev_driver.h 
> b/lib/librte_ethdev/rte_ethdev_driver.h
> index 35cc4fb186..76b179de42 100644
> --- a/lib/librte_ethdev/rte_ethdev_driver.h
> +++ b/lib/librte_ethdev/rte_ethdev_driver.h
> @@ -655,6 +655,32 @@ typedef int (*eth_fec_get_t)(struct rte_eth_dev *dev,
>   */
>  typedef int (*eth_fec_set_t)(struct rte_eth_dev *dev, uint32_t fec_capa);
>  
> +/**
> + * @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.
>   */
> @@ -801,6 +827,8 @@ struct eth_dev_ops {
>       /**< Get Forward Error Correction(FEC) mode. */
>       eth_fec_set_t fec_set;
>       /**< Set Forward Error Correction(FEC) mode. */
> +     eth_get_wake_addr_t get_wake_addr;
> +     /**< Get next RX queue ring entry address. */
>  };
>  
>  /**
> diff --git a/lib/librte_ethdev/rte_ethdev_version.map 
> b/lib/librte_ethdev/rte_ethdev_version.map
> index f8a0945812..6c2ea5996d 100644
> --- a/lib/librte_ethdev/rte_ethdev_version.map
> +++ b/lib/librte_ethdev/rte_ethdev_version.map
> @@ -232,6 +232,7 @@ EXPERIMENTAL {
>       rte_eth_fec_get_capability;
>       rte_eth_fec_get;
>       rte_eth_fec_set;
> +     rte_eth_get_wake_addr;
>  };
>  
>  INTERNAL {
> -- 
> 2.17.1

Reply via email to