diff mbox

[NETMAP,05/12] linux-netmap: pktio: remove unused ioctl code

Message ID 1425322017-14636-6-git-send-email-ciprian.barbu@linaro.org
State New
Headers show

Commit Message

Ciprian Barbu March 2, 2015, 6:46 p.m. UTC
Signed-off-by: Ciprian Barbu <ciprian.barbu@linaro.org>
---
 platform/linux-netmap/include/odp_packet_netmap.h |  2 --
 platform/linux-netmap/odp_packet_netmap.c         | 27 +++--------------------
 2 files changed, 3 insertions(+), 26 deletions(-)
diff mbox

Patch

diff --git a/platform/linux-netmap/include/odp_packet_netmap.h b/platform/linux-netmap/include/odp_packet_netmap.h
index 161b968..d4895ce 100644
--- a/platform/linux-netmap/include/odp_packet_netmap.h
+++ b/platform/linux-netmap/include/odp_packet_netmap.h
@@ -22,8 +22,6 @@ 
 #define ODP_NETMAP_RING_HW	0
 #define ODP_NETMAP_RING_SW	1
 
-#define NETMAP_BLOCKING_IO
-
 /** Packet socket using netmap mmaped rings for both Rx and Tx */
 typedef struct {
 	odp_buffer_pool_t pool;
diff --git a/platform/linux-netmap/odp_packet_netmap.c b/platform/linux-netmap/odp_packet_netmap.c
index 6d5228d..91b7f68 100644
--- a/platform/linux-netmap/odp_packet_netmap.c
+++ b/platform/linux-netmap/odp_packet_netmap.c
@@ -214,25 +214,17 @@  int recv_pkt_netmap(pkt_netmap_t * const pkt_nm, odp_packet_t pkt_table[],
 	uint32_t limit, rx;
 	uint32_t ringid = pkt_nm->begin;
 	odp_packet_t pkt = ODP_PACKET_INVALID;
-#ifdef NETMAP_BLOCKING_IO
 	struct pollfd fds[1];
 	int ret;
-#endif
 
 	fd = pkt_nm->desc->fd;
-#ifdef NETMAP_BLOCKING_IO
 	fds[0].fd = fd;
 	fds[0].events = POLLIN;
-#endif
 
 	while (nb_rx < len) {
-#ifdef NETMAP_BLOCKING_IO
-		ret = poll(&fds[0], 1, POLL_TMO);
+		ret = poll(fds, 1, POLL_TMO);
 		if (ret <= 0 || (fds[0].revents & POLLERR))
 			break;
-#else
-		ioctl(fd, NIOCRXSYNC, NULL);
-#endif
 
 		/* Find first ring not empty */
 		while (nm_ring_empty(rxring)) {
@@ -324,26 +316,17 @@  int send_pkt_netmap(pkt_netmap_t * const pkt_nm, odp_packet_t pkt_table[],
 	uint32_t            limit, tx;
 	uint32_t            ringid = pkt_nm->begin;
 	odp_packet_t        pkt;
-
-#ifdef NETMAP_BLOCKING_IO
-	struct pollfd fds[2];
+	struct pollfd fds[1];
 	int ret;
-#endif
 
 	fd = pkt_nm->desc->fd;
-#ifdef NETMAP_BLOCKING_IO
 	fds[0].fd = fd;
 	fds[0].events = POLLOUT;
-#endif
 
 	while (nb_tx < len) {
-#ifdef NETMAP_BLOCKING_IO
-		ret = poll(&fds[0], 1, POLL_TMO);
+		ret = poll(fds, 1, POLL_TMO);
 		if (ret <= 0 || (fds[0].revents & POLLERR))
 			break;
-#else
-		ioctl(fd, NIOCTXSYNC, NULL);
-#endif
 
 		/* Find first ring not empty */
 		while (nm_ring_empty(txring)) {
@@ -389,10 +372,6 @@  int send_pkt_netmap(pkt_netmap_t * const pkt_nm, odp_packet_t pkt_table[],
 		}
 	}
 
-#ifndef NETMAP_BLOCKING_IO
-	ioctl(fd, NIOCTXSYNC, NULL);
-#endif
-
 	for (tx = 0; tx < len; tx++)
 		odph_packet_free(pkt_table[tx]);