diff options
author | Florin Coras <fcoras@cisco.com> | 2017-12-11 04:59:01 -0800 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-12-14 00:45:51 +0000 |
commit | ff6e7699a5e9921d73818970ecf3571080922ecc (patch) | |
tree | f22a28b2024833ae0128b7249ff7f9e71ec29bc7 /src/vnet/session/segment_manager.c | |
parent | cf3561bde53173a7be9aa02ed4897c7f2d55bd0a (diff) |
session: cleanup attach flags
Change-Id: I39d21d15677f57e10b69b8842f2cbca277abddf0
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/segment_manager.c')
-rw-r--r-- | src/vnet/session/segment_manager.c | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c index e448023ddd0..9e6a1b55cbb 100644 --- a/src/vnet/session/segment_manager.c +++ b/src/vnet/session/segment_manager.c @@ -116,16 +116,11 @@ session_manager_add_segment_i (segment_manager_t * sm, u32 segment_size, u64 approx_total_size; ca->segment_name = "process-private-segment"; - ca->segment_size = ~0; + ca->segment_size = segment_size; ca->rx_fifo_size = props->rx_fifo_size; ca->tx_fifo_size = props->tx_fifo_size; ca->preallocated_fifo_pairs = props->preallocated_fifo_pairs; ca->private_segment_count = props->private_segment_count; - ca->private_segment_size = props->private_segment_size; - - /* Default to a small private segment */ - if (ca->private_segment_size == 0) - ca->private_segment_size = 128 << 20; /* Calculate space requirements */ rx_rounded_data_size = (1 << (max_log2 (ca->rx_fifo_size))); @@ -136,9 +131,8 @@ session_manager_add_segment_i (segment_manager_t * sm, u32 segment_size, approx_total_size = (u64) ca->preallocated_fifo_pairs * (rx_fifo_size + tx_fifo_size); - approx_segment_count = - (approx_total_size + - (ca->private_segment_size - 1)) / (u64) ca->private_segment_size; + approx_segment_count = (approx_total_size + (ca->segment_size - 1)) + / (u64) ca->segment_size; /* The user asked us to figure it out... */ if (ca->private_segment_count == 0) @@ -148,9 +142,8 @@ session_manager_add_segment_i (segment_manager_t * sm, u32 segment_size, /* Follow directions, but issue a warning */ else if (approx_segment_count != ca->private_segment_count) { - clib_warning - ("Honoring segment count %u, but calculated count was %u", - ca->private_segment_count, approx_segment_count); + clib_warning ("Honoring segment count %u, calculated count was %u", + ca->private_segment_count, approx_segment_count); } if (svm_fifo_segment_create_process_private (ca)) @@ -624,7 +617,7 @@ segment_manager_show_fn (vlib_main_t * vm, unformat_input_t * input, segments = svm_fifo_segment_segments_pool (); vlib_cli_output (vm, "%d svm fifo segments allocated", pool_elts (segments)); - vlib_cli_output (vm, "%-20s%=12s%=16s%=16s%=16s", "Name", + vlib_cli_output (vm, "%-25s%15s%16s%16s%16s", "Name", "HeapSize (M)", "ActiveFifos", "FreeFifos", "Address"); /* *INDENT-OFF* */ @@ -647,7 +640,7 @@ segment_manager_show_fn (vlib_main_t * vm, unformat_input_t * input, } active_fifos = svm_fifo_segment_num_fifos (seg); free_fifos = svm_fifo_segment_num_free_fifos (seg, ~0 /* size */); - vlib_cli_output (vm, "%-20v%=16llu%=16u%=16u%16llx", + vlib_cli_output (vm, "%-25v%15llu%16u%16u%16llx", name, size >> 20ULL, active_fifos, free_fifos, address); if (verbose) |