DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Xu, Wei1" <wei1.xu@intel.com>
To: "Lu, Wenzhuo" <wenzhuo.lu@intel.com>,
	"Wu, Jingjing" <jingjing.wu@intel.com>,
	"Iremonger, Bernard" <bernard.iremonger@intel.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Subject: [PATCH V2] app/testpmd: fix parameters order when calling rte_ether_addr_copy()
Date: Thu, 11 Nov 2021 02:29:38 +0000	[thread overview]
Message-ID: <PH0PR11MB51595AE8B05206E9E7A67CF4A6949@PH0PR11MB5159.namprd11.prod.outlook.com> (raw)

Running in 'csum' mode, the 'from' and 'to' parameters are not
in the correct order when calling rte_ether_addr_copy() which
means the 'src/dst' mac addresses in the mbuf will be overwriten.

As a result, the packets will not be recognized and received
by the receiver(s).

Test CLI:
./app/dpdk-testpmd -n 1 -l 1-2 -a 09:00.0 -- -i --forward-mode=csum

Fixes: 10f4620(app/testpmd: modify mac in csum forwarding)

v2:
	- fixed indentation and long line warnings.

Signed-off-by: Wei Xu <wei1.xu@intel.com>
---
 app/test-pmd/csumonly.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index 8526d9158a..08484fcda2 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -872,10 +872,10 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)
 		 * and inner headers */
 
 		eth_hdr = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);
-		rte_ether_addr_copy(&peer_eth_addrs[fs->peer_addr],
-				&eth_hdr->dst_addr);
-		rte_ether_addr_copy(&ports[fs->tx_port].eth_addr,
-				&eth_hdr->src_addr);
+		rte_ether_addr_copy(&eth_hdr->dst_addr,
+				&peer_eth_addrs[fs->peer_addr]);
+		rte_ether_addr_copy(&eth_hdr->src_addr,
+				&ports[fs->tx_port].eth_addr);
 		parse_ethernet(eth_hdr, &info);
 		l3_hdr = (char *)eth_hdr + info.l2_len;
 
-- 
2.27.0

             reply	other threads:[~2021-11-11 13:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11  2:29 Xu, Wei1 [this message]
2021-11-15 19:00 ` Ferruh Yigit
2021-11-22  4:00   ` Xu, Wei1
2021-11-22  9:10     ` Ferruh Yigit

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=PH0PR11MB51595AE8B05206E9E7A67CF4A6949@PH0PR11MB5159.namprd11.prod.outlook.com \
    --to=wei1.xu@intel.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=jingjing.wu@intel.com \
    --cc=wenzhuo.lu@intel.com \
    /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).