From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from dpdk.org (dpdk.org [92.243.14.124])
	by dpdk.space (Postfix) with ESMTP id BBBDEA0096
	for <public@inbox.dpdk.org>; Mon,  8 Apr 2019 13:58:07 +0200 (CEST)
Received: from [92.243.14.124] (localhost [127.0.0.1])
	by dpdk.org (Postfix) with ESMTP id 844202C24;
	Mon,  8 Apr 2019 13:58:05 +0200 (CEST)
Received: from mga04.intel.com (mga04.intel.com [192.55.52.120])
 by dpdk.org (Postfix) with ESMTP id 154B82BC9
 for <dev@dpdk.org>; Mon,  8 Apr 2019 13:58:03 +0200 (CEST)
X-Amp-Result: UNKNOWN
X-Amp-Original-Verdict: FILE UNKNOWN
X-Amp-File-Uploaded: False
Received: from fmsmga002.fm.intel.com ([10.253.24.26])
 by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 08 Apr 2019 04:58:03 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.60,325,1549958400"; d="scan'208";a="159215221"
Received: from bricha3-mobl.ger.corp.intel.com ([10.237.221.35])
 by fmsmga002.fm.intel.com with SMTP; 08 Apr 2019 04:58:00 -0700
Received: by  (sSMTP sendmail emulation); Mon, 08 Apr 2019 12:58:00 +0100
Date: Mon, 8 Apr 2019 12:57:59 +0100
From: Bruce Richardson <bruce.richardson@intel.com>
To: Pavan Nikhilesh Bhagavatula <pbhagavatula@marvell.com>
Cc: Jerin Jacob Kollanukkaran <jerinj@marvell.com>,
 "thomas@monjalon.net" <thomas@monjalon.net>, "dev@dpdk.org" <dev@dpdk.org>
Message-ID: <20190408115759.GB1742@bricha3-MOBL.ger.corp.intel.com>
References: <20190408101236.18076-1-pbhagavatula@marvell.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
In-Reply-To: <20190408101236.18076-1-pbhagavatula@marvell.com>
User-Agent: Mutt/1.11.4 (2019-03-13)
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: fix ether header size
	calculation
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org
Sender: "dev" <dev-bounces@dpdk.org>
Message-ID: <20190408115759.IfSeZCcF_H_jcKP1sNtUEFpxS9gatwRaOD8err0CcOo@z>

On Mon, Apr 08, 2019 at 10:13:04AM +0000, 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>
> ---
>  app/test-pmd/txonly.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
> index 66e63788a..a9c27be3e 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(struct ether_hdr), pkt, 0);

Would a simpler fix not be to change "sizeof(eth_hdr)" to
"sizeof(*eth_hdr)"? It would keep the logical connection between the
destination and destination size, and make future refactoring easier.

/Bruce