From: Bogdan Pricope <bogdan.pric...@linaro.org> Move SOCK_ERR_REPORT macro from linux-generic version of odp_packet_io_internal.h to a common header file. This is part of an attempt to cleanup linux-generic version of odp_packet_io_internal.h from macros used only in linux-generic platform before enabling it for linux-dpdk platform as well.
Signed-off-by: Bogdan Pricope <bogdan.pric...@linaro.org> --- /** Email created from pull request 267 (bogdanPricope:2_0_pktio_internal_pr) ** https://github.com/Linaro/odp/pull/267 ** Patch: https://github.com/Linaro/odp/pull/267.patch ** Base sha: ca1be967bd4f6aec7dc99b72de643718cb8a32b8 ** Merge commit sha: 29fab9a6071107a8bb565ceee1837755d3ca1eee **/ platform/linux-generic/include/odp_packet_io_internal.h | 6 ------ platform/linux-generic/pktio/common.h | 8 ++++++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 1302a59bf..a2e1fdd9c 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -42,12 +42,6 @@ typedef union pktio_entry_u pktio_entry_t; #define PKTIN_INVALID ((odp_pktin_queue_t) {ODP_PKTIO_INVALID, 0}) #define PKTOUT_INVALID ((odp_pktout_queue_t) {ODP_PKTIO_INVALID, 0}) -/** Determine if a socket read/write error should be reported. Transient errors - * that simply require the caller to retry are ignored, the _send/_recv APIs - * are non-blocking and it is the caller's responsibility to retry if the - * requested number of packets were not handled. */ -#define SOCK_ERR_REPORT(e) (e != EAGAIN && e != EWOULDBLOCK && e != EINTR) - struct pktio_entry { const pktio_ops_module_t *ops; /**< Implementation specific methods */ uint8_t ops_data[ODP_PKTIO_ODPS_DATA_MAX_SIZE]; /**< IO operation diff --git a/platform/linux-generic/pktio/common.h b/platform/linux-generic/pktio/common.h index 025e1893d..2ea68f646 100644 --- a/platform/linux-generic/pktio/common.h +++ b/platform/linux-generic/pktio/common.h @@ -7,6 +7,14 @@ #ifndef ODP_PKTIO_COMMON_H_ #define ODP_PKTIO_COMMON_H_ +#include <errno.h> + +/** Determine if a socket read/write error should be reported. Transient errors + * that simply require the caller to retry are ignored, the _send/_recv APIs + * are non-blocking and it is the caller's responsibility to retry if the + * requested number of packets were not handled. */ +#define SOCK_ERR_REPORT(e) (e != EAGAIN && e != EWOULDBLOCK && e != EINTR) + /** * Read the MTU from a packet socket */