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.c18
-rw-r--r--extras/libmemif/examples/icmp_responder-mt/main.c10
-rw-r--r--extras/libmemif/examples/icmp_responder-mt_3-1/main.c4
-rw-r--r--extras/libmemif/examples/icmp_responder-zero-copy-slave/main.c16
-rw-r--r--extras/libmemif/examples/icmp_responder/main.c4
6 files changed, 29 insertions, 29 deletions
diff --git a/extras/libmemif/examples/icmp_responder-eb/main.c b/extras/libmemif/examples/icmp_responder-eb/main.c
index 0e8b8f304c0..86a49da7935 100644
--- a/extras/libmemif/examples/icmp_responder-eb/main.c
+++ b/extras/libmemif/examples/icmp_responder-eb/main.c
@@ -336,7 +336,7 @@ mod_epoll_fd (int fd, uint32_t events)
DBG ("epoll_ctl: %s fd %d", strerror (errno), fd);
return -1;
}
- DBG ("fd %d moddified on epoll", fd);
+ DBG ("fd %d modified on epoll", fd);
return 0;
}
@@ -418,7 +418,7 @@ icmpr_memif_delete (long index)
c->tx_buf_num = 0;
int err;
- /* disconenct then delete memif connection */
+ /* disconnect then delete memif connection */
err = memif_delete (&c->conn);
if (err != MEMIF_ERR_SUCCESS)
INFO ("memif_delete: %s", memif_strerror (err));
@@ -994,7 +994,7 @@ poll_event (int timeout)
if (evt.data.fd > 2)
{
/* event of memif control fd */
- /* convert epolle events to memif events */
+ /* convert epoll events to memif events */
if (evt.events & EPOLLIN)
events |= MEMIF_FD_EVENT_READ;
if (evt.events & EPOLLOUT)
diff --git a/extras/libmemif/examples/icmp_responder-epoll/main.c b/extras/libmemif/examples/icmp_responder-epoll/main.c
index 0e9d96eec98..c2ea348d897 100644
--- a/extras/libmemif/examples/icmp_responder-epoll/main.c
+++ b/extras/libmemif/examples/icmp_responder-epoll/main.c
@@ -95,7 +95,7 @@ uint8_t enable_log;
typedef struct
{
uint16_t index;
- /* memif conenction handle */
+ /* memif connection handle */
memif_conn_handle_t conn;
/* tx buffers */
memif_buffer_t *tx_bufs;
@@ -104,7 +104,7 @@ typedef struct
uint16_t tx_buf_num;
/* rx buffers */
memif_buffer_t *rx_bufs;
- /* allcoated rx buffers counter */
+ /* allocated rx buffers counter */
/* number of rx buffers pointing to shared memory */
uint16_t rx_buf_num;
/* interface ip address */
@@ -258,7 +258,7 @@ mod_epoll_fd (int fd, uint32_t events)
DBG ("epoll_ctl: %s fd %d", strerror (errno), fd);
return -1;
}
- DBG ("fd %d moddified on epoll", fd);
+ DBG ("fd %d modified on epoll", fd);
return 0;
}
@@ -328,7 +328,7 @@ icmpr_buffer_alloc (long index, long n, uint16_t * r, uint16_t i,
{
memif_connection_t *c = &memif_connection[index];
int err;
- /* set data pointer to shared memory and set buffer_len to shared mmeory buffer len */
+ /* set data pointer to shared memory and set buffer_len to shared memory buffer len */
err = memif_buffer_alloc (c->conn, qid, c->tx_bufs + i, n, r, 128);
if ((err != MEMIF_ERR_SUCCESS) && (err != MEMIF_ERR_NOBUF_RING))
{
@@ -373,7 +373,7 @@ on_interrupt (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
int err = MEMIF_ERR_SUCCESS, ret_val;
uint16_t rx = 0, tx = 0;
int i = 0; /* rx buffer iterator */
- int j = 0; /* tx bufferiterator */
+ int j = 0; /* tx buffer iterator */
/* loop while there are packets in shm */
do
@@ -487,7 +487,7 @@ on_interrupt0 (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
}
j = 0;
- /* process bufers */
+ /* process buffers */
while (tx)
{
while (tx > 2)
@@ -737,7 +737,7 @@ icmpr_memif_delete (long index)
c->tx_buf_num = 0;
int err;
- /* disconenct then delete memif connection */
+ /* disconnect then delete memif connection */
err = memif_delete (&c->conn);
if (err != MEMIF_ERR_SUCCESS)
INFO ("memif_delete: %s", memif_strerror (err));
@@ -990,7 +990,7 @@ icmpr_send_proc (void *data)
}
timespec_get (&end, TIME_UTC);
printf ("\n\n");
- INFO ("Pakcet sequence finished!");
+ INFO ("Packet sequence finished!");
INFO ("Seq len: %u", seq);
uint64_t t1 = end.tv_sec - start.tv_sec;
uint64_t t2;
@@ -1237,7 +1237,7 @@ poll_event (int timeout)
if (evt.data.fd > 2)
{
/* event of memif control fd */
- /* convert epolle events to memif events */
+ /* convert epoll events to memif events */
if (evt.events & EPOLLIN)
events |= MEMIF_FD_EVENT_READ;
if (evt.events & EPOLLOUT)
diff --git a/extras/libmemif/examples/icmp_responder-mt/main.c b/extras/libmemif/examples/icmp_responder-mt/main.c
index 5c03823c68b..f37c6a026fb 100644
--- a/extras/libmemif/examples/icmp_responder-mt/main.c
+++ b/extras/libmemif/examples/icmp_responder-mt/main.c
@@ -94,7 +94,7 @@ typedef struct
typedef struct
{
uint16_t index;
- /* memif conenction handle */
+ /* memif connection handle */
memif_conn_handle_t conn;
/* interface ip address */
uint8_t ip_addr[4];
@@ -241,7 +241,7 @@ mod_epoll_fd (int epfd, int fd, uint32_t events)
DBG ("epoll_ctl: %s fd %d", strerror (errno), fd);
return -1;
}
- DBG ("fd %d moddified on epoll", fd);
+ DBG ("fd %d modified on epoll", fd);
return 0;
}
@@ -548,7 +548,7 @@ on_disconnect (memif_conn_handle_t conn, void *private_ctx)
memif_connection_t *c = &memif_connection[index];
int i, ti;
INFO ("memif disconnected!");
- /* inform thread in polling mode about memif disconenction */
+ /* inform thread in polling mode about memif disconnection */
c->pending_del = 1;
for (i = 0; i < MAX_QUEUES; i++)
{
@@ -649,7 +649,7 @@ icmpr_memif_delete (long index)
memif_connection_t *c = &memif_connection[index];
int err;
- /* disconenct then delete memif connection */
+ /* disconnect then delete memif connection */
err = memif_delete (&c->conn);
if (err != MEMIF_ERR_SUCCESS)
INFO ("memif_delete: %s", memif_strerror (err));
@@ -845,7 +845,7 @@ poll_event (int timeout)
if (evt.data.fd > 2)
{
/* event of memif control fd */
- /* convert epolle events to memif events */
+ /* convert epoll events to memif events */
if (evt.events & EPOLLIN)
events |= MEMIF_FD_EVENT_READ;
if (evt.events & EPOLLOUT)
diff --git a/extras/libmemif/examples/icmp_responder-mt_3-1/main.c b/extras/libmemif/examples/icmp_responder-mt_3-1/main.c
index a7b11bb1ebc..86c57d192e3 100644
--- a/extras/libmemif/examples/icmp_responder-mt_3-1/main.c
+++ b/extras/libmemif/examples/icmp_responder-mt_3-1/main.c
@@ -123,7 +123,7 @@ mod_epoll_fd (int epfd, int fd, uint32_t events)
DBG ("epoll_ctl: %s fd %d", strerror (errno), fd);
return -1;
}
- DBG ("fd %d moddified on epoll", fd);
+ DBG ("fd %d modified on epoll", fd);
return 0;
}
@@ -334,7 +334,7 @@ icmpr_thread_fn (void *data)
return NULL;
}
- /* Create unique socket. Each thread requires uniqueue socket. Interfaces created
+ /* Create unique socket. Each thread requires a unique socket. Interfaces created
* on the same thread can share one socket.
*/
socket_filename[strlen (socket_filename)] = '0' + ptd->index;
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 b342c512fbe..3f871d7f23f 100644
--- a/extras/libmemif/examples/icmp_responder-zero-copy-slave/main.c
+++ b/extras/libmemif/examples/icmp_responder-zero-copy-slave/main.c
@@ -90,14 +90,14 @@ uint8_t enable_log;
typedef struct
{
uint16_t index;
- /* memif conenction handle */
+ /* memif connection handle */
memif_conn_handle_t conn;
/* buffers */
memif_buffer_t *bufs;
/* allocated tx buffers counter */
/* number of tx buffers pointing to shared memory */
uint16_t tx_buf_num;
- /* allcoated rx buffers counter */
+ /* allocated rx buffers counter */
/* number of rx buffers pointing to shared memory */
uint16_t rx_buf_num;
/* interface ip address */
@@ -250,7 +250,7 @@ mod_epoll_fd (int fd, uint32_t events)
DBG ("epoll_ctl: %s fd %d", strerror (errno), fd);
return -1;
}
- DBG ("fd %d moddified on epoll", fd);
+ DBG ("fd %d modified on epoll", fd);
return 0;
}
@@ -346,14 +346,14 @@ on_interrupt (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
goto error;
}
- /* process bufers in place */
+ /* process buffers in place */
for (i = 0; i < rx; i++)
{
resolve_packet2 ((void *) (c->bufs + i)->data,
&(c->bufs + i)->len, c->ip_addr);
}
- /* enque processed buffers to tx ring */
+ /* enqueue processed buffers to tx ring */
err = memif_buffer_enq_tx (c->conn, qid, c->bufs, i, &tx);
if ((err != MEMIF_ERR_SUCCESS) && (err != MEMIF_ERR_NOBUF_RING))
{
@@ -397,7 +397,7 @@ error:
return 0;
}
-/* add ethernet encap to packet in rx buffer then enqueue this buffer to tx and tranmit */
+/* add ethernet encap to packet in rx buffer then enqueue this buffer to tx and transmit */
int
on_interrupt0 (memif_conn_handle_t conn, void *private_ctx, uint16_t qid)
{
@@ -658,7 +658,7 @@ icmpr_memif_delete (long index)
c->rx_buf_num = 0;
int err;
- /* disconenct then delete memif connection */
+ /* disconnect then delete memif connection */
err = memif_delete (&c->conn);
if (err != MEMIF_ERR_SUCCESS)
INFO ("memif_delete: %s", memif_strerror (err));
@@ -1181,7 +1181,7 @@ poll_event (int timeout)
if (evt.data.fd > 2)
{
/* event of memif control fd */
- /* convert epolle events to memif events */
+ /* convert epoll events to memif events */
if (evt.events & EPOLLIN)
events |= MEMIF_FD_EVENT_READ;
if (evt.events & EPOLLOUT)
diff --git a/extras/libmemif/examples/icmp_responder/main.c b/extras/libmemif/examples/icmp_responder/main.c
index df94da34478..517512340e0 100644
--- a/extras/libmemif/examples/icmp_responder/main.c
+++ b/extras/libmemif/examples/icmp_responder/main.c
@@ -193,7 +193,7 @@ int
icmpr_memif_delete ()
{
int err;
- /* disconenct then delete memif connection */
+ /* disconnect then delete memif connection */
err = memif_delete (&(&memif_connection)->conn);
if (err != MEMIF_ERR_SUCCESS)
INFO ("memif_delete: %s", memif_strerror (err));
@@ -224,7 +224,7 @@ icmpr_buffer_alloc (long n, uint16_t qid)
memif_connection_t *c = &memif_connection;
int err;
uint16_t r;
- /* set data pointer to shared memory and set buffer_len to shared mmeory buffer len */
+ /* set data pointer to shared memory and set buffer_len to shared memory buffer len */
err = memif_buffer_alloc (c->conn, qid, c->tx_bufs, n, &r, 0);
if (err != MEMIF_ERR_SUCCESS)
{