Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
session: add session process node
[vpp.git]
/
src
/
vnet
/
session
/
application.c
diff --git
a/src/vnet/session/application.c
b/src/vnet/session/application.c
index
7bc2c11
..
60019dd
100644
(file)
--- a/
src/vnet/session/application.c
+++ b/
src/vnet/session/application.c
@@
-442,16
+442,12
@@
application_start_listen (application_t * srv, session_endpoint_t * sep,
session_type_t sst;
sst = session_type_from_proto_and_ip (sep->transport_proto, sep->is_ip4);
session_type_t sst;
sst = session_type_from_proto_and_ip (sep->transport_proto, sep->is_ip4);
- s = listen_session_new (sst);
+ s = listen_session_new (
0,
sst);
s->app_index = srv->index;
s->app_index = srv->index;
- if (stream_session_listen (s, sep))
- goto err;
-
/* Allocate segment manager. All sessions derived out of a listen session
* have fifos allocated by the same segment manager. */
/* Allocate segment manager. All sessions derived out of a listen session
* have fifos allocated by the same segment manager. */
- sm = application_alloc_segment_manager (srv);
- if (sm == 0)
+ if (!(sm = application_alloc_segment_manager (srv)))
goto err;
/* Add to app's listener table. Useful to find all child listeners
goto err;
/* Add to app's listener table. Useful to find all child listeners
@@
-459,6
+455,13
@@
application_start_listen (application_t * srv, session_endpoint_t * sep,
handle = listen_session_get_handle (s);
hash_set (srv->listeners_table, handle, segment_manager_index (sm));
handle = listen_session_get_handle (s);
hash_set (srv->listeners_table, handle, segment_manager_index (sm));
+ if (stream_session_listen (s, sep))
+ {
+ segment_manager_del (sm);
+ hash_unset (srv->listeners_table, handle);
+ goto err;
+ }
+
*res = handle;
return 0;
*res = handle;
return 0;
@@
-566,8
+569,7
@@
application_get_local_segment_manager_w_session (application_t * app,
stream_session_t *listener;
if (application_local_session_listener_has_transport (ls))
{
stream_session_t *listener;
if (application_local_session_listener_has_transport (ls))
{
- listener = listen_session_get (ls->listener_session_type,
- ls->listener_index);
+ listener = listen_session_get (ls->listener_index);
return application_get_listen_segment_manager (app, listener);
}
return segment_manager_get (app->local_segment_manager);
return application_get_listen_segment_manager (app, listener);
}
return segment_manager_get (app->local_segment_manager);
@@
-1435,8
+1437,8
@@
format_application (u8 * s, va_list * args)
{
if (verbose)
s = format (s, "%-10s%-20s%-15s%-15s%-15s%-15s%-15s", "Index", "Name",
{
if (verbose)
s = format (s, "%-10s%-20s%-15s%-15s%-15s%-15s%-15s", "Index", "Name",
- "API Client", "Namespace", "Add seg size", "Rx
fifo
size",
- "Tx
fifo
size");
+ "API Client", "Namespace", "Add seg size", "Rx
-f
size",
+ "Tx
-f
size");
else
s = format (s, "%-10s%-20s%-15s%-40s", "Index", "Name", "API Client",
"Namespace");
else
s = format (s, "%-10s%-20s%-15s%-40s", "Index", "Name", "API Client",
"Namespace");
@@
-1447,12
+1449,13
@@
format_application (u8 * s, va_list * args)
app_ns_name = app_namespace_id_from_index (app->ns_index);
props = application_segment_manager_properties (app);
if (verbose)
app_ns_name = app_namespace_id_from_index (app->ns_index);
props = application_segment_manager_properties (app);
if (verbose)
- s = format (s, "%-10
d%-20s%-15d%-15d%-15d%-15d%-15d
", app->index,
+ s = format (s, "%-10
u%-20s%-15d%-15u%-15U%-15U%-15U
", app->index,
app_name, app->api_client_index, app->ns_index,
app_name, app->api_client_index, app->ns_index,
- props->add_segment_size, props->rx_fifo_size,
+ format_memory_size, props->add_segment_size,
+ format_memory_size, props->rx_fifo_size, format_memory_size,
props->tx_fifo_size);
else
props->tx_fifo_size);
else
- s = format (s, "%-10
d
%-20s%-15d%-40s", app->index, app_name,
+ s = format (s, "%-10
u
%-20s%-15d%-40s", app->index, app_name,
app->api_client_index, app_ns_name);
return s;
}
app->api_client_index, app_ns_name);
return s;
}