diff options
author | Florin Coras <fcoras@cisco.com> | 2019-03-03 14:56:05 -0800 |
---|---|---|
committer | Damjan Marion <dmarion@me.com> | 2019-03-04 11:16:09 +0000 |
commit | 19223e03fe768df3fc995a5d38a5de9f2c5acf27 (patch) | |
tree | 7ce4723a7d260114b1d5ef2e09f5392e18caa178 | |
parent | f8bdc6ef4916caa3caf8e2ca987ef00b49aa4858 (diff) |
session: remove svm_segment_index from session struct
Change-Id: I42ef9ee38f93600a0d6f2699b1b2a0a201fcec9c
Signed-off-by: Florin Coras <fcoras@cisco.com>
-rw-r--r-- | src/vnet/session/application.c | 3 | ||||
-rw-r--r-- | src/vnet/session/application_local.c | 1 | ||||
-rw-r--r-- | src/vnet/session/application_worker.c | 3 | ||||
-rw-r--r-- | src/vnet/session/segment_manager.c | 5 | ||||
-rw-r--r-- | src/vnet/session/segment_manager.h | 2 | ||||
-rw-r--r-- | src/vnet/session/session.c | 3 |
6 files changed, 7 insertions, 10 deletions
diff --git a/src/vnet/session/application.c b/src/vnet/session/application.c index e575a3df584..37eb1cb2d18 100644 --- a/src/vnet/session/application.c +++ b/src/vnet/session/application.c @@ -1122,8 +1122,7 @@ application_change_listener_owner (session_t * s, app_worker_t * app_wrk) hash_unset (old_wrk->listeners_table, listen_session_get_handle (s)); if (session_transport_service_type (s) == TRANSPORT_SERVICE_CL && s->rx_fifo) - segment_manager_dealloc_fifos (s->rx_fifo->segment_index, s->rx_fifo, - s->tx_fifo); + segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo); app = application_get (old_wrk->app_index); if (!app) diff --git a/src/vnet/session/application_local.c b/src/vnet/session/application_local.c index b5cac56130c..9378e5e6380 100644 --- a/src/vnet/session/application_local.c +++ b/src/vnet/session/application_local.c @@ -210,7 +210,6 @@ ct_init_local_session (app_worker_t * client_wrk, app_worker_t * server_wrk, ls->tx_fifo->segment_manager = sm_index; ls->rx_fifo->segment_index = seg_index; ls->tx_fifo->segment_index = seg_index; - ls->svm_segment_index = seg_index; segment_handle = segment_manager_segment_handle (sm, seg); if ((rv = app_worker_add_segment_notify (server_wrk, segment_handle))) diff --git a/src/vnet/session/application_worker.c b/src/vnet/session/application_worker.c index 662c65ba05b..9dfa3aa0243 100644 --- a/src/vnet/session/application_worker.c +++ b/src/vnet/session/application_worker.c @@ -165,7 +165,6 @@ app_worker_alloc_session_fifos (segment_manager_t * sm, session_t * s) s->rx_fifo = rx_fifo; s->tx_fifo = tx_fifo; - s->svm_segment_index = fifo_segment_index; return 0; } @@ -362,7 +361,7 @@ app_worker_own_session (app_worker_t * app_wrk, session_t * s) s->tx_fifo->cursize = txf->cursize; } - segment_manager_dealloc_fifos (rxf->segment_index, rxf, txf); + segment_manager_dealloc_fifos (rxf, txf); return 0; } diff --git a/src/vnet/session/segment_manager.c b/src/vnet/session/segment_manager.c index 0ec14f791ff..b7467bbbd43 100644 --- a/src/vnet/session/segment_manager.c +++ b/src/vnet/session/segment_manager.c @@ -604,11 +604,11 @@ alloc_check: } void -segment_manager_dealloc_fifos (u32 segment_index, svm_fifo_t * rx_fifo, - svm_fifo_t * tx_fifo) +segment_manager_dealloc_fifos (svm_fifo_t * rx_fifo, svm_fifo_t * tx_fifo) { svm_fifo_segment_private_t *fifo_segment; segment_manager_t *sm; + u32 segment_index; if (!rx_fifo || !tx_fifo) return; @@ -618,6 +618,7 @@ segment_manager_dealloc_fifos (u32 segment_index, svm_fifo_t * rx_fifo, if (!(sm = segment_manager_get_if_valid (rx_fifo->segment_manager))) return; + segment_index = rx_fifo->segment_index; fifo_segment = segment_manager_get_segment_w_lock (sm, segment_index); svm_fifo_segment_free_fifo (fifo_segment, rx_fifo, FIFO_SEGMENT_RX_FREELIST); diff --git a/src/vnet/session/segment_manager.h b/src/vnet/session/segment_manager.h index 15fd067053f..dadbd571a58 100644 --- a/src/vnet/session/segment_manager.h +++ b/src/vnet/session/segment_manager.h @@ -157,7 +157,7 @@ int segment_manager_try_alloc_fifos (svm_fifo_segment_private_t * fs, u32 rx_fifo_size, u32 tx_fifo_size, svm_fifo_t ** rx_fifo, svm_fifo_t ** tx_fifo); -void segment_manager_dealloc_fifos (u32 segment_index, svm_fifo_t * rx_fifo, +void segment_manager_dealloc_fifos (svm_fifo_t * rx_fifo, svm_fifo_t * tx_fifo); u32 segment_manager_evt_q_expected_size (u32 q_size); svm_msg_q_t *segment_manager_alloc_queue (svm_fifo_segment_private_t * fs, diff --git a/src/vnet/session/session.c b/src/vnet/session/session.c index fced034df85..57567926a1c 100644 --- a/src/vnet/session/session.c +++ b/src/vnet/session/session.c @@ -181,8 +181,7 @@ session_free (session_t * s) void session_free_w_fifos (session_t * s) { - segment_manager_dealloc_fifos (s->svm_segment_index, s->rx_fifo, - s->tx_fifo); + segment_manager_dealloc_fifos (s->rx_fifo, s->tx_fifo); session_free (s); } |