From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id F062D7F00 for ; Fri, 28 Nov 2014 09:54:00 +0100 (CET) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 28 Nov 2014 00:51:28 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.07,475,1413270000"; d="scan'208";a="615373548" Received: from pgsmsx104.gar.corp.intel.com ([10.221.44.91]) by orsmga001.jf.intel.com with ESMTP; 28 Nov 2014 00:53:59 -0800 Received: from shsmsx102.ccr.corp.intel.com (10.239.4.154) by PGSMSX104.gar.corp.intel.com (10.221.44.91) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 28 Nov 2014 16:52:44 +0800 Received: from shsmsx103.ccr.corp.intel.com ([169.254.4.240]) by shsmsx102.ccr.corp.intel.com ([169.254.2.216]) with mapi id 14.03.0195.001; Fri, 28 Nov 2014 16:52:43 +0800 From: "Cao, Min" To: "Richardson, Bruce" , "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH v2] ixgbe: fix icc issue with mbuf initializer Thread-Index: AQHP94gW+FoaWYFcbU+aQmB62vhdCZx1rCdQ Date: Fri, 28 Nov 2014 08:52:43 +0000 Message-ID: References: <1415013076-30314-1-git-send-email-bruce.richardson@intel.com> <1415034068-22656-1-git-send-email-bruce.richardson@intel.com> In-Reply-To: <1415034068-22656-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 v2] 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Nov 2014 08:54:01 -0000 Tested-by: Min Cao 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: Tuesday, November 04, 2014 1:01 AM To: dev@dpdk.org Subject: [dpdk-dev] [PATCH v2] 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 --- V2 change: use rte_mbuf_refcnt_set to update reference count --- lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c | 11 ++++------- 1 file changed, 4 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..42c0f60 100644 --- a/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c +++ b/lib/librte_pmd_ixgbe/ixgbe_rxtx_vec.c @@ -730,16 +730,13 @@ 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; + rte_mbuf_refcnt_set(&mb_def, 1); rxq->mbuf_initializer =3D *((uint64_t *)&mb_def.rearm_data); return 0; } --=20 1.9.3