diff options
author | Florin Coras <fcoras@cisco.com> | 2021-04-28 13:02:33 -0700 |
---|---|---|
committer | Florin Coras <fcoras@cisco.com> | 2021-04-29 00:07:12 -0700 |
commit | edda5926e0b755368aef017a278272b796d22467 (patch) | |
tree | 963e125037af0c85bf1f4dc772c2ba747a23dacb /src/plugins/hs_apps/vcl/vcl_test.h | |
parent | ccdb8b8b159ee3a489d66d5b95742949afaa2b09 (diff) |
hsa: vcl test perf improvements
- poll session events in server
- init session buffers based on config
- cleanup some of the data structures
Type: improvement
Signed-off-by: Florin Coras <fcoras@cisco.com>
Change-Id: I81c19e6546c8292db07b63c66e4da03ef7f55e22
Diffstat (limited to 'src/plugins/hs_apps/vcl/vcl_test.h')
-rw-r--r-- | src/plugins/hs_apps/vcl/vcl_test.h | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/src/plugins/hs_apps/vcl/vcl_test.h b/src/plugins/hs_apps/vcl/vcl_test.h index 18e3c00f487..d475ec3c0a2 100644 --- a/src/plugins/hs_apps/vcl/vcl_test.h +++ b/src/plugins/hs_apps/vcl/vcl_test.h @@ -126,6 +126,7 @@ typedef struct vcl_test_session { uint8_t is_alloc; uint8_t is_open; + uint8_t is_done; int fd; int (*read) (struct vcl_test_session *ts, void *buf, uint32_t buflen); int (*write) (struct vcl_test_session *ts, void *buf, uint32_t buflen); @@ -247,14 +248,23 @@ vcl_test_buf_alloc (vcl_test_cfg_t * cfg, uint8_t is_rxbuf, uint8_t ** buf, } static inline void -vcl_test_session_buf_alloc (vcl_test_session_t * socket) +vcl_test_session_buf_alloc (vcl_test_session_t *ts) { - socket->rxbuf_size = socket->cfg.rxbuf_size; - socket->txbuf_size = socket->cfg.txbuf_size; - vcl_test_buf_alloc (&socket->cfg, 0 /* is_rxbuf */ , - (uint8_t **) & socket->txbuf, &socket->txbuf_size); - vcl_test_buf_alloc (&socket->cfg, 1 /* is_rxbuf */ , - (uint8_t **) & socket->rxbuf, &socket->rxbuf_size); + ts->rxbuf_size = ts->cfg.rxbuf_size; + ts->txbuf_size = ts->cfg.txbuf_size; + vcl_test_buf_alloc (&ts->cfg, 0 /* is_rxbuf */, (uint8_t **) &ts->txbuf, + &ts->txbuf_size); + vcl_test_buf_alloc (&ts->cfg, 1 /* is_rxbuf */, (uint8_t **) &ts->rxbuf, + &ts->rxbuf_size); +} + +static inline void +vcl_test_session_buf_free (vcl_test_session_t *ts) +{ + free (ts->rxbuf); + free (ts->txbuf); + ts->rxbuf = 0; + ts->txbuf = 0; } static inline char * |