diff options
Diffstat (limited to 'platform/linux-generic/include')
-rw-r--r-- | platform/linux-generic/include/odp_packet_io_internal.h | 3 | ||||
-rw-r--r-- | platform/linux-generic/include/odp_packet_netmap.h | 24 |
2 files changed, 27 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 60aca1c..353b40d 100644 --- a/platform/linux-generic/include/odp_packet_io_internal.h +++ b/platform/linux-generic/include/odp_packet_io_internal.h @@ -21,6 +21,7 @@ extern "C" { #include <odp/spinlock.h> #include <odp/ticketlock.h> #include <odp_packet_socket.h> +#include <odp_packet_netmap.h> #include <odp_classification_datamodel.h> #include <odp_align_internal.h> #include <odp_debug_internal.h> @@ -50,6 +51,7 @@ struct pktio_entry { pkt_sock_t pkt_sock; /**< using socket API for IO */ pkt_sock_mmap_t pkt_sock_mmap; /**< using socket mmap * API for IO */ + pkt_netmap_t pkt_nm; /**< using netmap API for IO */ }; enum { STATE_START = 0, @@ -122,6 +124,7 @@ static inline void pktio_cls_enabled_set(pktio_entry_t *entry, int ena) int pktin_poll(pktio_entry_t *entry); +extern const pktio_if_ops_t netmap_pktio_ops; extern const pktio_if_ops_t sock_mmsg_pktio_ops; extern const pktio_if_ops_t sock_mmap_pktio_ops; extern const pktio_if_ops_t loopback_pktio_ops; diff --git a/platform/linux-generic/include/odp_packet_netmap.h b/platform/linux-generic/include/odp_packet_netmap.h new file mode 100644 index 0000000..23aea5b --- /dev/null +++ b/platform/linux-generic/include/odp_packet_netmap.h @@ -0,0 +1,24 @@ +/* Copyright (c) 2015, Linaro Limited + * All rights reserved. + * + * SPDX-License-Identifier: BSD-3-Clause + */ + +#ifndef ODP_PACKET_NETMAP_H +#define ODP_PACKET_NETMAP_H + +#include <odp/pool.h> + +#include <linux/if_ether.h> + +/** Packet socket using netmap mmaped rings for both Rx and Tx */ +typedef struct { + odp_pool_t pool; /**< pool to alloc packets from */ + size_t max_frame_len; /**< buf_size - sizeof(pkt_hdr) */ + struct nm_desc *desc; /**< netmap meta-data for the device */ + uint32_t if_flags; /**< interface flags */ + int sockfd; /**< control socket */ + unsigned char if_mac[ETH_ALEN]; /**< eth mac address */ +} pkt_netmap_t; + +#endif |