diff options
author | Florin Coras <fcoras@cisco.com> | 2019-01-28 15:54:27 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-01-30 09:08:11 +0000 |
commit | 2d675d72d378466d1d71a4323891071038ba21d9 (patch) | |
tree | 75bfc072ed2fc0ec90bb69f0935f1739a69ca704 /src/vcl/vppcom.c | |
parent | 822f5a498b3a21ee990a39d32b644eea947b31bb (diff) |
vls: support passive listeners
If an application worker calls listen on a session, vpp registers the
worker to the listener's work load balance group and, as new connections
are accepted, it may potentially push accept notifications to it.
There are however applications, like nginx, that on some workers may
never accept new connections on a session they've started listening on.
To avoid accumulating accept events on such workers, this patch adds
support for passive listeners. That is, workers that have started
listening on a session but then never call accept or epoll/select on
that listener.
Change-Id: I007e6dcb54fc88a0e3aab3c6e2a3d1ef135cbd58
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vcl/vppcom.c')
-rw-r--r-- | src/vcl/vppcom.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/vcl/vppcom.c b/src/vcl/vppcom.c index fc7d194bc12..570e323bb49 100644 --- a/src/vcl/vppcom.c +++ b/src/vcl/vppcom.c @@ -94,6 +94,14 @@ vppcom_session_state_str (session_state_t state) st = "STATE_FAILED"; break; + case STATE_UPDATED: + st = "STATE_UPDATED"; + break; + + case STATE_LISTEN_NO_MQ: + st = "STATE_LISTEN_NO_MQ"; + break; + default: st = "UNKNOWN_STATE"; break; @@ -818,11 +826,11 @@ vppcom_session_unbind (u32 session_handle) session->vpp_handle = ~0; session->session_state = STATE_DISCONNECT; - VDBG (1, "VCL<%d>: vpp handle 0x%llx, sid %u: sending unbind msg! new state" - " 0x%x (%s)", getpid (), vpp_handle, session_handle, STATE_DISCONNECT, + VDBG (1, "vpp handle 0x%llx, sid %u: sending unbind msg! new state" + " 0x%x (%s)", vpp_handle, session_handle, STATE_DISCONNECT, vppcom_session_state_str (STATE_DISCONNECT)); vcl_evt (VCL_EVT_UNBIND, session); - vppcom_send_unbind_sock (vpp_handle); + vppcom_send_unbind_sock (wrk, vpp_handle); return VPPCOM_OK; } |