diff options
author | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-09-26 19:19:42 +0400 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2014-10-01 14:48:41 +0400 |
commit | d8cda8b0f395d00902a50690fee3679f65780013 (patch) | |
tree | 9de3235a3e383de2fdc10d815bec8cc6ec4ff890 /platform/linux-dpdk/include/api | |
parent | 32e78e10572fb411e9369dfeef0e6daab8bff90a (diff) |
git split: delete dpdk
Dpdk will be developed and supported in different git repo:
https://git.linaro.org/lng/odp-dpdk.git
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'platform/linux-dpdk/include/api')
-rw-r--r-- | platform/linux-dpdk/include/api/odp_buffer.h | 94 | ||||
-rw-r--r-- | platform/linux-dpdk/include/api/odp_buffer_pool.h | 99 | ||||
-rw-r--r-- | platform/linux-dpdk/include/api/odp_packet.h | 246 | ||||
-rw-r--r-- | platform/linux-dpdk/include/api/odp_pktio_types.h | 45 |
4 files changed, 0 insertions, 484 deletions
diff --git a/platform/linux-dpdk/include/api/odp_buffer.h b/platform/linux-dpdk/include/api/odp_buffer.h deleted file mode 100644 index 9ea1ed8a1..000000000 --- a/platform/linux-dpdk/include/api/odp_buffer.h +++ /dev/null @@ -1,94 +0,0 @@ -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - - -/** - * @file - * - * ODP buffer descriptor - */ - -#ifndef ODP_BUFFER_H_ -#define ODP_BUFFER_H_ - -#ifdef __cplusplus -extern "C" { -#endif - - - -#include <odp_std_types.h> - - - - - -/** - * ODP buffer - */ -typedef unsigned long odp_buffer_t; - - -#define ODP_BUFFER_INVALID (0xffffffff) /**< Invalid buffer */ - - -/** - * Buffer start address - * - * @param buf Buffer handle - * - * @return Buffer start address - */ -void *odp_buffer_addr(odp_buffer_t buf); - -/** - * Buffer maximum data size - * - * @param buf Buffer handle - * - * @return Buffer maximum data size - */ -size_t odp_buffer_size(odp_buffer_t buf); - -/** - * Buffer type - * - * @param buf Buffer handle - * - * @return Buffer type - */ -int odp_buffer_type(odp_buffer_t buf); - -#define ODP_BUFFER_TYPE_INVALID (-1) /**< Buffer type invalid */ -#define ODP_BUFFER_TYPE_ANY 0 /**< Buffer that can hold any other - buffer type */ -#define ODP_BUFFER_TYPE_RAW 1 /**< Raw buffer, no additional metadata */ -#define ODP_BUFFER_TYPE_PACKET 2 /**< Packet buffer */ -#define ODP_BUFFER_TYPE_TIMEOUT 3 /**< Timeout buffer */ - -/** - * Tests if buffer is valid - * - * @param buf Buffer handle - * - * @return 1 if valid, otherwise 0 - */ -int odp_buffer_is_valid(odp_buffer_t buf); - -/** - * Print buffer metadata to STDOUT - * - * @param buf Buffer handle - * - */ -void odp_buffer_print(odp_buffer_t buf); - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-dpdk/include/api/odp_buffer_pool.h b/platform/linux-dpdk/include/api/odp_buffer_pool.h deleted file mode 100644 index 4b75cf53c..000000000 --- a/platform/linux-dpdk/include/api/odp_buffer_pool.h +++ /dev/null @@ -1,99 +0,0 @@ -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - - -/** - * @file - * - * ODP buffer pool - */ - -#ifndef ODP_BUFFER_POOL_H_ -#define ODP_BUFFER_POOL_H_ - -#ifdef __cplusplus -extern "C" { -#endif - - - -#include <odp_std_types.h> -#include <odp_buffer.h> - -/** Maximum queue name lenght in chars */ -#define ODP_BUFFER_POOL_NAME_LEN 32 - -/** Invalid buffer pool */ -#define ODP_BUFFER_POOL_INVALID (0xffffffff) - -/** ODP buffer pool */ -typedef unsigned long odp_buffer_pool_t; - - -/** - * Create a buffer pool - * - * @param name Name of the pool (max ODP_BUFFER_POOL_NAME_LEN - 1 chars) - * @param base_addr Pool base address - * @param size Pool size in bytes - * @param buf_size Buffer size in bytes - * @param buf_align Minimum buffer alignment - * @param buf_type Buffer type - * - * @return Buffer pool handle - */ -odp_buffer_pool_t odp_buffer_pool_create(const char *name, - void *base_addr, uint64_t size, - size_t buf_size, size_t buf_align, - int buf_type); - - -/** - * Find a buffer pool by name - * - * @param name Name of the pool - * - * @return Buffer pool handle, or ODP_BUFFER_POOL_INVALID if not found. - */ -odp_buffer_pool_t odp_buffer_pool_lookup(const char *name); - - -/** - * Print buffer pool info - * - * @param pool Pool handle - * - */ -void odp_buffer_pool_print(odp_buffer_pool_t pool); - - - -/** - * Buffer alloc - * - * @param pool Pool handle - * - * @return Buffer handle or ODP_BUFFER_INVALID - */ -odp_buffer_t odp_buffer_alloc(odp_buffer_pool_t pool); - - -/** - * Buffer free - * - * @param buf Buffer handle - * - */ -void odp_buffer_free(odp_buffer_t buf); - - - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-dpdk/include/api/odp_packet.h b/platform/linux-dpdk/include/api/odp_packet.h deleted file mode 100644 index 64a92e88b..000000000 --- a/platform/linux-dpdk/include/api/odp_packet.h +++ /dev/null @@ -1,246 +0,0 @@ -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - - -/** - * @file - * - * ODP packet descriptor - */ - -#ifndef ODP_PACKET_H_ -#define ODP_PACKET_H_ - -#ifdef __cplusplus -extern "C" { -#endif - -#include <odp_buffer.h> - - -/** - * ODP packet descriptor - */ -typedef odp_buffer_t odp_packet_t; - - -/** Invalid packet */ -#define ODP_PACKET_INVALID ODP_BUFFER_INVALID - -/** Invalid offset */ -#define ODP_PACKET_OFFSET_INVALID ((size_t)-1) - - -/** - * Initialize the packet - * - * Needs to be called if the user allocates a packet buffer, i.e. the packet - * has not been received from I/O through ODP. - * - * @param pkt Packet handle - */ -void odp_packet_init(odp_packet_t pkt); - -/** - * Convert from packet handle to buffer handle - * - * @param buf Buffer handle - * - * @return Packet handle - */ -odp_packet_t odp_packet_from_buffer(odp_buffer_t buf); - -/** - * Convert from buffer handle to packet handle - * - * @param pkt Packet handle - * - * @return Buffer handle - */ -odp_buffer_t odp_buffer_from_packet(odp_packet_t pkt); - -/** - * Set the packet length - * - * @param pkt Packet handle - * @param len Length of packet in bytes - */ -void odp_packet_set_len(odp_packet_t pkt, size_t len); - -/** - * Get the packet length - * - * @param pkt Packet handle - * - * @return Packet length in bytes - */ -size_t odp_packet_get_len(odp_packet_t pkt); - -/** - * Set packet user context - * - * @param buf Packet handle - * @param ctx User context - * - */ -void odp_packet_set_ctx(odp_packet_t buf, const void *ctx); - -/** - * Get packet user context - * - * @param buf Packet handle - * - * @return User context - */ -void *odp_packet_get_ctx(odp_packet_t buf); - -/** - * Get address to the start of the packet buffer - * - * The address of the packet buffer is not necessarily the same as the start - * address of the received frame, e.g. an eth frame may be offset by 2 or 6 - * bytes to ensure 32 or 64-bit alignment of the IP header. - * Use odp_packet_l2(pkt) to get the start address of a received valid frame - * or odp_packet_start(pkt) to get the start address even if no valid L2 header - * could be found. - * - * @param pkt Packet handle - * - * @return Pointer to the start of the packet buffer - * - * @see odp_packet_l2(), odp_packet_start() - */ -uint8_t *odp_packet_buf_addr(odp_packet_t pkt); - -/** - * Get pointer to the start of the received frame - * - * The address of the packet buffer is not necessarily the same as the start - * address of the received frame, e.g. an eth frame may be offset by 2 or 6 - * bytes to ensure 32 or 64-bit alignment of the IP header. - * Use odp_packet_l2(pkt) to get the start address of a received valid eth frame - * - * odp_packet_start() will always return a pointer to the start of the frame, - * even if the frame is unrecognized and no valid L2 header could be found. - * - * @param pkt Packet handle - * - * @return Pointer to the start of the received frame - * - * @see odp_packet_l2(), odp_packet_buf_addr() - */ -uint8_t *odp_packet_start(odp_packet_t pkt); - -/** - * Get pointer to the start of the L2 frame - * - * The L2 frame header address is not necessarily the same as the address of the - * packet buffer, see odp_packet_buf_addr() - * - * @param pkt Packet handle - * - * @return Pointer to L2 header or NULL if not found - * - * @see odp_packet_buf_addr(), odp_packet_start() - */ -uint8_t *odp_packet_l2(odp_packet_t pkt); - -/** - * Return the byte offset from the packet buffer to the L2 frame - * - * @param pkt Packet handle - * - * @return L2 byte offset or ODP_PACKET_OFFSET_INVALID if not found - */ -size_t odp_packet_l2_offset(odp_packet_t pkt); - -/** - * Set the byte offset to the L2 frame - * - * @param pkt Packet handle - * @param offset L2 byte offset - */ -void odp_packet_set_l2_offset(odp_packet_t pkt, size_t offset); - - -/** - * Get pointer to the start of the L3 packet - * - * @param pkt Packet handle - * - * @return Pointer to L3 packet or NULL if not found - * - */ -uint8_t *odp_packet_l3(odp_packet_t pkt); - -/** - * Return the byte offset from the packet buffer to the L3 packet - * - * @param pkt Packet handle - * - * @return L3 byte offset or ODP_PACKET_OFFSET_INVALID if not found - */ -size_t odp_packet_l3_offset(odp_packet_t pkt); - -/** - * Set the byte offset to the L3 packet - * - * @param pkt Packet handle - * @param offset L3 byte offset - */ -void odp_packet_set_l3_offset(odp_packet_t pkt, size_t offset); - - -/** - * Get pointer to the start of the L4 packet - * - * @param pkt Packet handle - * - * @return Pointer to L4 packet or NULL if not found - * - */ -uint8_t *odp_packet_l4(odp_packet_t pkt); - -/** - * Return the byte offset from the packet buffer to the L4 packet - * - * @param pkt Packet handle - * - * @return L4 byte offset or ODP_PACKET_OFFSET_INVALID if not found - */ -size_t odp_packet_l4_offset(odp_packet_t pkt); - -/** - * Set the byte offset to the L4 packet - * - * @param pkt Packet handle - * @param offset L4 byte offset - */ -void odp_packet_set_l4_offset(odp_packet_t pkt, size_t offset); - -/** - * Print (debug) information about the packet - * - * @param pkt Packet handle - */ -void odp_packet_print(odp_packet_t pkt); - -/** - * Copy contents and metadata from pkt_src to pkt_dst - * Useful when creating copies of packets - * - * @param pkt_dst Destination packet - * @param pkt_src Source packet - * - * @return 0 if successful - */ -int odp_packet_copy(odp_packet_t pkt_dst, odp_packet_t pkt_src); - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/platform/linux-dpdk/include/api/odp_pktio_types.h b/platform/linux-dpdk/include/api/odp_pktio_types.h deleted file mode 100644 index b23e6da92..000000000 --- a/platform/linux-dpdk/include/api/odp_pktio_types.h +++ /dev/null @@ -1,45 +0,0 @@ - -/* Copyright (c) 2013, Linaro Limited - * All rights reserved. - * - * SPDX-License-Identifier: BSD-3-Clause - */ - -#ifndef ODP_PKTIO_TYPES_H -#define ODP_PKTIO_TYPES_H - -#ifdef __cplusplus -extern "C" { -#endif - -/* We should ensure that future enum values will never overlap, otherwise - * applications that want netmap suport might get in trouble if the odp lib - * was not built with netmap support and there are more types define below - */ - -typedef enum { - ODP_PKTIO_TYPE_SOCKET_BASIC = 0x1, - ODP_PKTIO_TYPE_SOCKET_MMSG, - ODP_PKTIO_TYPE_SOCKET_MMAP, - ODP_PKTIO_TYPE_NETMAP, - ODP_PKTIO_TYPE_DPDK, -} odp_pktio_type_t; - -#include <odp_pktio_socket.h> -#ifdef ODP_HAVE_NETMAP -#include <odp_pktio_netmap.h> -#endif - -typedef union odp_pktio_params_t { - odp_pktio_type_t type; - socket_params_t sock_params; -#ifdef ODP_HAVE_NETMAP - netmap_params_t nm_params; -#endif -} odp_pktio_params_t; - -#ifdef __cplusplus -} -#endif - -#endif |