From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <min.cao@intel.com>
Received: from mga09.intel.com (mga09.intel.com [134.134.136.24])
 by dpdk.org (Postfix) with ESMTP id 84A8D1518
 for <dev@dpdk.org>; Fri, 28 Nov 2014 09:53:37 +0100 (CET)
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by orsmga102.jf.intel.com with ESMTP; 28 Nov 2014 00:51:05 -0800
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.07,475,1413270000"; d="scan'208";a="615373436"
Received: from pgsmsx106.gar.corp.intel.com ([10.221.44.98])
 by orsmga001.jf.intel.com with ESMTP; 28 Nov 2014 00:53:35 -0800
Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by
 pgsmsx106.gar.corp.intel.com (10.221.44.98) with Microsoft SMTP Server (TLS)
 id 14.3.195.1; Fri, 28 Nov 2014 16:52:51 +0800
Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by
 SHSMSX104.ccr.corp.intel.com ([169.254.5.182]) with mapi id 14.03.0195.001;
 Fri, 28 Nov 2014 16:52:51 +0800
From: "Cao, Min" <min.cao@intel.com>
To: "Richardson, Bruce" <bruce.richardson@intel.com>, "dev@dpdk.org"
 <dev@dpdk.org>
Thread-Topic: [dpdk-dev] [PATCH] ixgbe: fix icc issue with mbuf initializer
Thread-Index: AQHP91cAYvJDp4IR+0SMpmZp0c4kjpx11YaQ
Date: Fri, 28 Nov 2014 08:52:50 +0000
Message-ID: <B6059B2012717B4390714544B1F509E110DC8F77@SHSMSX103.ccr.corp.intel.com>
References: <1415013076-30314-1-git-send-email-bruce.richardson@intel.com>
In-Reply-To: <1415013076-30314-1-git-send-email-bruce.richardson@intel.com>
Accept-Language: zh-CN, en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
x-originating-ip: [10.239.127.40]
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
Subject: Re: [dpdk-dev] [PATCH] ixgbe: fix icc issue with mbuf initializer
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Fri, 28 Nov 2014 08:53:38 -0000

Tested-by: Min Cao <min.cao@intel.com>

Patch name: 		[dpdk-dev] [PATCH v2] ixgbe: fix icc issue with mbuf initiali=
zer
Test Flag: 			Tested-by
Tester name: 		min.cao@intel.com
ICC version:            13.1.2
ICC package:            l_ccompxe_2013.4.183.tgz
Result summary:		total 6 cases, 6 passed, 0 failed

Test Case 1:	=09
Name:				l2fwd
Environment:		OS: Fedora20 3.11.10-301.fc20.x86_64
				CPU: Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
				NIC: Fortville eagle/spirit=20
Test result(32bit):	PASSED
Test result(64bit):	PASSED

Test Case 2:	=09
Name:				l3fwd
Environment:		OS: Fedora20 3.11.10-301.fc20.x86_64
				CPU: Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
				NIC: Fortville eagle/spirit=20
Test result(32bit):	PASSED
Test result(64bit):	PASSED
Test Case 3:	=09
Name:				pmd
Environment:		OS: Fedora20 3.11.10-301.fc20.x86_64
				CPU: Intel(R) Xeon(R) CPU E5-2680 0 @ 2.70GHz
				NIC: Fortville eagle/spirit=20
Test result(32bit):	PASSED
Test result(64bit):	PASSED

-----Original Message-----
From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Bruce Richardson
Sent: Monday, November 03, 2014 7:11 PM
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH] ixgbe: fix icc issue with mbuf initializer

When using Intel C++ compiler(icc) 14.0.1.106 or the older icc 13.x
version, the mbuf initializer variable was not getting configured
correctly, as the mb_def variable was not set correctly. This is due
to an issue with icc (DPD200249565 which already been fixed in
icc 14.0.2 and newer compiler release) where it incorrectly calculates
the field offsets with initializers when zero-sized fields
are used in a structure.
To work around this, the code in ixgbe_rxq_vec_setup does not setup the
fields using an initializer, but instead assigns the values individually
in code
NOTE: There is no performance impact to this change as the queue
setup functions are not data-plane APIs, but are only used at app
initialization.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
---
 lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c b/lib/librte_pmd_ixgbe/i=
xgbe_rxtx_vec.c
index e813e43..b57c588 100644
--- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
+++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c
@@ -730,16 +730,15 @@ static struct ixgbe_txq_ops vec_txq_ops =3D {
 int
 ixgbe_rxq_vec_setup(struct igb_rx_queue *rxq)
 {
-	struct rte_mbuf mb_def =3D {
-		.nb_segs =3D 1,
-		.data_off =3D RTE_PKTMBUF_HEADROOM,
-#ifdef RTE_MBUF_REFCNT
-		{ .refcnt =3D 1, }
-#endif
-	};
+	struct rte_mbuf mb_def =3D { .buf_addr =3D 0 }; /* zeroed mbuf */
=20
+	mb_def.nb_segs =3D 1;
+	mb_def.data_off =3D RTE_PKTMBUF_HEADROOM;
 	mb_def.buf_len =3D rxq->mb_pool->elt_size - sizeof(struct rte_mbuf);
 	mb_def.port =3D rxq->port_id;
+#ifdef RTE_MBUF_REFCNT
+	mb_def.refcnt =3D 1;
+#endif
 	rxq->mbuf_initializer =3D *((uint64_t *)&mb_def.rearm_data);
 	return 0;
 }
--=20
1.9.3