diff options
author | Florin Coras <fcoras@cisco.com> | 2018-07-11 05:25:06 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2018-07-11 23:10:09 +0000 |
commit | 46f001d2aca53aff029a3cfcc26171d1145282f9 (patch) | |
tree | 453cf18b44a291cff030920b9a33eb1b13eea74d /src/vnet/session/session_node.c | |
parent | bf2f3261b2302e2cc182ea71b7df61c2e2b405ce (diff) |
session: push tx notifications only if needed
VPP-1340
Change-Id: Ia3f2fc054dbfb2ba912a768c70466e7042024e32
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session/session_node.c')
-rw-r--r-- | src/vnet/session/session_node.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/vnet/session/session_node.c b/src/vnet/session/session_node.c index aec353d3367..85fd28db7a9 100644 --- a/src/vnet/session/session_node.c +++ b/src/vnet/session/session_node.c @@ -653,6 +653,7 @@ skip_dequeue: { stream_session_t *s; /* $$$ prefetch 1 ahead maybe */ session_fifo_event_t *e; + u32 to_dequeue; e = &fifo_events[i]; switch (e->event_type) @@ -671,6 +672,7 @@ skip_dequeue: clib_warning ("It's dead, Jim!"); continue; } + to_dequeue = svm_fifo_max_dequeue (s->server_tx_fifo); /* Spray packets in per session type frames, since they go to * different nodes */ @@ -678,7 +680,10 @@ skip_dequeue: &n_tx_packets); if (PREDICT_TRUE (rv == SESSION_TX_OK)) { - session_dequeue_notify (s); + /* Notify app there's tx space if not polling */ + if (PREDICT_FALSE (to_dequeue == s->server_tx_fifo->nitems + && !svm_fifo_has_event (s->server_tx_fifo))) + session_dequeue_notify (s); } else if (PREDICT_FALSE (rv == SESSION_TX_NO_BUFFERS)) { |