[v2] app/testpmd: fix ether header size calculation

Message ID 20190409094543.26751-1-pbhagavatula@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers
Series [v2] app/testpmd: fix ether header size calculation |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing success Performance Testing PASS

Commit Message

Pavan Nikhilesh Bhagavatula April 9, 2019, 9:45 a.m. UTC
  From: Pavan Nikhilesh <pbhagavatula@marvell.com>

Fix ether header size calculation in Tx only mode.

Coverity issue: 337684
Fixes: 01b645dcff7f ("app/testpmd: move txonly prepare in separate function")

Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
---
 v2 Changes:
 - Preserve relation between destination and destination size. (Bruce)

 app/test-pmd/txonly.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.21.0
  

Comments

Ferruh Yigit April 9, 2019, 8:59 p.m. UTC | #1
On 4/9/2019 10:45 AM, Pavan Nikhilesh Bhagavatula wrote:
> From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Fix ether header size calculation in Tx only mode.
> 
> Coverity issue: 337684
> Fixes: 01b645dcff7f ("app/testpmd: move txonly prepare in separate function")
> 
> Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.


@lei, can you please confirm the txonly mode on next-net?
  
Yao, Lei A April 10, 2019, 1:23 a.m. UTC | #2
> -----Original Message-----
> From: Yigit, Ferruh
> Sent: Wednesday, April 10, 2019 4:59 AM
> To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>; Jerin Jacob
> Kollanukkaran <jerinj@marvell.com>; Lin, Xueqin <xueqin.lin@intel.com>;
> Richardson, Bruce <bruce.richardson@intel.com>; thomas@monjalon.net
> Cc: dev@dpdk.org; Yao, Lei A <lei.a.yao@intel.com>; Wang, FengqinX
> <fengqinx.wang@intel.com>
> Subject: Re: [dpdk-dev] [PATCH v2] app/testpmd: fix ether header size
> calculation
> 
> On 4/9/2019 10:45 AM, Pavan Nikhilesh Bhagavatula wrote:
> > From: Pavan Nikhilesh <pbhagavatula@marvell.com>
> >
> > Fix ether header size calculation in Tx only mode.
> >
> > Coverity issue: 337684
> > Fixes: 01b645dcff7f ("app/testpmd: move txonly prepare in separate
> function")
> >
> > Signed-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>
> 
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
> 
> Applied to dpdk-next-net/master, thanks.
> 
> 
> @lei, can you please confirm the txonly mode on next-net?

Hi, Ferruh

The src mac of txonly mode is correct on next-net branch now. Need more
regression test today to check if any other issue exist. Thanks.

BRs
Lei
  

Patch

diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index 66e63788a..2d0e1a027 100644
--- a/app/test-pmd/txonly.c
+++ b/app/test-pmd/txonly.c
@@ -189,7 +189,7 @@  pkt_burst_prepare(struct rte_mbuf *pkt, struct rte_mempool *mbp,
 	/*
 	 * Copy headers in first packet segment(s).
 	 */
-	copy_buf_to_pkt(eth_hdr, sizeof(eth_hdr), pkt, 0);
+	copy_buf_to_pkt(eth_hdr, sizeof(*eth_hdr), pkt, 0);
 	copy_buf_to_pkt(&pkt_ip_hdr, sizeof(pkt_ip_hdr), pkt,
 			sizeof(struct ether_hdr));
 	if (txonly_multi_flow) {