[PATCH 13/17] net/dpaa: add Tx rate limiting DPAA PMD API
Ferruh Yigit
ferruh.yigit at amd.com
Wed Aug 7 17:40:35 CEST 2024
On 8/1/2024 11:53 AM, Hemant Agrawal wrote:
> From: Vinod Pullabhatla <vinod.pullabhatla at nxp.com>
>
> Add support to set Tx rate on DPAA platform through PMD APIs
>
> Signed-off-by: Vinod Pullabhatla <vinod.pullabhatla at nxp.com>
> Signed-off-by: Rohit Raj <rohit.raj at nxp.com>
<...>
> diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h b/drivers/net/dpaa/rte_pmd_dpaa.h
> index ec45633ba2..b48adff570 100644
> --- a/drivers/net/dpaa/rte_pmd_dpaa.h
> +++ b/drivers/net/dpaa/rte_pmd_dpaa.h
> @@ -1,5 +1,5 @@
> /* SPDX-License-Identifier: BSD-3-Clause
> - * Copyright 2018 NXP
> + * Copyright 2018,2022 NXP
> */
>
> #ifndef _PMD_DPAA_H_
> @@ -31,4 +31,27 @@
> int
> rte_pmd_dpaa_set_tx_loopback(uint16_t port, uint8_t on);
>
> +/**
> + * Set TX rate limit
> + *
> + * @param port_id
> + * The port identifier of the Ethernet device.
> + * @param burst
> + * Max burst size(KBytes) of the Ethernet device.
> + * 0 - Disable TX rate limit.
> + * @param rate
> + * Max rate(Kb/sec) of the Ethernet device.
> + * 0 - Disable TX rate limit.
> + * @return
> + * 0 - if successful.
> + * <0 - if failed, with proper error code.
> + *
> + * @warning
> + * @b EXPERIMENTAL: this API may change, or be removed, without prior notice
> + */
> +__rte_experimental
> +int
> +rte_pmd_dpaa_port_set_rate_limit(uint16_t port_id, uint16_t burst,
> + uint32_t rate);
> +
>
We are trying to avoid from PMD specific APIs as much as possible.
Can't this be implemented via TM / metering? Or flow API?
More information about the dev
mailing list