summaryrefslogtreecommitdiffstats
path: root/src/plugins/hs_apps
diff options
context:
space:
mode:
authorMathiasRaoul <mathias.raoul@gmail.com>2019-10-04 15:28:00 +0000
committerAndrew Yourtchenko <ayourtch@gmail.com>2019-10-18 14:37:29 +0000
commit47c6f36be723f0e02e9a842701d7ca63dfcb8b94 (patch)
treedf131e6a8a960ff5f2a062f15169ab603ceef844 /src/plugins/hs_apps
parent7fc3d97b82fdec65ff4fb5b6dbfd8b85bf9b0098 (diff)
hsa: make APP_OPTIONS_PREALLOC_FIFO_PAIRS configurable
-add prealloc_fifo_pairs member in echo_main_t -new cli parameter in vpp_echo Type: feature Signed-off-by: MathiasRaoul <mathias.raoul@gmail.com> Change-Id: I6bb1214ee93e06421cd0a3721420278c51cd59c4 (cherry picked from commit 7028a0157e28066696fba7d9978f7ab474f4d4f8)
Diffstat (limited to 'src/plugins/hs_apps')
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo.c3
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo_bapi.c2
-rw-r--r--src/plugins/hs_apps/sapi/vpp_echo_common.h1
3 files changed, 5 insertions, 1 deletions
diff --git a/src/plugins/hs_apps/sapi/vpp_echo.c b/src/plugins/hs_apps/sapi/vpp_echo.c
index 407ab3f3816..f0aa6a9e050 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo.c
+++ b/src/plugins/hs_apps/sapi/vpp_echo.c
@@ -881,6 +881,8 @@ echo_process_opts (int argc, char **argv)
em->use_sock_api = 0;
else if (unformat (a, "fifo-size %d", &tmp))
em->fifo_size = tmp << 10;
+ else if (unformat (a, "prealloc-fifos %u", &em->prealloc_fifo_pairs))
+ ;
else if (unformat (a, "rx-buf %U", unformat_data, &em->rx_buf_size))
;
else if (unformat (a, "tx-buf %U", unformat_data, &em->tx_buf_size))
@@ -1004,6 +1006,7 @@ main (int argc, char **argv)
em->socket_name = format (0, "%s%c", API_SOCKET_FILE, 0);
em->use_sock_api = 1;
em->fifo_size = 64 << 10;
+ em->prealloc_fifo_pairs = 16;
em->n_clients = 1;
em->n_connects = 1;
em->n_sessions = 2;
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_bapi.c b/src/plugins/hs_apps/sapi/vpp_echo_bapi.c
index 1894b5de840..1bfcb366b25 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo_bapi.c
+++ b/src/plugins/hs_apps/sapi/vpp_echo_bapi.c
@@ -39,7 +39,7 @@ echo_send_attach (echo_main_t * em)
bmp->context = ntohl (0xfeedface);
bmp->options[APP_OPTIONS_FLAGS] = APP_OPTIONS_FLAGS_ACCEPT_REDIRECT;
bmp->options[APP_OPTIONS_FLAGS] |= APP_OPTIONS_FLAGS_ADD_SEGMENT;
- bmp->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = 16;
+ bmp->options[APP_OPTIONS_PREALLOC_FIFO_PAIRS] = em->prealloc_fifo_pairs;
bmp->options[APP_OPTIONS_RX_FIFO_SIZE] = em->fifo_size;
bmp->options[APP_OPTIONS_TX_FIFO_SIZE] = em->fifo_size;
bmp->options[APP_OPTIONS_ADD_SEGMENT_SIZE] = 128 << 20;
diff --git a/src/plugins/hs_apps/sapi/vpp_echo_common.h b/src/plugins/hs_apps/sapi/vpp_echo_common.h
index adcfd780f54..0e9eaebd345 100644
--- a/src/plugins/hs_apps/sapi/vpp_echo_common.h
+++ b/src/plugins/hs_apps/sapi/vpp_echo_common.h
@@ -280,6 +280,7 @@ typedef struct
u64 bytes_to_send; /* target per stream */
u64 bytes_to_receive; /* target per stream */
u32 fifo_size;
+ u32 prealloc_fifo_pairs;
u32 rx_buf_size;
u32 tx_buf_size;
data_source_t data_source; /* Use no/dummy/mirrored data */