libmemif: clean up typos 50/27350/3
authorPaul Vinciguerra <pvinci@vinciconsulting.com>
Sat, 30 May 2020 03:03:06 +0000 (23:03 -0400)
committerDamjan Marion <dmarion@me.com>
Fri, 4 Dec 2020 22:48:07 +0000 (22:48 +0000)
Type: style

Change-Id: I0d25d922312dfd60a665916cf47c3d2faa29ea49
Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
14 files changed:
extras/libmemif/docs/devperftest_doc.md
extras/libmemif/examples/icmp_responder-eb/main.c
extras/libmemif/examples/icmp_responder-epoll/main.c
extras/libmemif/examples/icmp_responder-mt/main.c
extras/libmemif/examples/icmp_responder-mt_3-1/main.c
extras/libmemif/examples/icmp_responder-zero-copy-slave/main.c
extras/libmemif/examples/icmp_responder/main.c
extras/libmemif/src/libmemif.h
extras/libmemif/src/main.c
extras/libmemif/src/memif_private.h
src/plugins/memif/memif.api
src/plugins/memif/memif.c
src/plugins/memif/node.c
src/plugins/memif/socket.c

index a2748ca..4c210f5 100644 (file)
@@ -1,6 +1,6 @@
 ## Development performance test    {#libmemif_devperftest_doc}
 
-Simle test cases using ICMP. icmpr-epoll example app generates and transmits packets over memif interface.
+Simple test cases using ICMP. icmpr-epoll example app generates and transmits packets over memif interface.
 
 #### TC1: LIB-VPP
 
@@ -29,9 +29,9 @@ send 0 5 192.168.1.1 02:fe:ff:ff:ff:ff
 ```
 this command will create new thread which will generate icmp packets and transmit them over memif connection with specified index. Once the sequence is finished status will be printed.
 
-###### Example results (owerview of test data)
+###### Example results (overview of test data)
 
-(This test was run with modofication in VPP-memif plugin. The modification disallows memif tx node to allocate last ring buffer)
+(This test was run with modification in VPP-memif plugin. The modification disallows memif tx node to allocate last ring buffer)
 lib-tx: 200M (if ring full don't drop packets)
 vpp-rx: 200M
 vpp-tx: 200M - 50K (if ring full drop packets)
@@ -58,7 +58,7 @@ send 0 5 192.168.1.1 aa:aa:aa:aa:aa:aa
 ```
 > icmpr-epoll example app doesn't check ip or mac address so as long as the format is correct you can type anything as ip_daddr and hw_daddr arguments.
 
