event/octeontx: fix build for gcc < 4.6

-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>
This commit is contained in:
Ferruh Yigit 2017-04-06 18:05:10 +01:00 committed by Thomas Monjalon
parent 0b9ce550c4
commit 1daa21de5b
2 changed files with 11 additions and 2 deletions

View File

@ -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
endif
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

View File

@ -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);