From f4fbfd692fbc04a67e61d83ef477200967a6bc34 Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Fri, 15 May 2020 23:13:36 -0400 Subject: libmemif: cleanup typos cleaned up typos in documetation while doing a read through. Type: style Change-Id: Id8abbd8d6297ee10490c12a8e62097224f7ec1e1 Signed-off-by: Paul Vinciguerra --- extras/libmemif/docs/gettingstarted_doc.md | 4 +- extras/libmemif/examples/example_setup_doc.md | 2 +- extras/libmemif/examples/examples_doc.md | 2 +- extras/libmemif/libmemif_doc.md | 2 +- extras/libmemif/src/libmemif.h | 64 +++++++++++++-------------- extras/libmemif/src/main.c | 8 ++-- extras/libmemif/src/socket.c | 2 +- 7 files changed, 42 insertions(+), 42 deletions(-) diff --git a/extras/libmemif/docs/gettingstarted_doc.md b/extras/libmemif/docs/gettingstarted_doc.md index 1e5ce227eb3..977c5445bdf 100644 --- a/extras/libmemif/docs/gettingstarted_doc.md +++ b/extras/libmemif/docs/gettingstarted_doc.md @@ -18,7 +18,7 @@ control_fd_update (int fd, uint8_t events) err = memif_init (control_fd_update, APP_NAME, NULL, NULL); ``` -> If event occurres on any file descriptor returned by this callback, call memif\_control\_fd\_handler function. Since version 2.0, last two optional arguments are used to specify custom memory allocation. +> If event occurs on any file descriptor returned by this callback, call memif\_control\_fd\_handler function. Since version 2.0, last two optional arguments are used to specify custom memory allocation. ```C memif_err = memif_control_fd_handler (evt.data.fd, events); ``` @@ -38,7 +38,7 @@ memif_err = memif_control_fd_handler (evt.data.fd, events); > Memif initialization function will initialize internal structures and create timer file descriptor, which will be used for sending periodic connection requests. Timer is disarmed if no memif interface is created. 2. Creating interface - - Declare memif connction handle. + - Declare memif connection handle. ```C memif_conn_handle_t c; ``` diff --git a/extras/libmemif/examples/example_setup_doc.md b/extras/libmemif/examples/example_setup_doc.md index 7fc5443b5fd..89df8ab1d44 100644 --- a/extras/libmemif/examples/example_setup_doc.md +++ b/extras/libmemif/examples/example_setup_doc.md @@ -18,7 +18,7 @@ icmpr-epoll: ``` conn 0 0 ``` -Memif in slave mode will try to connect every 2 seconds. If connection establishment is successfull, a message will show. +Memif in slave mode will try to connect every 2 seconds. If connection establishment is successful, a message will show. ``` INFO: memif connected! ``` diff --git a/extras/libmemif/examples/examples_doc.md b/extras/libmemif/examples/examples_doc.md index 11937c576fb..4422d42d44b 100644 --- a/extras/libmemif/examples/examples_doc.md +++ b/extras/libmemif/examples/examples_doc.md @@ -13,6 +13,6 @@ Current WORKDIR is set to root repository directory. Example apps can be run fro Example app | Description ------------|------------ -@ref extras/libmemif/examples/icmp_responder | Simplest implementaion. Event polling is handled by libmemif. Single memif conenction in slave mode is created (id 0). Use Ctrl + C to exit app. Memif receive mode: interrupt. +@ref extras/libmemif/examples/icmp_responder | Simplest implementation. Event polling is handled by libmemif. Single memif connection in slave mode is created (id 0). Use Ctrl + C to exit app. Memif receive mode: interrupt. @ref extras/libmemif/examples/icmp_responder-epoll (run in container by default) | Supports multiple connections and master mode. User can create/delete connections, set ip addresses, print connection information. @ref libmemif_example_setup_doc contains instructions on basic connection use cases setups. Memif receive mode: interrupt. App provides functionality to disable interrupts for specified queue/s for testing purposes. Polling mode is not implemented in this example. @ref extras/libmemif/examples/icmp_responder-mt) | Multi-thread example, very similar to icmpr-epoll. Packets are handled in threads assigned to specific queues. Slave mode only. Memif receive mode: polling (memif_rx_poll function), interrupt (memif_rx_interrupt function). Receive modes differ per queue. diff --git a/extras/libmemif/libmemif_doc.md b/extras/libmemif/libmemif_doc.md index a6e1e7576ef..1260d9c60ac 100644 --- a/extras/libmemif/libmemif_doc.md +++ b/extras/libmemif/libmemif_doc.md @@ -66,7 +66,7 @@ commands: send - send icmp ``` -Continue with @ref libmemif_example_setup which contains instructions on how to set up conenction between icmpr-epoll example app and VPP-memif. +Continue with @ref libmemif_example_setup which contains instructions on how to set up connection between icmpr-epoll example app and VPP-memif. #### Next steps diff --git a/extras/libmemif/src/libmemif.h b/extras/libmemif/src/libmemif.h index 056cdca6383..37540de831e 100644 --- a/extras/libmemif/src/libmemif.h +++ b/extras/libmemif/src/libmemif.h @@ -71,7 +71,7 @@ typedef enum MEMIF_ERR_MAXREG, /*!< max region limit reached */ MEMIF_ERR_MAXRING, /*!< max ring limit reached */ MEMIF_ERR_NO_INTFD, /*!< missing interrupt fd */ - MEMIF_ERR_DISCONNECT, /*!< disconenct received */ + MEMIF_ERR_DISCONNECT, /*!< disconnect received */ MEMIF_ERR_DISCONNECTED, /*!< peer interface disconnected */ MEMIF_ERR_UNKNOWN_MSG, /*!< unknown message type */ MEMIF_ERR_POLL_CANCEL, /*!< memif_poll_event() was cancelled */ @@ -280,7 +280,7 @@ typedef enum Custom database does not create a default socket (see memif_per_thread_init). Memif connection is stored in the same database as the socket. - @param secret - otional parameter used as interface autenthication + @param secret - optional parameter used as interface authentication @param num_s2m_rings - number of slave to master rings @param num_m2s_rings - number of master to slave rings @param buffer_size - size of buffer in shared memory @@ -344,11 +344,11 @@ typedef struct /** \brief Memif queue details @param region - region index @param qid - queue id - @param ring_size - size of ring buffer in sharem memory + @param ring_size - size of ring buffer in shared memory @param flags - ring flags @param head - ring head pointer @param tail - ring tail pointer - @param buffer_size - buffer size on sharem memory + @param buffer_size - buffer size on shared memory */ typedef struct { @@ -435,7 +435,7 @@ typedef struct */ uint16_t memif_get_version (); -/** \biref Memif get queue event file descriptor +/** \brief Memif get queue event file descriptor @param conn - memif connection handle @param qid - queue id @param[out] fd - returns event file descriptor @@ -465,7 +465,7 @@ int memif_set_rx_mode (memif_conn_handle_t conn, memif_rx_mode_t rx_mode, char *memif_strerror (int err_code); /** \brief Memif get details - @param conn - memif conenction handle + @param conn - memif connection handle @param md - pointer to memif details struct @param buf - buffer containing details strings @param buflen - length of buffer @@ -478,7 +478,7 @@ int memif_get_details (memif_conn_handle_t conn, memif_details_t * md, /** \brief Memif initialization @param on_control_fd_update - if control fd updates inform user to watch new fd @param app_name - application name (will be truncated to 32 chars) - @param memif_alloc - cutom memory allocator, NULL = default + @param memif_alloc - custom memory allocator, NULL = default @param memif_realloc - custom memory reallocation, NULL = default @param memif_free - custom memory free, NULL = default @@ -503,7 +503,7 @@ int memif_init (memif_control_fd_update_t * on_control_fd_update, @param private_ctx - private context @param on_control_fd_update - if control fd updates inform user to watch new fd @param app_name - application name (will be truncated to 32 chars) - @param memif_alloc - cutom memory allocator, NULL = default + @param memif_alloc - custom memory allocator, NULL = default @param memif_realloc - custom memory reallocation, NULL = default @param memif_free - custom memory free, NULL = default @@ -543,7 +543,7 @@ int memif_per_thread_cleanup (memif_per_thread_main_handle_t * pt_main); @param on_connect - inform user about connected status @param on_disconnect - inform user about disconnected status @param on_interrupt - informs user about interrupt, if set to null user will not be notified about interrupt, user can use memif_get_queue_efd call to get interrupt fd to poll for events - @param private_ctx - private contex passed back to user with callback + @param private_ctx - private context passed back to user with callback Creates memory interface. @@ -553,7 +553,7 @@ int memif_per_thread_cleanup (memif_per_thread_main_handle_t * pt_main); On success new fd is passed to user with memif_control_fd_update_t. MASTER-MODE - - Create listener socket and pass fd to user with memif_cntrol_fd_update_t. + Create listener socket and pass fd to user with memif_control_fd_update_t. If this fd is passed to memif_control_fd_handler accept will be called and new fd will be passed to user with memif_control_fd_update_t. @@ -566,11 +566,11 @@ int memif_create (memif_conn_handle_t * conn, memif_conn_args_t * args, memif_interrupt_t * on_interrupt, void *private_ctx); /** \brief Memif control file descriptor handler - @param fd - file descriptor on which the event occured - @param events - event type(s) that occured + @param fd - file descriptor on which the event occurred + @param events - event type(s) that occurred - If event occures on any control fd, call memif_control_fd_handler. - Internal - lib will "identify" fd (timerfd, lsitener, control) and handle event accordingly. + If event occurs on any control fd, call memif_control_fd_handler. + Internal - lib will "identify" fd (timerfd, listener, control) and handle event accordingly. FD-TYPE - TIMERFD - @@ -587,8 +587,8 @@ int memif_control_fd_handler (int fd, uint8_t events); /** \brief Memif per thread control file descriptor handler @param pt_main - per thread main handle - @param fd - file descriptor on which the event occured - @param events - event type(s) that occured + @param fd - file descriptor on which the event occurred + @param events - event type(s) that occurred Per thread version of memif_control_fd_handler. @@ -610,10 +610,10 @@ int memif_per_thread_control_fd_handler (memif_per_thread_main_handle_t int memif_delete (memif_conn_handle_t * conn); /** \brief Memif buffer enq tx - @param conn - memif conenction handle - @param qid - number indentifying queue + @param conn - memif connection handle + @param qid - number identifying queue @param bufs - memif buffers - @param count - number of memif buffers to enque + @param count - number of memif buffers to enqueue @param count_out - returns number of allocated buffers Slave is producer of buffers. @@ -626,8 +626,8 @@ int memif_buffer_enq_tx (memif_conn_handle_t conn, uint16_t qid, uint16_t * count_out); /** \brief Memif buffer alloc - @param conn - memif conenction handle - @param qid - number indentifying queue + @param conn - memif connection handle + @param qid - number identifying queue @param bufs - memif buffers @param count - number of memif buffers to allocate @param count_out - returns number of allocated buffers @@ -640,8 +640,8 @@ int memif_buffer_alloc (memif_conn_handle_t conn, uint16_t qid, uint16_t * count_out, uint16_t size); /** \brief Memif refill ring - @param conn - memif conenction handle - @param qid - number indentifying queue + @param conn - memif connection handle + @param qid - number identifying queue @param count - number of buffers to be placed on ring @param headroom - offset the buffer by headroom @@ -651,8 +651,8 @@ int memif_refill_queue (memif_conn_handle_t conn, uint16_t qid, uint16_t count, uint16_t headroom); /** \brief Memif transmit buffer burst - @param conn - memif conenction handle - @param qid - number indentifying queue + @param conn - memif connection handle + @param qid - number identifying queue @param bufs - memif buffers @param count - number of memif buffers to transmit @param tx - returns number of transmitted buffers @@ -663,8 +663,8 @@ int memif_tx_burst (memif_conn_handle_t conn, uint16_t qid, memif_buffer_t * bufs, uint16_t count, uint16_t * tx); /** \brief Memif receive buffer burst - @param conn - memif conenction handle - @param qid - number indentifying queue + @param conn - memif connection handle + @param qid - number identifying queue @param bufs - memif buffers @param count - number of memif buffers to receive @param rx - returns number of received buffers @@ -702,9 +702,9 @@ int memif_per_thread_poll_event (memif_per_thread_main_handle_t pt_main, /** \brief Send signal to stop concurrently running memif_poll_event(). The function, however, does not wait for memif_poll_event() to stop. - memif_poll_event() may still return simply because an event has occured + memif_poll_event() may still return simply because an event has occurred or the timeout has elapsed, but if called repeatedly in an infinite loop, - a canceled memif_poll_event() is guaranted to return MEMIF_ERR_POLL_CANCEL + a canceled memif_poll_event() is guaranteed to return MEMIF_ERR_POLL_CANCEL in the shortest possible time. This feature was not available in the first release. Use macro MEMIF_HAVE_CANCEL_POLL_EVENT to check if the feature is present. @@ -762,7 +762,7 @@ int memif_request_connection (memif_conn_handle_t conn); The first time an interface is assigned a socket, its type is determined. For master role it's 'listener', for slave role it's 'client'. Each interface - requires socket of its respective type. Default socket is creted if no + requires socket of its respective type. Default socket is created if no socket handle is passed to memif_create(). It's private context is NULL. If all interfaces using this socket are deleted, the socket returns to its default state. @@ -778,7 +778,7 @@ int memif_create_socket (memif_socket_handle_t * sock, const char *filename, @param filename - path to socket file @param private_ctx - private context - Per thread version of memif_create_sopcket. + Per thread version of memif_create_socket. \return memif_err_t */ @@ -801,7 +801,7 @@ int memif_delete_socket (memif_socket_handle_t * sock); Return constant pointer to socket filename. - \return cosnt char * + \return const char * */ const char *memif_get_socket_filename (memif_socket_handle_t sock); diff --git a/extras/libmemif/src/main.c b/extras/libmemif/src/main.c index b80dd6481b8..ce96c371f36 100644 --- a/extras/libmemif/src/main.c +++ b/extras/libmemif/src/main.c @@ -110,7 +110,7 @@ const char *memif_errlist[ERRLIST_LEN] = { /* MEMIF_ERR_SUCCESS */ /* MEMIF_ERR_NOBUF */ "Not enough memif buffers. There are unreceived data in shared memory.", /* MEMIF_ERR_NOBUF_DET */ - "Not enough space for memif details in suplied buffer. String data might be malformed.", + "Not enough space for memif details in supplied buffer. String data might be malformed.", /* MEMIF_ERR_INT_WRITE */ "Send interrupt error.", /* MEMIF_ERR_MFMSG */ @@ -122,7 +122,7 @@ const char *memif_errlist[ERRLIST_LEN] = { /* MEMIF_ERR_SUCCESS */ /* MEMIF_ERR_ID */ "Unmatched interface id.", /* MEMIF_ERR_ACCSLAVE */ - "Slave cannot accept connection reqest.", + "Slave cannot accept connection request.", /* MEMIF_ERR_ALRCONN */ "Interface is already connected.", /* MEMIF_ERR_MODE */ @@ -281,7 +281,7 @@ memif_mod_epoll_fd (libmemif_main_t * lm, 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; } @@ -1204,7 +1204,7 @@ memif_create (memif_conn_handle_t * c, memif_conn_args_t * args, conn->index = index; - /* try connectiong to master */ + /* try connecting to master */ err = memif_request_connection (conn); if ((err != MEMIF_ERR_SUCCESS) && (lm->disconn_slaves == 0)) { diff --git a/extras/libmemif/src/socket.c b/extras/libmemif/src/socket.c index 41bb22b570d..24546162ee9 100644 --- a/extras/libmemif/src/socket.c +++ b/extras/libmemif/src/socket.c @@ -316,7 +316,7 @@ memif_msg_enq_connected (memif_connection_t * c) } /* immediately send disconnect msg */ - /* specifie protocol for disconnect msg err_code + /* specify protocol for disconnect msg err_code so that it will be compatible with VPP? (header/doc) */ int memif_msg_send_disconnect (int fd, uint8_t * err_string, uint32_t err_code) -- cgit 1.2.3-korg