aboutsummaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorGilad Ben-Yossef <gilad@benyossef.com>2014-08-24 13:53:57 +0300
committerMaxim Uvarov <maxim.uvarov@linaro.org>2014-08-26 18:25:53 +0400
commitc597a6036f3ae7b2d015332b76c4b03ad9dcd0d4 (patch)
treed2c1ddd9c6359450ca8046883ed3e7b99dd057e6 /platform
parent21bd4f0c2e3b05571c573caa155888f9c253805c (diff)
odp_packet_socket: define PACKET_FANOUT if needed
PACKET_FANOUT and friends is only defined post kernel 3.1, meaning a build against older kernel header fails. By providing a backwards compatible define for older kernels we allow the build to work, if run time attempts of using the missing functionality on older kernels to degrade to a run-time EINVAL error in init time if the specific feature is used. Signed-off-by: Gilad Ben-Yossef <giladb@ezchip.com> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform')
-rw-r--r--platform/linux-generic/include/odp_packet_socket.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/platform/linux-generic/include/odp_packet_socket.h b/platform/linux-generic/include/odp_packet_socket.h
index f99180676..f38f5b04f 100644
--- a/platform/linux-generic/include/odp_packet_socket.h
+++ b/platform/linux-generic/include/odp_packet_socket.h
@@ -29,6 +29,16 @@
/** Max transmit (Tx) burst size*/
#define ODP_PACKET_SOCKET_MAX_BURST_TX 32
+/*
+ * This makes sure that building for kernels older than 3.1 works
+ * and a fanout requests fails (for invalid packet socket option)
+ * in runtime if requested
+ */
+#ifndef PACKET_FANOUT
+#define PACKET_FANOUT 18
+#define PACKET_FANOUT_HASH 0
+#endif /* PACKET_FANOUT */
+
typedef struct {
int sockfd; /**< socket descriptor */
odp_buffer_pool_t pool; /**< buffer pool to alloc packets from */