[PATCH V2] app/testpmd: fix parameters order when calling rte_ether_addr_copy()
    Xu, Wei1 
    wei1.xu at intel.com
       
    Thu Nov 11 03:29:38 CET 2021
    
    
  
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 at 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],
-				ð_hdr->dst_addr);
-		rte_ether_addr_copy(&ports[fs->tx_port].eth_addr,
-				ð_hdr->src_addr);
+		rte_ether_addr_copy(ð_hdr->dst_addr,
+				&peer_eth_addrs[fs->peer_addr]);
+		rte_ether_addr_copy(ð_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
    
    
More information about the dev
mailing list