Skip to content

Commit

Permalink
cleanup comments
Browse files Browse the repository at this point in the history
Remove references to memzone and fix mis-spellings.

Signed-off-by: Keith Wiles <[email protected]>
  • Loading branch information
KeithWiles authored and jeffreybshaw committed Sep 12, 2023
1 parent a51ae0d commit a4714c4
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 37 deletions.
2 changes: 1 addition & 1 deletion examples/phil/phil.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ a number of seconds equal to the philosopher's order number around the table
The two solutions implemented here are 1) a ticket-based one, and 2) a
claim-based one. The ticket-based solution is fair in the sense that all
philosophers get to access the resource for the same amount of time in average
whether they think quick (or shallowy...) or long. The drawback is that the
whether they think quick (or shallow...) or long. The drawback is that the
faster thinkers get to wait more for accessing the resource. The claim-based
solution is addressing this by letting the faster thinkers access the resource
as long as it is not claimed by another philosopher (in which case the
Expand Down
6 changes: 3 additions & 3 deletions lib/core/hash/cne_fbk_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ struct cne_fbk_hash_table *cne_fbk_hash_find_existing(const char *name);
* - E_CNE_NO_CONFIG - function could not get pointer to cne_config structure
* - E_CNE_SECONDARY - function was called from a secondary process instance
* - EINVAL - invalid parameter value passed to function
* - ENOSPC - the maximum number of memzones has already been allocated
* - EEXIST - a memzone with the same name already exists
* - ENOMEM - no appropriate memory area found in which to create memzone
* - ENOSPC - the maximum number of memory has already been allocated
* - EEXIST - a mempool with the same name already exists
* - ENOMEM - no appropriate memory area found in which to create memory
*/
struct cne_fbk_hash_table *cne_fbk_hash_create(const struct cne_fbk_hash_params *params);

Expand Down
6 changes: 3 additions & 3 deletions lib/core/hash/cne_hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ struct cne_hash;
* - E_CNE_SECONDARY - function was called from a secondary process instance
* - ENOENT - missing entry
* - EINVAL - invalid parameter passed to function
* - ENOSPC - the maximum number of memzones has already been allocated
* - EEXIST - a memzone with the same name already exists
* - ENOMEM - no appropriate memory area found in which to create memzone
* - ENOSPC - the maximum number of memory has already been allocated
* - EEXIST - a mempool with the same name already exists
* - ENOMEM - no appropriate memory area found in which to create memory
*/
struct cne_hash *cne_hash_create(const struct cne_hash_parameters *params);

Expand Down
6 changes: 3 additions & 3 deletions lib/core/mempool/mempool.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@ typedef struct mempool_cfg {
* @return
* The pointer to the new allocated mempool, on success. NULL on error
* with errno set appropriately. Possible errno values include:
* - ENOSPC - the maximum number of memzones has already been allocated
* - EEXIST - a memzone with the same name already exists
* - ENOMEM - no appropriate memory area found in which to create memzone
* - ENOSPC - the maximum number of mempools has already been allocated
* - EEXIST - a mempool with the same name already exists
* - ENOMEM - no appropriate memory area found in which to create mempool
*/
CNDP_API mempool_t *mempool_create(struct mempool_cfg *cinfo);

Expand Down
22 changes: 2 additions & 20 deletions lib/include/cne_tailq.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,8 @@ struct cne_tailq_elem {
* first parameter passed to TAILQ_HEAD macro)
*
* @return
* The return value, typecast to the appropriate
* structure pointer type.
* NULL on error, since the tailq_head is the first
* element in the cne_tailq_head structure.
* The return value, typecast to the appropriate structure pointer type. NULL on error,
* since the tailq_head is the first element in the cne_tailq_head structure.
*/
#define CNE_TAILQ_LOOKUP(name, struct_name) CNE_TAILQ_CAST(cne_tailq_lookup(name), struct_name)

Expand Down Expand Up @@ -123,22 +121,6 @@ CNDP_API void cne_dump_tailq(void);
*/
CNDP_API struct cne_tailq_head *cne_tailq_lookup(const char *name);

/**
* Register a tail queue.
*
* Register a tail queue from shared memory.
* This function is mainly used by some, which is used to
* register tailq from the different cndp libraries. Since this macro is a
* constructor.
*
* @param t
* The tailq element which contains the name of the tailq you want to
* create (/retrieve when in secondary process).
* @return
* 0 on success or -1 in case of an error.
*/
CNDP_API int cne_eal_tailq_register(struct cne_tailq_elem *t);

/**
* This macro permits both remove and free var within the loop safely.
*/
Expand Down
2 changes: 1 addition & 1 deletion lib/usr/clib/graph/graph_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ int graph_fp_mem_create(struct graph *graph);
*
* @return
* - 0: Success.
* - <0: Graph memzone related error.
* - <0: Graph memory related error.
*/
int graph_fp_mem_destroy(struct graph *graph);

Expand Down
6 changes: 3 additions & 3 deletions test/testcne/graph_perf_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,8 +346,8 @@ graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks, uint32_t stages
graph_data->node_data =
malloc(sizeof(struct test_node_data) * (nb_srcs + nb_sinks + stages * nodes_per_stage));
if (graph_data->node_data == NULL) {
tst_error("Failed to reserve memzone for graph data");
goto memzone_free;
tst_error("Failed to reserve memory for graph data");
goto memory_free;
}

node_patterns = calloc(1, sizeof(char *) * (nb_srcs + nb_sinks + stages * nodes_per_stage + 1));
Expand Down Expand Up @@ -621,7 +621,7 @@ graph_init(const char *gname, uint8_t nb_srcs, uint8_t nb_sinks, uint32_t stages
free(node_patterns);
data_free:
free(graph_data->node_data);
memzone_free:
memory_free:
free(graph_data);
return -ENOMEM;
}
Expand Down
2 changes: 1 addition & 1 deletion usrtools/txgen/app/capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
* storage.
*
* PARAMETERS:
* capture: capture_t struct that will keep a pointer to the allocated memzone
* capture: capture_t struct that will keep a pointer to the allocated memory
*
* RETURNS: N/A
*
Expand Down
2 changes: 1 addition & 1 deletion usrtools/txgen/app/capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ typedef struct capture_s {
cap_hdr_t *tail; /**< Current tail pointer in the pkt buffer */
cap_hdr_t *end; /**< Points to just before the end[-1] of the buffer */
size_t used; /**< Memory used by captured packets */
uint16_t port; /**< port for this memzone */
uint16_t port; /**< port for this mempool */
} capture_t;

/* Capture initialization */
Expand Down
2 changes: 1 addition & 1 deletion usrtools/txgen/app/cksum.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cksum(void *pBuf, int32_t size, uint32_t cksum)
}

/**
* cksumUpdate - Calaculate an 16 bit checksum and return the 32 bit value
* cksumUpdate - Calculate an 16 bit checksum and return the 32 bit value
*
* DESCRIPTION
* Will need to call txgen_cksumDone to finish computing the checksum. The <cksum>
Expand Down

0 comments on commit a4714c4

Please sign in to comment.