hsa: allow first segments larger than 4g for proxy 16/36416/4
authorFlorin Coras <fcoras@cisco.com>
Thu, 9 Jun 2022 19:38:13 +0000 (12:38 -0700)
committerDave Barach <openvpp@barachs.net>
Fri, 10 Jun 2022 04:31:59 +0000 (04:31 +0000)
Type: improvement

Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I9c502a491ff56806a2e631f7a4c18903a2e93ab2

src/plugins/hs_apps/proxy.c
src/plugins/hs_apps/proxy.h

index 82d78e4..77c047b 100644 (file)
@@ -661,19 +661,16 @@ proxy_server_attach ()
   proxy_main_t *pm = &proxy_main;
   u64 options[APP_OPTIONS_N_OPTIONS];
   vnet_app_attach_args_t _a, *a = &_a;
-  u32 segment_size = 512 << 20;
 
   clib_memset (a, 0, sizeof (*a));
   clib_memset (options, 0, sizeof (options));
 
-  if (pm->private_segment_size)
-    segment_size = pm->private_segment_size;
   a->name = format (0, "proxy-server");
   a->api_client_index = pm->server_client_index;
   a->session_cb_vft = &proxy_session_cb_vft;
   a->options = options;
-  a->options[APP_OPTIONS_SEGMENT_SIZE] = segment_size;
-  a->options[APP_OPTIONS_ADD_SEGMENT_SIZE] = segment_size;
+  a->options[APP_OPTIONS_SEGMENT_SIZE] = pm->segment_size;
+  a->options[APP_OPTIONS_ADD_SEGMENT_SIZE] = pm->segment_size;
   a->options[APP_OPTIONS_RX_FIFO_SIZE] = pm->fifo_size;
   a->options[APP_OPTIONS_TX_FIFO_SIZE] = pm->fifo_size;
   a->options[APP_OPTIONS_MAX_FIFO_SIZE] = pm->max_fifo_size;
@@ -832,7 +829,7 @@ proxy_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
   pm->rcv_buffer_size = 1024;
   pm->prealloc_fifos = 0;
   pm->private_segment_count = 0;
-  pm->private_segment_size = 0;
+  pm->segment_size = 512 << 20;
 
   if (vlib_num_workers ())
     clib_spinlock_init (&pm->sessions_lock);
@@ -862,13 +859,7 @@ proxy_server_create_command_fn (vlib_main_t * vm, unformat_input_t * input,
       else if (unformat (line_input, "private-segment-size %U",
                         unformat_memory_size, &tmp64))
        {
-         if (tmp64 >= 0x100000000ULL)
-           {
-             error = clib_error_return (
-               0, "private segment size %lld (%llu) too large", tmp64, tmp64);
-             goto done;
-           }
-         pm->private_segment_size = tmp64;
+         pm->segment_size = tmp64;
        }
       else if (unformat (line_input, "server-uri %s", &server_uri))
        vec_add1 (server_uri, 0);
index 6e77024..26f4de2 100644 (file)
@@ -61,7 +61,7 @@ typedef struct
   u8 high_watermark;                   /**< high watermark (%) */
   u8 low_watermark;                    /**< low watermark (%) */
   u32 private_segment_count;           /**< Number of private fifo segs */
-  u32 private_segment_size;            /**< size of private fifo segs */
+  u64 segment_size;                    /**< size of fifo segs */
   u8 prealloc_fifos;                   /**< Request fifo preallocation */
   int rcv_buffer_size;
   session_endpoint_cfg_t server_sep;