RE: [PATCH v12 16/26] net/dpaa: add Tx rate limiting API

Morten Brørup <[email protected]>
Newsgroups org.dpdk.dev
Message-ID <[email protected]>
> From: Hemant Agrawal [mailto:[email protected]]
> Sent: Tuesday, 18 August 2026 13.17
> To: [email protected]; [email protected]; [email protected]
> Subject: [PATCH v12 16/26] net/dpaa: add Tx rate limiting API
> 
> Add a DPAA PMD API to configure the transmit rate limit (rate and
> burst) on a DPAA port, using the FMAN port rate limiter.
> 
> Signed-off-by: Hemant Agrawal <[email protected]>
> ---
> diff --git a/drivers/net/dpaa/rte_pmd_dpaa.h
> b/drivers/net/dpaa/rte_pmd_dpaa.h
> index 0a57e2097a..680ff387f8 100644
> --- a/drivers/net/dpaa/rte_pmd_dpaa.h
> +++ b/drivers/net/dpaa/rte_pmd_dpaa.h
> @@ -1,11 +1,12 @@
>  /* SPDX-License-Identifier: BSD-3-Clause
> - * Copyright 2018 NXP
> + * Copyright 2018,2022 NXP
>   */
> 
>  #ifndef _PMD_DPAA_H_
>  #define _PMD_DPAA_H_
> 
>  #include <stdint.h>
> +#include <rte_compat.h>
> 
>  /**
>   * @file rte_pmd_dpaa.h
> @@ -33,4 +34,24 @@
>  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.
> + */
> +__rte_experimental
> +int
> +rte_pmd_dpaa_port_set_rate_limit(uint16_t port_id, uint16_t burst,
> +				 uint32_t rate);
> +
>  #endif /* _PMD_DPAA_H_ */
> --
> 2.25.1

We already have a generic API for per-queue TX rate limit: rte_eth_set_queue_rate_limit().

Let's have a generic API for per-port TX rate limit, instead of a device-specific API.

The per-queue API doesn't support burst size, but the per-port API could.
It could be noted in the API description that if a port doesn't support burst capacity, the "burst" parameter will be ignored.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.