@@ -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;
@@ -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]);
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(-)