DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH] app/testpmd: fix parameters order when calling rte_ether_addr_copy()
@ 2021-11-10  8:17 Xu, Wei1
  2021-11-10 16:03 ` Stephen Hemminger
  0 siblings, 1 reply; 2+ messages in thread
From: Xu, Wei1 @ 2021-11-10  8:17 UTC (permalink / raw)
  To: Lu, Wenzhuo, Wu, Jingjing, bernard.iremonger, dev

[-- Attachment #1: Type: text/plain, Size: 1729 bytes --]

Running in 'csum' mode, the 'from' and 'to' parameters are not in correct
order when calling rte_ether_addr_copy() which means the src/dst mac addresses
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)

Signed-off-by: Wei Xu wei1.xu@intel.com<mailto: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;


[-- Attachment #2: Type: text/html, Size: 7021 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] app/testpmd: fix parameters order when calling rte_ether_addr_copy()
  2021-11-10  8:17 [PATCH] app/testpmd: fix parameters order when calling rte_ether_addr_copy() Xu, Wei1
@ 2021-11-10 16:03 ` Stephen Hemminger
  0 siblings, 0 replies; 2+ messages in thread
From: Stephen Hemminger @ 2021-11-10 16:03 UTC (permalink / raw)
  To: Xu, Wei1; +Cc: Lu, Wenzhuo, Wu, Jingjing, bernard.iremonger, dev

On Wed, 10 Nov 2021 08:17:59 +0000
"Xu, Wei1" <wei1.xu@intel.com> wrote:

>                               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);

Your patch indents with spaces not tabs

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-10 16:03 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-10  8:17 [PATCH] app/testpmd: fix parameters order when calling rte_ether_addr_copy() Xu, Wei1
2021-11-10 16:03 ` Stephen Hemminger

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).