summaryrefslogtreecommitdiffstats
path: root/src/vnet/session
diff options
context:
space:
mode:
Diffstat (limited to 'src/vnet/session')
-rw-r--r--src/vnet/session/session.c4
-rw-r--r--src/vnet/session/session_node.c16
-rw-r--r--src/vnet/session/transport.c1
-rw-r--r--src/vnet/session/transport.h4
4 files changed, 13 insertions, 12 deletions
diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c
index 15d949c76b5..8b268c00b64 100644
--- a/src/vnet/session/session.c
+++ b/src/vnet/session/session.c
@@ -130,7 +130,8 @@ session_add_self_custom_tx_evt (transport_connection_t * tc, u8 has_prio)
if (!(s->flags & SESSION_F_CUSTOM_TX))
{
s->flags |= SESSION_F_CUSTOM_TX;
- if (svm_fifo_set_event (s->tx_fifo))
+ if (svm_fifo_set_event (s->tx_fifo)
+ || transport_connection_is_descheduled (tc))
{
session_worker_t *wrk;
session_evt_elt_t *elt;
@@ -141,6 +142,7 @@ session_add_self_custom_tx_evt (transport_connection_t * tc, u8 has_prio)
elt = session_evt_alloc_old (wrk);
elt->evt.session_index = tc->s_index;
elt->evt.event_type = SESSION_IO_EVT_TX;
+ tc->flags &= ~TRANSPORT_CONNECTION_F_DESCHED;
}
}
}
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c
index b1c2428874e..b5f4321c9a8 100644
--- a/src/vnet/session/session_node.c
+++ b/src/vnet/session/session_node.c
@@ -872,7 +872,7 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
(ctx->s->session_state >= SESSION_STATE_TRANSPORT_CLOSED))
return SESSION_TX_OK;
max_burst -= n_custom_tx;
- if (!max_burst)
+ if (!max_burst || (ctx->s->flags & SESSION_F_CUSTOM_TX))
{
session_evt_add_old (wrk, elt);
return SESSION_TX_OK;
@@ -883,18 +883,18 @@ session_tx_fifo_read_and_snd_i (session_worker_t * wrk,
if (!ctx->sp.snd_space)
{
- /* This flow queue is "empty" so it should be re-evaluated before
- * the ones that have data to send. */
- if (PREDICT_TRUE (!ctx->sp.flags))
- session_evt_add_head_old (wrk, elt);
+ /* If the deschedule flag was set, remove session from scheduler.
+ * Transport is responsible for rescheduling this session. */
+ if (ctx->sp.flags & TRANSPORT_SND_F_DESCHED)
+ transport_connection_deschedule (ctx->tc);
/* Request to postpone the session, e.g., zero-wnd and transport
* is not currently probing */
else if (ctx->sp.flags & TRANSPORT_SND_F_POSTPONE)
session_evt_add_old (wrk, elt);
- /* If the deschedule flag was set, remove session from scheduler.
- * Transport is responsible for rescheduling this session. */
+ /* This flow queue is "empty" so it should be re-evaluated before
+ * the ones that have data to send. */
else
- transport_connection_deschedule (ctx->tc);
+ session_evt_add_head_old (wrk, elt);
return SESSION_TX_NO_DATA;
}
diff --git a/src/vnet/session/transport.c b/src/vnet/session/transport.c
index e27aaf3ff6b..16f4f02cbe3 100644
--- a/src/vnet/session/transport.c
+++ b/src/vnet/session/transport.c
@@ -725,6 +725,7 @@ void
transport_connection_reschedule (transport_connection_t * tc)
{
tc->flags &= ~TRANSPORT_CONNECTION_F_DESCHED;
+ transport_connection_tx_pacer_reset_bucket (tc, TRANSPORT_PACER_MIN_BURST);
if (transport_max_tx_dequeue (tc))
sesssion_reschedule_tx (tc);
else
diff --git a/src/vnet/session/transport.h b/src/vnet/session/transport.h
index b2be990947c..3c4e15a9a6b 100644
--- a/src/vnet/session/transport.h
+++ b/src/vnet/session/transport.h
@@ -184,9 +184,7 @@ transport_connection_snd_params (transport_connection_t * tc,
static inline u8
transport_connection_is_descheduled (transport_connection_t * tc)
{
- if (tc->flags & TRANSPORT_CONNECTION_F_DESCHED)
- return 1;
- return 0;
+ return ((tc->flags & TRANSPORT_CONNECTION_F_DESCHED) ? 1 : 0);
}
static inline void