From d14083ebedb0811cf52349ab3bcbd72178340a32 Mon Sep 17 00:00:00 2001 From: Carl Wallen Date: Mon, 16 Dec 2013 13:30:22 +0200 Subject: Initial ODP packet IO functionality Added new ODP APIs for setting up basic packet IO: odp_pktio_t odp_pktio_open(char *dev, odp_buffer_pool_t pool) int odp_pktio_close(odp_pktio_t id) int odp_pktio_recv(odp_pktio_t id, odp_packet_t pkt_table[], unsigned len) int odp_pktio_send(odp_pktio_t id, odp_packet_t pkt_table[], unsigned len) An example using the API is located in odp/test/packet/odp_example_pktio.c Compile with the provided packet/Makefile and run with root privileges: $> sudo ./odp_packet -i eth0,eth1,eth2,eth3 The underlying implementation of ODP packet IO for linux-generic is based on linux raw packet sockets. The user can choose the socket 'mode' from one of the following (odp_packet_socket.c): #define ODP_PACKET_SOCKET_BASIC 0 /** use recv()/send() */ #define ODP_PACKET_SOCKET_MMSG 1 /** use recvmmsg()/sendmmsg() */ #define ODP_PACKET_SOCKET_MMAP 2 /** use PACKET_MMAP */ /** Choose one from the alternatives above */ #define ODP_PACKET_SOCKET_MODE (ODP_PACKET_SOCKET_MMAP) Signed-off-by: Carl Wallen --- .gitignore | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .gitignore (limited to '.gitignore') diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..24a9392b7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,6 @@ +*.o +*.d +*~ +lib/ +test/odp_app + -- cgit v1.2.3