summaryrefslogtreecommitdiffstats
path: root/src/vcl
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2023-03-10 10:22:21 -0800
committerDave Barach <vpp@barachs.net>2023-03-14 17:02:15 +0000
commitaeb7c1cb6e11dde259d954f7fabb95073a3b4c54 (patch)
treeb57271893e5550a96b267ab288e5589968677590 /src/vcl
parent48d2e15e3d5afa34ab75112a949dacc2759d472c (diff)
session vcl: refactor builtin tx event for main tx
Rename unused SESSION_IO_EVT_BUILTIN_TX to SESSION_IO_EVT_TX_MAIN and leverage it for non-connected udp tx. Non-connected udp sessions are listeners and are therefore allocated on main thread. Consequently, whenever session queue node is not polling main, tx events generated by external applications might be missed or processed with some delay. To solve this, request that apps use SESSION_IO_EVT_TX_MAIN tx events as opposed to SESSION_IO_EVT_TX and send that to first worker as opposed to main. Type: fix Signed-off-by: Florin Coras <fcoras@cisco.com> Change-Id: I5df5ac3dc80c0f192b2eefb1d465e9deefe8786b
Diffstat (limited to 'src/vcl')
-rw-r--r--src/vcl/vcl_private.h6
-rw-r--r--src/vcl/vppcom.c17
2 files changed, 17 insertions, 6 deletions
diff --git a/src/vcl/vcl_private.h b/src/vcl/vcl_private.h
index a3ae42714d5..dabe52c899c 100644
--- a/src/vcl/vcl_private.h
+++ b/src/vcl/vcl_private.h
@@ -660,6 +660,12 @@ vcl_session_clear_attr (vcl_session_t * s, u8 attr)
s->attributes &= ~(1 << attr);
}
+static inline session_evt_type_t
+vcl_session_dgram_tx_evt (vcl_session_t *s, session_evt_type_t et)
+{
+ return (s->flags & VCL_SESSION_F_CONNECTED) ? et : SESSION_IO_EVT_TX_MAIN;
+}
+
/*
* Helpers
*/
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 0ba9423ecf0..b170b39a07d 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -2281,12 +2281,17 @@ vppcom_session_write_inline (vcl_worker_t *wrk, vcl_session_t *s, void *buf,
et = SESSION_IO_EVT_TX_FLUSH;
if (is_dgram)
- n_write =
- app_send_dgram_raw_gso (tx_fifo, &s->transport, s->vpp_evt_q, buf, n,
- s->gso_size, et, 0 /* do_evt */, SVM_Q_WAIT);
+ {
+ et = vcl_session_dgram_tx_evt (s, et);
+ n_write =
+ app_send_dgram_raw_gso (tx_fifo, &s->transport, s->vpp_evt_q, buf, n,
+ s->gso_size, et, 0 /* do_evt */, SVM_Q_WAIT);
+ }
else
- n_write = app_send_stream_raw (tx_fifo, s->vpp_evt_q, buf, n, et,
- 0 /* do_evt */ , SVM_Q_WAIT);
+ {
+ n_write = app_send_stream_raw (tx_fifo, s->vpp_evt_q, buf, n, et,
+ 0 /* do_evt */, SVM_Q_WAIT);
+ }
if (svm_fifo_set_event (s->tx_fifo))
app_send_io_evt_to_vpp (
@@ -2682,7 +2687,7 @@ vep_verify_epoll_chain (vcl_worker_t * wrk, u32 vep_handle)
u32 sh = vep_handle;
vcl_session_t *s;
- if (VPPCOM_DEBUG <= 2)
+ if (VPPCOM_DEBUG <= 3)
return;
s = vcl_session_get_w_handle (wrk, vep_handle);