public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [PATCH 2/4] examples/vmdq: replace memcpy with structure assignment
Date: Wed, 21 Jan 2026 09:04:55 -0800	[thread overview]
Message-ID: <20260121170540.785735-3-stephen@networkplumber.org> (raw)
In-Reply-To: <20260121170540.785735-1-stephen@networkplumber.org>

Better to keep type safety and use assignment rather than
rte_memcpy.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 examples/vmdq/main.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 4a3ce6884c..12ef5bffc2 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/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>
@@ -151,9 +150,9 @@ get_eth_conf(struct rte_eth_conf *eth_conf, uint32_t num_pools)
 		conf.pool_map[i].pools = (1UL << (i % num_pools));
 	}
 
-	(void)(rte_memcpy(eth_conf, &vmdq_conf_default, sizeof(*eth_conf)));
-	(void)(rte_memcpy(&eth_conf->rx_adv_conf.vmdq_rx_conf, &conf,
-		   sizeof(eth_conf->rx_adv_conf.vmdq_rx_conf)));
+	*eth_conf = vmdq_conf_default;
+	eth_conf->rx_adv_conf.vmdq_rx_conf = conf;
+
 	if (rss_enable) {
 		eth_conf->rxmode.mq_mode = RTE_ETH_MQ_RX_VMDQ_RSS;
 		eth_conf->rx_adv_conf.rss_conf.rss_hf = RTE_ETH_RSS_IP |
-- 
2.51.0


  parent reply	other threads:[~2026-01-21 17:05 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 ` Stephen Hemminger [this message]
2026-01-21 17:04 ` [PATCH 3/4] examples/vmdq_dcb: " Stephen Hemminger
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-3-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