aboutsummaryrefslogtreecommitdiffstats
path: root/extras/libmemif/examples
diff options
context:
space:
mode:
Diffstat (limited to 'extras/libmemif/examples')
-rw-r--r--extras/libmemif/examples/icmp_responder-eb/main.c6
-rw-r--r--extras/libmemif/examples/icmp_responder-epoll/main.c10
-rw-r--r--extras/libmemif/examples/icmp_responder-mt/main.c2
-rw-r--r--extras/libmemif/examples/icmp_responder-zero-copy-slave/main.c12
4 files changed, 15 insertions, 15 deletions
diff --git a/extras/libmemif/examples/icmp_responder-eb/main.c b/extras/libmemif/examples/icmp_responder-eb/main.c
index 646a6ca0511..0e8b8f304c0 100644
--- a/extras/libmemif/examples/icmp_responder-eb/main.c
+++ b/extras/libmemif/examples/icmp_responder-eb/main.c
@@ -375,7 +375,7 @@ on_disconnect (memif_conn_handle_t conn, void *private_ctx)
}
int
-control_fd_update (int fd, uint8_t events)
+control_fd_update (int fd, uint8_t events, void *ctx)
{
/* convert memif event definitions to epoll events */
if (events & MEMIF_FD_EVENT_DEL)
@@ -562,7 +562,7 @@ error:
if (err != MEMIF_ERR_SUCCESS)
INFO ("memif_buffer_free: %s", memif_strerror (err));
c->rx_buf_num -= rx;
- DBG ("freed %d buffers. %u/%u alloc/free buffers", fb, c->rx_buf_num,
+ DBG ("freed %d buffers. %u/%u alloc/free buffers", rx, c->rx_buf_num,
MAX_MEMIF_BUFS - c->rx_buf_num);
return 0;
}
@@ -637,7 +637,7 @@ error:
INFO ("memif_buffer_free: %s", memif_strerror (err));
c->rx_buf_num -= rx;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
+ rx, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
return 0;
}
diff --git a/extras/libmemif/examples/icmp_responder-epoll/main.c b/extras/libmemif/examples/icmp_responder-epoll/main.c
index ecc05a41e77..0e9d96eec98 100644
--- a/extras/libmemif/examples/icmp_responder-epoll/main.c
+++ b/extras/libmemif/examples/icmp_responder-epoll/main.c
@@ -304,7 +304,7 @@ on_disconnect (memif_conn_handle_t conn, void *private_ctx)
/* user needs to watch new fd or stop watching fd that is about to be closed.
control fd will be modified during connection establishment to minimize CPU usage */
int
-control_fd_update (int fd, uint8_t events)
+control_fd_update (int fd, uint8_t events, void *ctx)
{
/* convert memif event definitions to epoll events */
if (events & MEMIF_FD_EVENT_DEL)
@@ -436,7 +436,7 @@ error:
INFO ("memif_buffer_free: %s", memif_strerror (err));
c->rx_buf_num -= rx;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
+ rx, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
return 0;
}
@@ -521,7 +521,7 @@ on_interrupt0 (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
rx -= j;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, rx, MAX_MEMIF_BUFS - rx);
+ rx, rx, MAX_MEMIF_BUFS - rx);
/* transmit allocated buffers */
err = memif_tx_burst (c->conn, qid, c->tx_bufs, j, &tx);
@@ -545,7 +545,7 @@ error:
INFO ("memif_buffer_free: %s", memif_strerror (err));
c->rx_buf_num -= rx;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
+ rx, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
return 0;
}
@@ -612,7 +612,7 @@ error:
INFO ("memif_buffer_free: %s", memif_strerror (err));
c->rx_buf_num -= rx;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
+ rx, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
return 0;
}
diff --git a/extras/libmemif/examples/icmp_responder-mt/main.c b/extras/libmemif/examples/icmp_responder-mt/main.c
index bc2f71dd328..5c03823c68b 100644
--- a/extras/libmemif/examples/icmp_responder-mt/main.c
+++ b/extras/libmemif/examples/icmp_responder-mt/main.c
@@ -565,7 +565,7 @@ on_disconnect (memif_conn_handle_t conn, void *private_ctx)
/* user needs to watch new fd or stop watching fd that is about to be closed.
control fd will be modified during connection establishment to minimize CPU usage */
int
-control_fd_update (int fd, uint8_t events)
+control_fd_update (int fd, uint8_t events, void *ctx)
{
/* convert memif event definitions to epoll events */
if (events & MEMIF_FD_EVENT_DEL)
diff --git a/extras/libmemif/examples/icmp_responder-zero-copy-slave/main.c b/extras/libmemif/examples/icmp_responder-zero-copy-slave/main.c
index 7913588299a..b342c512fbe 100644
--- a/extras/libmemif/examples/icmp_responder-zero-copy-slave/main.c
+++ b/extras/libmemif/examples/icmp_responder-zero-copy-slave/main.c
@@ -296,7 +296,7 @@ on_disconnect (memif_conn_handle_t conn, void *private_ctx)
/* user needs to watch new fd or stop watching fd that is about to be closed.
control fd will be modified during connection establishment to minimize CPU usage */
int
-control_fd_update (int fd, uint8_t events)
+control_fd_update (int fd, uint8_t events, void *ctx)
{
/* convert memif event definitions to epoll events */
if (events & MEMIF_FD_EVENT_DEL)
@@ -371,7 +371,7 @@ on_interrupt (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
c->rx_buf_num -= rx;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, rx, MAX_MEMIF_BUFS - rx);
+ rx, rx, MAX_MEMIF_BUFS - rx);
/* transmit allocated buffers */
err = memif_tx_burst (c->conn, qid, c->bufs, rx, &tx);
@@ -393,7 +393,7 @@ error:
INFO ("memif_buffer_free: %s", memif_strerror (err));
c->rx_buf_num = 0;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
+ rx, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
return 0;
}
@@ -450,7 +450,7 @@ on_interrupt0 (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
c->rx_buf_num -= rx;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, rx, MAX_MEMIF_BUFS - rx);
+ rx, rx, MAX_MEMIF_BUFS - rx);
/* transmit allocated buffers */
err = memif_tx_burst (c->conn, qid, c->bufs, i, &tx);
@@ -472,7 +472,7 @@ error:
INFO ("memif_buffer_free: %s", memif_strerror (err));
c->rx_buf_num = 0;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
+ rx, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
return 0;
}
@@ -538,7 +538,7 @@ error:
INFO ("memif_buffer_free: %s", memif_strerror (err));
c->rx_buf_num = 0;
DBG ("freed %d buffers. %u/%u alloc/free buffers",
- fb, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
+ rx, c->rx_buf_num, MAX_MEMIF_BUFS - c->rx_buf_num);
return 0;
}