diff options
-rw-r--r-- | src/svm/fifo_segment.c | 14 | ||||
-rw-r--r-- | src/svm/fifo_segment.h | 6 | ||||
-rw-r--r-- | src/svm/ssvm.c | 3 | ||||
-rw-r--r-- | src/svm/ssvm.h | 2 | ||||
-rw-r--r-- | src/vnet/session/segment_manager.c | 8 | ||||
-rw-r--r-- | src/vnet/session/segment_manager.h | 8 |
6 files changed, 20 insertions, 21 deletions
diff --git a/src/svm/fifo_segment.c b/src/svm/fifo_segment.c index 95b88836ddb..01fa65623c5 100644 --- a/src/svm/fifo_segment.c +++ b/src/svm/fifo_segment.c @@ -25,7 +25,7 @@ * @param fs fifo segment * @return number of free bytes */ -static u32 +static uword fs_free_space (fifo_segment_t * fs) { struct dlmallinfo dlminfo; @@ -870,7 +870,7 @@ fifo_segment_update_free_bytes (fifo_segment_t * fs) clib_atomic_store_rel_n (&fsh->n_free_bytes, fs_free_space (fs)); } -u32 +uword fifo_segment_free_bytes (fifo_segment_t * fs) { return fsh_n_free_bytes (fs->h); @@ -943,11 +943,11 @@ format_fifo_segment_type (u8 * s, va_list * args) u8 * format_fifo_segment (u8 * s, va_list * args) { - u32 count, indent, active_fifos, free_fifos, fifo_hdr = 0, chunk_size; + u32 count, indent, active_fifos, free_fifos, fifo_hdr = 0; fifo_segment_t *fs = va_arg (*args, fifo_segment_t *); int verbose __attribute__ ((unused)) = va_arg (*args, int); - u32 est_chunk_bytes, est_free_seg_bytes, free_chunks; - uword chunk_bytes = 0, free_seg_bytes; + uword est_chunk_bytes, est_free_seg_bytes, free_chunks; + uword chunk_bytes = 0, free_seg_bytes, chunk_size; fifo_segment_header_t *fsh; fifo_segment_slice_t *fss; svm_fifo_chunk_t *c; @@ -1020,11 +1020,11 @@ format_fifo_segment (u8 * s, va_list * args) fifo_segment_update_free_bytes (fs); free_seg_bytes = fifo_segment_free_bytes (fs); - s = format (s, "\n%Useg free bytes: %U (%u) estimated: %U (%u)\n", + s = format (s, "\n%Useg free bytes: %U (%lu) estimated: %U (%lu)\n", format_white_space, indent + 2, format_memory_size, free_seg_bytes, free_seg_bytes, format_memory_size, est_free_seg_bytes, est_free_seg_bytes); - s = format (s, "%Uchunk free bytes: %U (%lu) estimated: %U (%u)\n", + s = format (s, "%Uchunk free bytes: %U (%lu) estimated: %U (%lu)\n", format_white_space, indent + 2, format_memory_size, chunk_bytes, chunk_bytes, format_memory_size, est_chunk_bytes, est_chunk_bytes); diff --git a/src/svm/fifo_segment.h b/src/svm/fifo_segment.h index ff36f45c4f2..d363c6058a7 100644 --- a/src/svm/fifo_segment.h +++ b/src/svm/fifo_segment.h @@ -42,7 +42,7 @@ typedef struct fifo_segment_slice_ svm_fifo_t *fifos; /**< Linked list of active RX fifos */ svm_fifo_t *free_fifos; /**< Freelists by fifo size */ svm_fifo_chunk_t **free_chunks; /**< Freelists by chunk size */ - u32 n_fl_chunk_bytes; /**< Chunk bytes on freelist */ + uword n_fl_chunk_bytes; /**< Chunk bytes on freelist */ } fifo_segment_slice_t; typedef struct @@ -66,7 +66,7 @@ typedef struct typedef struct { fifo_segment_t *segments; /**< pool of fifo segments */ - u64 next_baseva; /**< Where to put the next one */ + uword next_baseva; /**< Where to put the next one */ u32 timeout_in_seconds; /**< Time to wait during attach */ } fifo_segment_main_t; @@ -186,7 +186,7 @@ int fifo_segment_collect_fifo_chunks (fifo_segment_t * fs, svm_fifo_t * f); * @param fs fifo segment * @return free bytes estimate */ -u32 fifo_segment_free_bytes (fifo_segment_t * fs); +uword fifo_segment_free_bytes (fifo_segment_t * fs); /** * Update fifo segment free bytes estimate diff --git a/src/svm/ssvm.c b/src/svm/ssvm.c index a16965e5e67..737d2344402 100644 --- a/src/svm/ssvm.c +++ b/src/svm/ssvm.c @@ -347,9 +347,8 @@ ssvm_delete_memfd (ssvm_private_t * memfd) int ssvm_master_init_private (ssvm_private_t * ssvm) { + uword pagesize = clib_mem_get_page_size (), rnd_size = 0; ssvm_shared_header_t *sh; - u32 pagesize = clib_mem_get_page_size (); - u32 rnd_size = 0; u8 *heap; rnd_size = clib_max (ssvm->ssvm_size + (pagesize - 1), ssvm->ssvm_size); diff --git a/src/svm/ssvm.h b/src/svm/ssvm.h index 60e0cc61ca4..82951d614b0 100644 --- a/src/svm/ssvm.h +++ b/src/svm/ssvm.h @@ -82,7 +82,7 @@ typedef struct typedef struct { ssvm_shared_header_t *sh; - u64 ssvm_size; + uword ssvm_size; u32 my_pid; u8 *name; uword requested_va; diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c index 5247b0e7461..0600b671be7 100644 --- a/src/vnet/session/segment_manager.c +++ b/src/vnet/session/segment_manager.c @@ -83,11 +83,11 @@ segment_manager_segment_index (segment_manager_t * sm, fifo_segment_t * seg) * to avoid affecting any of the segments pool readers. */ int -segment_manager_add_segment (segment_manager_t * sm, u32 segment_size) +segment_manager_add_segment (segment_manager_t * sm, uword segment_size) { + uword baseva = (uword) ~ 0ULL, alloc_size, page_size; + u32 rnd_margin = 128 << 10, fs_index = ~0; segment_manager_main_t *smm = &sm_main; - u32 rnd_margin = 128 << 10, fs_index = ~0, page_size; - uword baseva = (uword) ~ 0ULL, alloc_size; segment_manager_props_t *props; fifo_segment_t *fs; u8 *seg_name; @@ -307,7 +307,7 @@ segment_manager_alloc (void) * Returns error if ssvm segment(s) allocation fails. */ int -segment_manager_init (segment_manager_t * sm, u32 first_seg_size, +segment_manager_init (segment_manager_t * sm, uword first_seg_size, u32 prealloc_fifo_pairs) { u32 rx_fifo_size, tx_fifo_size, pair_size; diff --git a/src/vnet/session/segment_manager.h b/src/vnet/session/segment_manager.h index f2a90c8f935..b40926091c4 100644 --- a/src/vnet/session/segment_manager.h +++ b/src/vnet/session/segment_manager.h @@ -25,9 +25,9 @@ typedef struct _segment_manager_props u32 rx_fifo_size; /**< receive fifo size */ u32 tx_fifo_size; /**< transmit fifo size */ u32 evt_q_size; /**< event queue length */ - u32 segment_size; /**< first segment size */ u32 prealloc_fifos; /**< preallocated fifo pairs */ - u32 add_segment_size; /**< additional segment size */ + uword segment_size; /**< first segment size */ + uword add_segment_size; /**< additional segment size */ u8 add_segment:1; /**< can add new segments flag */ u8 use_mq_eventfd:1; /**< use eventfds for mqs flag */ u8 reserved:6; /**< reserved flags */ @@ -69,7 +69,7 @@ typedef struct segment_manager_main_init_args_ #define SEGMENT_MANAGER_INVALID_APP_INDEX ((u32) ~0) segment_manager_t *segment_manager_alloc (void); -int segment_manager_init (segment_manager_t * sm, u32 first_seg_size, +int segment_manager_init (segment_manager_t * sm, uword first_seg_size, u32 prealloc_fifo_pairs); /** @@ -89,7 +89,7 @@ segment_manager_t *segment_manager_get (u32 index); segment_manager_t *segment_manager_get_if_valid (u32 index); u32 segment_manager_index (segment_manager_t * sm); -int segment_manager_add_segment (segment_manager_t * sm, u32 segment_size); +int segment_manager_add_segment (segment_manager_t * sm, uword segment_size); void segment_manager_del_segment (segment_manager_t * sm, fifo_segment_t * fs); fifo_segment_t *segment_manager_get_segment (segment_manager_t * sm, |