From 6771af7328fa570a68371253d0a6067e57ec771e Mon Sep 17 00:00:00 2001 From: Florin Coras Date: Mon, 14 Oct 2024 19:43:42 -0700 Subject: hsa: switch proxy to using first worker connects Type: improvement Signed-off-by: Florin Coras Change-Id: I04821236ba8ab02525bd99a1ed4572dfcf5e5131 --- src/plugins/hs_apps/proxy.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/plugins/hs_apps/proxy.h') diff --git a/src/plugins/hs_apps/proxy.h b/src/plugins/hs_apps/proxy.h index 26f4de2f729..66361566fa6 100644 --- a/src/plugins/hs_apps/proxy.h +++ b/src/plugins/hs_apps/proxy.h @@ -41,8 +41,16 @@ typedef struct u32 po_thread_index; } proxy_session_t; +typedef struct proxy_worker_ +{ + clib_spinlock_t pending_connects_lock; + vnet_connect_args_t *pending_connects; + vnet_connect_args_t *burst_connects; +} proxy_worker_t; + typedef struct { + proxy_worker_t *workers; /**< per-thread data */ proxy_session_t *sessions; /**< session pool, shared */ clib_spinlock_t sessions_lock; /**< lock for session pool */ u8 **rx_buf; /**< intermediate rx buffers */ @@ -75,6 +83,13 @@ typedef struct extern proxy_main_t proxy_main; +static inline proxy_worker_t * +proxy_worker_get (u32 thread_index) +{ + proxy_main_t *pm = &proxy_main; + return vec_elt_at_index (pm->workers, thread_index); +} + #endif /* __included_proxy_h__ */ /* -- cgit 1.2.3-korg