summaryrefslogtreecommitdiffstats
path: root/src/vcl/vppcom.c
diff options
context:
space:
mode:
authorFlorin Coras <fcoras@cisco.com>2018-12-12 10:56:01 -0800
committerDave Barach <openvpp@barachs.net>2018-12-13 13:40:32 +0000
commit42ceddb7cd836a89a12b0b8e623b06bc4c0cc0cb (patch)
tree9731e8708e3ad9d96d418068d59743dbd8e69658 /src/vcl/vppcom.c
parent413f4a5b2123c1625d615315db293a080078482b (diff)
session/tcp: support tx flush mark
For tcp this means that the last enqueued data goes out with a psh bit set. Change-Id: I29d357ecae6f02e748b59a7b799150ec73d14ba2 Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r--src/vcl/vppcom.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c
index 0eaab6cbd6b..9bb6a9880d1 100644
--- a/src/vcl/vppcom.c
+++ b/src/vcl/vppcom.c
@@ -1665,8 +1665,9 @@ vcl_is_tx_evt_for_session (session_event_t * e, u32 sid, u8 is_ct)
return (e->event_type == SESSION_IO_EVT_CT_RX);
}
-int
-vppcom_session_write (uint32_t session_handle, void *buf, size_t n)
+static inline int
+vppcom_session_write_inline (uint32_t session_handle, void *buf, size_t n,
+ u8 is_flush)
{
vcl_worker_t *wrk = vcl_worker_get_current ();
int rv, n_write, is_nonblocking;
@@ -1733,6 +1734,9 @@ vppcom_session_write (uint32_t session_handle, void *buf, size_t n)
ASSERT (FIFO_EVENT_APP_TX + 1 == SESSION_IO_EVT_CT_TX);
et = FIFO_EVENT_APP_TX + vcl_session_is_ct (s);
+ if (is_flush && !vcl_session_is_ct (s))
+ et = SESSION_IO_EVT_TX_FLUSH;
+
if (s->is_dgram)
n_write = app_send_dgram_raw (tx_fifo, &s->transport,
s->vpp_evt_q, buf, n, et, SVM_Q_WAIT);
@@ -1748,6 +1752,13 @@ vppcom_session_write (uint32_t session_handle, void *buf, size_t n)
return n_write;
}
+int
+vppcom_session_write (uint32_t session_handle, void *buf, size_t n)
+{
+ return vppcom_session_write_inline (session_handle, buf, n,
+ 0 /* is_flush */ );
+}
+
static vcl_session_t *
vcl_ct_session_get_from_fifo (vcl_worker_t * wrk, svm_fifo_t * f, u8 type)
{
@@ -3345,7 +3356,7 @@ vppcom_session_sendto (uint32_t session_handle, void *buffer,
getpid (), flags, flags);
}
- return (vppcom_session_write (session_handle, buffer, buflen));
+ return (vppcom_session_write_inline (session_handle, buffer, buflen, 1));
}
int