From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 154B82BC9 for ; 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 To: Pavan Nikhilesh Bhagavatula Cc: Jerin Jacob Kollanukkaran , "thomas@monjalon.net" , "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=us-ascii 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Apr 2019 11:58:04 -0000 On Mon, Apr 08, 2019 at 10:13:04AM +0000, Pavan Nikhilesh Bhagavatula wrote: > From: Pavan Nikhilesh > > 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 > --- > 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id BBBDEA0096 for ; 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 ; 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 To: Pavan Nikhilesh Bhagavatula Cc: Jerin Jacob Kollanukkaran , "thomas@monjalon.net" , "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190408115759.IfSeZCcF_H_jcKP1sNtUEFpxS9gatwRaOD8err0CcOo@z> On Mon, Apr 08, 2019 at 10:13:04AM +0000, Pavan Nikhilesh Bhagavatula wrote: > From: Pavan Nikhilesh > > 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 > --- > 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