DPDK patches and discussions
 help / color / mirror / Atom feed
From: Leah Tekoa <Leah@Ethernitynet.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: Leah Tekoa <Leah@Ethernitynet.com>,
	Ouyang Changchun <changchun.ouyang@intel.com>
Subject: [dpdk-dev] [PATCH] ethdev: fix copying bug in rte_eth_set_queue_rate_limit
Date: Mon, 19 Nov 2018 08:38:44 +0000	[thread overview]
Message-ID: <9f22d89841c440c32235117e1a4fe223f97c7f8e.1542616118.git.leah@ethernitynet.com> (raw)

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

             reply	other threads:[~2018-11-19  8:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-19  8:38 Leah Tekoa [this message]
2018-11-19 11:43 ` Ferruh Yigit
2018-11-19 11:55   ` Leah Tekoa
2018-11-19 17:10 ` Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9f22d89841c440c32235117e1a4fe223f97c7f8e.1542616118.git.leah@ethernitynet.com \
    --to=leah@ethernitynet.com \
    --cc=changchun.ouyang@intel.com \
    --cc=dev@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).