From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <ferruh.yigit@intel.com>
Received: from mga09.intel.com (mga09.intel.com [134.134.136.24])
 by dpdk.org (Postfix) with ESMTP id B3C64108D
 for <dev@dpdk.org>; Thu,  6 Apr 2017 15:47:06 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple;
 d=intel.com; i=@intel.com; q=dns/txt; s=intel;
 t=1491486426; x=1523022426;
 h=from:to:cc:subject:date:message-id:in-reply-to:
 references:mime-version:content-transfer-encoding;
 bh=y1S2jGMyBH2Pg2MQW2IqSSSLKtt3WWH4dUErYSUMRGI=;
 b=W4axY45x52aIHEqYmxG4y7/L8W/5LVGKKbG+hiRjYISf6MSri45BDP/f
 JInASB65HqhpU+RnixcLCR66kHXF8w==;
Received: from orsmga001.jf.intel.com ([10.7.209.18])
 by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;
 06 Apr 2017 06:47:04 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.37,160,1488873600"; d="scan'208";a="1116303604"
Received: from sivswdev02.ir.intel.com ([10.237.217.46])
 by orsmga001.jf.intel.com with ESMTP; 06 Apr 2017 06:46:41 -0700
From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Jerin Jacob <jerin.jacob@caviumnetworks.com>,
 Bruce Richardson <bruce.richardson@intel.com>,
 Harry van Haaren <harry.van.haaren@intel.com>,
 Thomas Monjalon <thomas.monjalon@6wind.com>
Cc: dev@dpdk.org,
	Ferruh Yigit <ferruh.yigit@intel.com>
Date: Thu,  6 Apr 2017 14:46:36 +0100
Message-Id: <20170406134637.4484-2-ferruh.yigit@intel.com>
X-Mailer: git-send-email 2.8.4
In-Reply-To: <20170406134637.4484-1-ferruh.yigit@intel.com>
References: <20170406121428.16883-1-ferruh.yigit@intel.com>
 <20170406134637.4484-1-ferruh.yigit@intel.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Subject: [dpdk-dev] [PATCH v2 2/3] event/octeontx: fix build error for gcc <
	4.6
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: DPDK patches and discussions <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: Thu, 06 Apr 2017 13:47:07 -0000

-Ofast option supported from gcc4.6 [1], for older versions using
"-O3 -ffast-math" instead.

[1] build error:
cc1: error: invalid option argument ‘-Ofast’

Also struct initialization build error [2] fixed.

[2] build error:
.../event/octeontx/ssovf_mbox.c: In function ‘mbox_send_request’:
.../event/octeontx/ssovf_mbox.c:95:9: error: unknown field ‘u64’
specified in initializer

Fixes: 32ff26393bb2 ("event/octeontx: add SSO HW device operations")

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
Acked-by: Jerin Jacob <jerin.jacob@caviumnetworks.com>
---
 drivers/event/octeontx/Makefile     | 9 +++++++++
 drivers/event/octeontx/ssovf_mbox.c | 2 +-
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/event/octeontx/Makefile b/drivers/event/octeontx/Makefile
index b26e35b..aca3d09 100644
--- a/drivers/event/octeontx/Makefile
+++ b/drivers/event/octeontx/Makefile
@@ -50,10 +50,19 @@ SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_worker.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_evdev.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_probe.c
 SRCS-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF) += ssovf_mbox.c
+
 ifeq ($(CONFIG_RTE_TOOLCHAIN_GCC),y)
 CFLAGS_ssovf_worker.o += -fno-prefetch-loop-arrays
+
+ifeq ($(shell test $(GCC_VERSION) -ge 46 && echo 1), 1)
+CFLAGS_ssovf_worker.o += -Ofast
+else
+CFLAGS_ssovf_worker.o += -O3 -ffast-math
 endif
+
+else
 CFLAGS_ssovf_worker.o += -Ofast
+endif
 
 # install this header file
 SYMLINK-$(CONFIG_RTE_LIBRTE_PMD_OCTEONTX_SSOVF)-include := rte_pmd_octeontx_ssovf.h
diff --git a/drivers/event/octeontx/ssovf_mbox.c b/drivers/event/octeontx/ssovf_mbox.c
index 0435f6d..f42969c 100644
--- a/drivers/event/octeontx/ssovf_mbox.c
+++ b/drivers/event/octeontx/ssovf_mbox.c
@@ -92,7 +92,7 @@ mbox_send_request(struct mbox *m, struct octeontx_mbox_hdr *hdr,
 			const void *txmsg, uint16_t txsize)
 {
 	struct mbox_ram_hdr old_hdr;
-	struct mbox_ram_hdr new_hdr = {.u64 = 0};
+	struct mbox_ram_hdr new_hdr = {{0}};
 	uint64_t *ram_mbox_hdr = (uint64_t *)m->ram_mbox_base;
 	uint8_t *ram_mbox_msg = m->ram_mbox_base + sizeof(struct mbox_ram_hdr);
 
-- 
2.9.3