diff options
author | Florin Coras <fcoras@cisco.com> | 2017-08-14 22:33:41 -0700 |
---|---|---|
committer | Dave Barach <openvpp@barachs.net> | 2017-08-16 13:28:27 +0000 |
commit | 0e9c33bb5fef22be4db350a33bef1f7534123b04 (patch) | |
tree | dc880008afc5783c421822d5d283da270dd5d8dd /src/vnet/session | |
parent | 4f80b81d4a7ab537b7a6ede88abed26f278c0f26 (diff) |
tcp: improve builtin http server
Additionally:
- remove opaques from stream_session_t
- ensure first segment manager is only used once per app.
Change-Id: I143d1fdb8effc88815ef969b78122ba3ac29e06e
Signed-off-by: Florin Coras <fcoras@cisco.com>
Diffstat (limited to 'src/vnet/session')
-rw-r--r-- | src/vnet/session/application.c | 14 | ||||
-rw-r--r-- | src/vnet/session/application.h | 1 | ||||
-rw-r--r-- | src/vnet/session/stream_session.h | 8 |
3 files changed, 12 insertions, 11 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c index bc837bb2939..25a4efa50aa 100644 --- a/src/vnet/session/application.c +++ b/src/vnet/session/application.c @@ -225,15 +225,17 @@ application_alloc_segment_manager (application_t * app) { segment_manager_t *sm = 0; - if (app->first_segment_manager != (u32) ~ 0) + if (app->first_segment_manager != (u32) ~ 0 + && app->first_segment_manager_in_use == 0) { sm = segment_manager_get (app->first_segment_manager); + app->first_segment_manager_in_use = 1; return sm; } sm = segment_manager_new (); - if (segment_manager_init (sm, &app->sm_properties, 0)) - return 0; + sm->properties = &app->sm_properties; + return sm; } @@ -301,7 +303,11 @@ application_stop_listen (application_t * srv, u64 handle) sm = segment_manager_get (*indexp); segment_manager_del (sm); - srv->first_segment_manager = ~0; + if (srv->first_segment_manager == *indexp) + { + srv->first_segment_manager_in_use = 0; + srv->first_segment_manager = ~0; + } hash_unset (srv->listeners_table, handle); listen_session_del (listener); diff --git a/src/vnet/session/application.h b/src/vnet/session/application.h index 45bc00131f5..95a39c05480 100644 --- a/src/vnet/session/application.h +++ b/src/vnet/session/application.h @@ -86,6 +86,7 @@ typedef struct _application uword *listeners_table; u32 first_segment_manager; + u8 first_segment_manager_in_use; /** Segment manager properties. Shared by all segment managers */ segment_manager_properties_t sm_properties; diff --git a/src/vnet/session/stream_session.h b/src/vnet/session/stream_session.h index 39bf846aca7..533cf97fef9 100644 --- a/src/vnet/session/stream_session.h +++ b/src/vnet/session/stream_session.h @@ -63,9 +63,6 @@ typedef struct _stream_session_t /** To avoid n**2 "one event per frame" check */ u8 enqueue_epoch; - /** Pad to a multiple of 8 octets */ - u8 align_pad[4]; - /** svm segment index where fifos were allocated */ u32 svm_segment_index; @@ -81,10 +78,7 @@ typedef struct _stream_session_t /** Parent listener session if the result of an accept */ u32 listener_index; - u32 opaque2; - - /** Opaque, pad to a 64-octet boundary */ - u64 opaque[1]; + CLIB_CACHE_LINE_ALIGN_MARK (pad); } stream_session_t; #endif /* SRC_VNET_SESSION_STREAM_SESSION_H_ */ |