From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f49.google.com (mail-wm0-f49.google.com [74.125.82.49]) by dpdk.org (Postfix) with ESMTP id A5D0B5A6A for ; Mon, 24 Apr 2017 17:53:26 +0200 (CEST) Received: by mail-wm0-f49.google.com with SMTP id i137so6182197wmf.0 for ; Mon, 24 Apr 2017 08:53:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Zy+PJHgEEe5gVDU98s6h28Dxh8n8d1uXIVdLNSRl1EY=; b=g6QkA2CuGguHI1PwTi3+LZPb3smjc3dYt7ic3MmYlwCtAxazjdnP82lp9F+Ty5TGtF KbVBXHrKYaBPa9RkBgdXNGo1rYwcl07IcIcrr6JJqd4YOz8uHZc29D7mgws6k+SEV/gZ ehNKWpc11o16BvJvEQk4sX0tF56q5PyMAKToX6Cf1KmkqCBVeQ6wQUVIxPT+0WJiB6GI 4O7itbyvkD52xSbZ5S7lc8xds/qO8xbnIJvvfNdx1p/bTt7NeNMDNlH0OwT70bxyogGr PTOOKp4LaG7VZHffvjocVQoaxjhY6h0EmZYy+c86NtI7u0e55vhWpWmjtOH6KnHEENzk AA4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Zy+PJHgEEe5gVDU98s6h28Dxh8n8d1uXIVdLNSRl1EY=; b=tFnOkJ9Sl/YbLL/MpV7RyE6IIVauzX35R9PNn4JV7/bfBTMdKJPSBtpM81Qou019dx PqkL3Fs1HQxTxe/dVYn7m6/GWk2Nq1htjtdifsUJoMMXpAlLI+5wtIEFnfjP2nEZlwjO IgoYsqvTSaD3JgRe+bICS66kxrsbkBkhgw4nOflrviQ5/dM0x9e4d2zsvqzuJSLmp1da ivs/MIa9ossPLndqqsdpoWR5syQJgR0GIqNJKpBnMbprVMe2lhqbu6uXJHQcYML8CELm UlzckAgK4tDygMvov+ajk7NVFl9pI8lOFbjphYT5EGm5QuTI75aJkLDSoAMy8rODf7+I s3Qg== X-Gm-Message-State: AN3rC/5DI8cZe6l/WQg6ndTLHbgtJBz6fwa4iIFKTBpF+LUTYA8pxxlc r8UtyMJJOAgO+KPWT14= X-Received: by 10.28.11.207 with SMTP id 198mr10918004wml.38.1493049206141; Mon, 24 Apr 2017 08:53:26 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id c128sm886063wmh.32.2017.04.24.08.53.25 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 24 Apr 2017 08:53:25 -0700 (PDT) From: Adrien Mazarguil To: dev@dpdk.org Cc: Allain Legacy Date: Mon, 24 Apr 2017 17:53:01 +0200 Message-Id: <5ad16bd561e4a9d7d5a6dfadaccc56d746feb537.1493048352.git.adrien.mazarguil@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: References: Subject: [dpdk-dev] [PATCH 07/13] net/avp: fix errors in exported headers 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, 24 Apr 2017 15:53:28 -0000 This commit addresses several errors related to missing includes such as: In file included from /tmp/check-includes.sh.15315.c:1:0: build/include/rte_avp_fifo.h:77:22: error: 'struct rte_avp_fifo' declared inside parameter list [-Werror] [...] build/include/rte_avp_fifo.h: In function 'avp_fifo_init': build/include/rte_avp_fifo.h:81:3: error: implicit declaration of function 'rte_panic' [-Werror=implicit-function-declaration] [...] build/include/rte_avp_fifo.h:83:6: error: dereferencing pointer to incomplete type [...] build/include/rte_avp_fifo.h:109:2: error: implicit declaration of function 'rte_wmb' [-Werror=implicit-function-declaration] [...] In file included from /tmp/check-includes.sh.15315.c:1:0: build/include/rte_avp_common.h:104:2: error: unknown type name 'uint64_t' [...] build/include/rte_avp_common.h:386:15: error: 'ETHER_ADDR_LEN' undeclared here (not in a function) [...] It addresses errors with strict compilation flags: In file included from /tmp/check-includes.sh.15315.c:1:0: build/include/rte_avp_common.h:122:3: error: ISO C99 doesn't support unnamed structs/unions [-Werror=pedantic] [...] build/include/rte_avp_common.h:136:17: error: ISO C forbids zero-size array 'buffer' [-Werror=pedantic] [...] And also adds C++ awareness to both header files. Fixes: 8e680655e205 ("net/avp: add public header files") Cc: Allain Legacy Signed-off-by: Adrien Mazarguil --- drivers/net/avp/rte_avp_common.h | 16 +++++++++++++++- drivers/net/avp/rte_avp_fifo.h | 12 ++++++++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/net/avp/rte_avp_common.h b/drivers/net/avp/rte_avp_common.h index 31d763e..6cdaca9 100644 --- a/drivers/net/avp/rte_avp_common.h +++ b/drivers/net/avp/rte_avp_common.h @@ -57,9 +57,18 @@ #ifndef _RTE_AVP_COMMON_H_ #define _RTE_AVP_COMMON_H_ +#include #ifdef __KERNEL__ #include #endif +#include +#include +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif /** * AVP name is part of network device name. @@ -115,6 +124,7 @@ struct rte_avp_device_config { */ struct rte_avp_request { uint32_t req_id; /**< Request id */ + RTE_STD_C11 union { uint32_t new_mtu; /**< New MTU */ uint8_t if_up; /**< 1: interface up, 0: interface down */ @@ -133,7 +143,7 @@ struct rte_avp_fifo { volatile unsigned int read; /**< Next position to be read */ unsigned int len; /**< Circular buffer length */ unsigned int elem_size; /**< Pointer size - for 32/64 bit OS */ - void *volatile buffer[0]; /**< The buffer contains mbuf pointers */ + void *volatile buffer[]; /**< The buffer contains mbuf pointers */ }; @@ -413,4 +423,8 @@ struct rte_avp_device_info { #define RTE_AVP_IOCTL_RELEASE _IOWR(0, 3, struct rte_avp_device_info) #define RTE_AVP_IOCTL_QUERY _IOWR(0, 4, struct rte_avp_device_config) +#ifdef __cplusplus +} +#endif + #endif /* _RTE_AVP_COMMON_H_ */ diff --git a/drivers/net/avp/rte_avp_fifo.h b/drivers/net/avp/rte_avp_fifo.h index 8262e4f..a0a37eb 100644 --- a/drivers/net/avp/rte_avp_fifo.h +++ b/drivers/net/avp/rte_avp_fifo.h @@ -57,6 +57,12 @@ #ifndef _RTE_AVP_FIFO_H_ #define _RTE_AVP_FIFO_H_ +#include + +#ifdef __cplusplus +extern "C" { +#endif + #ifdef __KERNEL__ /* Write memory barrier for kernel compiles */ #define AVP_WMB() smp_wmb() @@ -70,6 +76,8 @@ #endif #ifndef __KERNEL__ +#include + /** * Initializes the avp fifo structure */ @@ -154,4 +162,8 @@ avp_fifo_free_count(struct rte_avp_fifo *fifo) return (fifo->read - fifo->write - 1) & (fifo->len - 1); } +#ifdef __cplusplus +} +#endif + #endif /* _RTE_AVP_FIFO_H_ */ -- 2.1.4