-###### Example results (owerview of test data)
+###### Example results (overview of test data)
 
 lib1-tx: 200M (if ring full don't drop packets)
 lib2-rx: 200M
@@ -67,7 +67,7 @@ lib1-rx: 200M
 drop: obsolete
 pps: 4.5M
 multiple interfaces:
-not tested (excpected same as TC1)
+not tested (expected same as TC1)
 
 #### TC3: LIB-LIB
 
@@ -82,7 +82,7 @@ conn 0 0 1
 send 0 5 192.168.1.1 aa:aa:aa:aa:aa:aa
 ```
 
-###### Example results (owerview of test data)
+###### Example results (overview of test data)
 
 lib1-tx: 200M (if ring full don't drop packets)
 lib2-rx: 200M
@@ -91,4 +91,4 @@ lib1-rx: =lib2-tx
 drop: ~15%
 pps: ~6M
 multiple interfaces:
-not tested (excpected same as TC1)
+not tested (expected same as TC1)
index 0e8b8f3..86a49da 100644 (file)
@@ -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)
index 0e9d96e..c2ea348 100644 (file)
@@ -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)
index 5c03823..f37c6a0 100644 (file)
@@ -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)
index a7b11bb..86c57d1 100644 (file)
@@ -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;
index b342c51..3f871d7 100644 (file)
@@ -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)
index df94da3..5175123 100644 (file)
@@ -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)
     {
index 37540de..b55e81a 100644 (file)
@@ -85,10 +85,10 @@ typedef enum
  * @{
  */
 
-/** user needs to set events that occured on fd and pass them to memif_control_fd_handler */
+/** user needs to set events that occurred on fd and pass them to memif_control_fd_handler */
 #define MEMIF_FD_EVENT_READ  (1 << 0)
 #define MEMIF_FD_EVENT_WRITE (1 << 1)
-/** inform libmemif that error occured on fd */
+/** inform libmemif that error occurred on fd */
 #define MEMIF_FD_EVENT_ERROR (1 << 2)
 /** if set, informs that fd is going to be closed (user may want to stop watching for events on this fd) */
 #define MEMIF_FD_EVENT_DEL   (1 << 3)
@@ -167,10 +167,10 @@ typedef int (memif_control_fd_update_t) (int fd, uint8_t events,
 typedef int (memif_connection_update_t) (memif_conn_handle_t conn,
                                         void *private_ctx);
 
-/** \brief Memif interrupt occured (callback function)
+/** \brief Memif interrupt occurred (callback function)
     @param conn - memif connection handle
     @param private_ctx - private context
-    @param qid - queue id on which interrupt occured
+    @param qid - queue id on which interrupt occurred
 
     Called when event is received on interrupt fd.
 */
@@ -244,7 +244,7 @@ void memif_register_external_region (memif_add_external_region_t * ar,
     @param gr - get external region addr callback
     @param dr - delete external region callback
     @param go - get external buffer offset callback (optional)
-*/
+
 void memif_per_thread_register_external_region (memif_per_thread_main_handle_t
                                                pt_main,
                                                memif_add_external_region_t *
@@ -256,7 +256,7 @@ void memif_per_thread_register_external_region (memif_per_thread_main_handle_t
                                                memif_get_external_buffer_offset_t
                                                * go);
 
-/** @} */
+ @} */
 
 /**
  * @defgroup ARGS_N_BUFS Connection arguments and buffers
@@ -688,7 +688,7 @@ int memif_rx_burst (memif_conn_handle_t conn, uint16_t qid,
 */
 int memif_poll_event (int timeout);
 
-/** \brief Memif poll event
+/** \brief Memif per thread poll event
     @param pt_main - per thread main handle
     @param timeout - timeout in seconds
 
index ce96c37..c4d1d5b 100644 (file)
@@ -76,7 +76,7 @@ const char *memif_errlist[ERRLIST_LEN] = {    /* MEMIF_ERR_SUCCESS */
   /* MEMIF_ERR_CONNREFUSED */
   "Connection refused",
   /* MEMIF_ERR_ACCES */
-  "Permission to resoure denied.",
+  "Permission to resource denied.",
   /* MEMIF_ERR_NO_FILE */
   "Socket file does not exist",
   /* MEMIF_ERR_FILE_LIMIT */
@@ -94,7 +94,7 @@ const char *memif_errlist[ERRLIST_LEN] = {    /* MEMIF_ERR_SUCCESS */
   /* MEMIF_ERR_INVAL_ARG */
   "Invalid argument.",
   /* MEMIF_ERR_NOCONN */
-  "Memif connection handle does not point to existing conenction",
+  "Memif connection handle does not point to existing connection",
   /* MEMIF_ERR_CONN */
   "Memif connection handle points to existing connection",
   /* MEMIF_ERR_CB_FDUPDATE */
index 88237dc..cf950ba 100644 (file)
@@ -214,7 +214,7 @@ extern libmemif_main_t libmemif_main;
 /* if region doesn't contain shared memory, mmap region, check ring cookie */
 int memif_connect1 (memif_connection_t * c);
 
-/* memory map region, initalize rings and queues */
+/* memory map region, initialize rings and queues */
 int memif_init_regions_and_queues (memif_connection_t * c);
 
 int memif_disconnect_internal (memif_connection_t * c);
index 1f2c547..9e32db5 100644 (file)
@@ -116,7 +116,7 @@ autoreply define memif_delete
 /** \brief Memory interface details structure
     @param context - sender context, to match reply w/ request
     @param socket_id - u32 used to identify the given socket filename
-    @param socket_filename - correpsonding NUL terminated socket filename
+    @param socket_filename - corresponding NUL terminated socket filename
 */
 define memif_socket_filename_details
 {
index e9bdf42..4deb46a 100644 (file)
@@ -218,7 +218,7 @@ memif_int_fd_read_ready (clib_file_t * uf)
   size = read (uf->file_descriptor, &b, sizeof (b));
   if (size < 0)
     {
-      memif_log_debug (mif, "Failed to read form socket");
+      memif_log_debug (mif, "Failed to read from socket");
       return 0;
     }
 
index 506d88a..7b341e4 100644 (file)
@@ -205,7 +205,7 @@ memif_device_input_inline (vlib_main_t * vm, vlib_node_runtime_t * node,
   ring_size = 1 << mq->log2_ring_size;
   mask = ring_size - 1;
 
-  /* asume that somebody will want to add ethernet header on the packet
+  /* assume that somebody will want to add ethernet header on the packet
      so start with IP header at offset 14 */
   start_offset = (mode == MEMIF_INTERFACE_MODE_IP) ? 14 : 0;
 
index 553a175..5a381a7 100644 (file)
@@ -363,7 +363,7 @@ memif_msg_receive_add_ring (memif_if_t * mif, memif_msg_t * msg, int fd)
       mif->run.num_m2s_rings = vec_len (mif->tx_queues);
     }
 
-  // clear previous cache data if interface reconncected
+  // clear previous cache data if interface reconnected
   clib_memset (mq, 0, sizeof (memif_queue_t));
   mq->int_fd = fd;
   mq->int_clib_file_index = ~0;