[dpdk-dev] [PATCH] ethdev: fix copying bug in rte_eth_set_queue_rate_limit
Leah Tekoa
Leah at Ethernitynet.com
Mon Nov 19 12:55:23 CET 2018
We had problems with the way it is currently written and it didn't work for us. We got zero in link.link_speed and the real value was not copied correctly.
-----Original Message-----
From: Ferruh Yigit <ferruh.yigit at intel.com>
Sent: November 19, 2018 1:44 PM
To: Leah Tekoa <Leah at Ethernitynet.com>; dev at dpdk.org
Cc: Ouyang Changchun <changchun.ouyang at intel.com>
Subject: Re: [dpdk-dev] [PATCH] ethdev: fix copying bug in rte_eth_set_queue_rate_limit
On 11/19/2018 8:38 AM, Leah Tekoa wrote:
> From: Leah Tekoa <leah at ethernitynet.com>
>
> memcpy should be used for copying rte_eth_link structure
Why?
>
> Fixes: 8dbe82b0 ("ethdev: Tx rate limitation for queue and VF")
>
> Signed-off-by: Leah Tekoa <leah at ethernitynet.com>
> ---
> lib/librte_ethdev/rte_ethdev.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/lib/librte_ethdev/rte_ethdev.c
> b/lib/librte_ethdev/rte_ethdev.c index 5f85817..c187690 100644
> --- a/lib/librte_ethdev/rte_ethdev.c
> +++ b/lib/librte_ethdev/rte_ethdev.c
> @@ -3266,7 +3266,7 @@ int rte_eth_set_queue_rate_limit(uint16_t
> port_id, uint16_t queue_idx,
>
> dev = &rte_eth_devices[port_id];
> rte_eth_dev_info_get(port_id, &dev_info);
> - link = dev->data->dev_link;
> + memcpy(&link, &dev->data->dev_link, sizeof(struct rte_eth_link));
>
> if (queue_idx > dev_info.max_tx_queues) {
> RTE_ETHDEV_LOG(ERR,
>
More information about the dev
mailing list