DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] ethdev: fix copying bug in rte_eth_set_queue_rate_limit
@ 2018-11-19  8:38 Leah Tekoa
  2018-11-19 11:43 ` Ferruh Yigit
  2018-11-19 17:10 ` Stephen Hemminger
  0 siblings, 2 replies; 4+ messages in thread
From: Leah Tekoa @ 2018-11-19  8:38 UTC (permalink / raw)
  To: dev; +Cc: Leah Tekoa, Ouyang Changchun

From: Leah Tekoa <leah@ethernitynet.com>

memcpy should be used for copying rte_eth_link structure

Fixes: 8dbe82b0 ("ethdev: Tx rate limitation for queue and VF")

Signed-off-by: Leah Tekoa <leah@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,
-- 
1.8.3.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix copying bug in rte_eth_set_queue_rate_limit
  2018-11-19  8:38 [dpdk-dev] [PATCH] ethdev: fix copying bug in rte_eth_set_queue_rate_limit Leah Tekoa
@ 2018-11-19 11:43 ` Ferruh Yigit
  2018-11-19 11:55   ` Leah Tekoa
  2018-11-19 17:10 ` Stephen Hemminger
  1 sibling, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2018-11-19 11:43 UTC (permalink / raw)
  To: Leah Tekoa, dev; +Cc: Ouyang Changchun

On 11/19/2018 8:38 AM, Leah Tekoa wrote:
> From: Leah Tekoa <leah@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@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,
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix copying bug in rte_eth_set_queue_rate_limit
  2018-11-19 11:43 ` Ferruh Yigit
@ 2018-11-19 11:55   ` Leah Tekoa
  0 siblings, 0 replies; 4+ messages in thread
From: Leah Tekoa @ 2018-11-19 11:55 UTC (permalink / raw)
  To: Ferruh Yigit, dev; +Cc: Ouyang Changchun

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@intel.com> 
Sent: November 19, 2018 1:44 PM
To: Leah Tekoa <Leah@Ethernitynet.com>; dev@dpdk.org
Cc: Ouyang Changchun <changchun.ouyang@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@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@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,
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [dpdk-dev] [PATCH] ethdev: fix copying bug in rte_eth_set_queue_rate_limit
  2018-11-19  8:38 [dpdk-dev] [PATCH] ethdev: fix copying bug in rte_eth_set_queue_rate_limit Leah Tekoa
  2018-11-19 11:43 ` Ferruh Yigit
@ 2018-11-19 17:10 ` Stephen Hemminger
  1 sibling, 0 replies; 4+ messages in thread
From: Stephen Hemminger @ 2018-11-19 17:10 UTC (permalink / raw)
  To: Leah Tekoa; +Cc: dev, Ouyang Changchun

On Mon, 19 Nov 2018 08:38:44 +0000
Leah Tekoa <Leah@Ethernitynet.com> wrote:

> -	link = dev->data->dev_link;
> +	memcpy(&link, &dev->data->dev_link, sizeof(struct rte_eth_link));
>  

If structure assignment and memcpy don't give same result, then
you have a buggy compiler.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-11-19 17:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-19  8:38 [dpdk-dev] [PATCH] ethdev: fix copying bug in rte_eth_set_queue_rate_limit Leah Tekoa
2018-11-19 11:43 ` Ferruh Yigit
2018-11-19 11:55   ` Leah Tekoa
2018-11-19 17:10 ` Stephen Hemminger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).