From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH 3/4] examples/vmdq_dcb: replace memcpy with assignment
Date: Wed, 21 Jan 2026 09:04:56 -0800 [thread overview]
Message-ID: <20260121170540.785735-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20260121170540.785735-1-stephen@networkplumber.org>
Better to use structure assignment rather than memcpy.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
examples/vmdq_dcb/main.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index 4ccc2fe4b0..6eccee086d 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -17,7 +17,6 @@
#include <rte_common.h>
#include <rte_log.h>
#include <rte_memory.h>
-#include <rte_memcpy.h>
#include <rte_eal.h>
#include <rte_launch.h>
#include <rte_cycles.h>
@@ -161,15 +160,13 @@ get_eth_conf(struct rte_eth_conf *eth_conf)
tx_conf.dcb_tc[i] = i % num_tcs;
}
dcb_conf.nb_tcs = (enum rte_eth_nb_tcs)num_tcs;
- (void)(rte_memcpy(eth_conf, &vmdq_dcb_conf_default, sizeof(*eth_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_dcb_conf, &conf,
- sizeof(conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.dcb_rx_conf, &dcb_conf,
- sizeof(dcb_conf)));
- (void)(rte_memcpy(ð_conf->rx_adv_conf.vmdq_rx_conf, &vmdq_conf,
- sizeof(vmdq_conf)));
- (void)(rte_memcpy(ð_conf->tx_adv_conf.vmdq_dcb_tx_conf, &tx_conf,
- sizeof(tx_conf)));
+
+ *eth_conf = vmdq_dcb_conf_default;
+ eth_conf->rx_adv_conf.vmdq_dcb_conf = conf;
+ eth_conf->rx_adv_conf.dcb_rx_conf = dcb_conf;
+ eth_conf->rx_adv_conf.vmdq_rx_conf = vmdq_conf;
+ eth_conf->tx_adv_conf.vmdq_dcb_tx_conf = tx_conf;
+
if (rss_enable) {
eth_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_VMDQ_DCB_RSS;
eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
--
2.51.0
next prev parent reply other threads:[~2026-01-21 17:06 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-21 17:04 [PATCH 0/4] examples: memcpy cleanups Stephen Hemminger
2026-01-21 17:04 ` [PATCH 1/4] examples/vhost: replace memcpy with assignment Stephen Hemminger
2026-01-21 17:04 ` [PATCH 2/4] examples/vmdq: replace memcpy with structure assignment Stephen Hemminger
2026-01-21 17:04 ` Stephen Hemminger [this message]
2026-01-21 17:04 ` [PATCH 4/4] examples: remove unnecessary include Stephen Hemminger
2026-02-17 17:43 ` Thomas Monjalon
2026-01-21 18:55 ` [PATCH 0/4] examples: memcpy cleanups Morten Brørup
2026-02-17 17:49 ` Thomas Monjalon
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=20260121170540.785735-4-stephen@networkplumber.org \
--to=stephen@networkplumber.org \
--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