diff options
author | Balasubramanian Manoharan <bala.manoharan@linaro.org> | 2014-12-08 17:32:55 +0530 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-12-10 15:55:12 +0300 |
commit | 08c99facf9962c0dd2d0ef2e4b4e21cee2d6735c (patch) | |
tree | 766a6410bf9c6d8bd6767b6f41f947a9b0e48905 /platform/linux-generic/include | |
parent | 08796a4634fd40e558425752bd2352176e70f10d (diff) |
linux-generic:pktio:move static inline functions to header
Moves static inline access functions in pktio module to header file.
This changes is required as these functions are accessed by classification module
Signed-off-by: Balasubramanian Manoharan <bala.manoharan@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Reviewed-by: Ciprian Barbu <ciprian.barbu@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-generic/include')
-rw-r--r-- | platform/linux-generic/include/odp_packet_io_internal.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/platform/linux-generic/include/odp_packet_io_internal.h b/platform/linux-generic/include/odp_packet_io_internal.h index 7819dc7c1..d129f2259 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -22,6 +22,8 @@ extern "C" { #include <odp_packet_socket.h> #include <odp_align_internal.h> +#include <odp_config.h> +#include <odp_hints.h> #include <linux/if.h> /** @@ -50,6 +52,21 @@ typedef union { uint8_t pad[ODP_CACHE_LINE_SIZE_ROUNDUP(sizeof(struct pktio_entry))]; } pktio_entry_t; +typedef struct { + pktio_entry_t entries[ODP_CONFIG_PKTIO_ENTRIES]; +} pktio_table_t; + +extern void *pktio_entry_ptr[]; + + +static inline pktio_entry_t *get_pktio_entry(odp_pktio_t id) +{ + if (odp_unlikely(id == ODP_PKTIO_INVALID || + id > ODP_CONFIG_PKTIO_ENTRIES)) + return NULL; + + return pktio_entry_ptr[id - 1]; +} #ifdef __cplusplus } #endif |