From d121ea612460b8a6f78a3bc91ab164651240f48a Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Fri, 27 Nov 2015 01:20:53 +0100 Subject: gtphub: use a single TEI pool across planes. There's no need to keep two separate number pools when both can be fed from the same pool. User and Ctrl plane TEIs can technically overlap without colliding, but it doesn't hurt if they don't overlap, either. Sponsored-by: On-Waves ehi --- openbsc/src/gprs/gtphub.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'openbsc/src/gprs/gtphub.c') diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c index 4f81c017f..5807f5f58 100644 --- a/openbsc/src/gprs/gtphub.c +++ b/openbsc/src/gprs/gtphub.c @@ -1449,7 +1449,7 @@ static int gtphub_handle_pdp_ctx_ies(struct gtphub *hub, if (tei_from_ie) { /* Create TEI mapping and replace in GTP packet IE */ - uint32_t mapped_tei = nr_pool_next(&hub->tei_pool[plane_idx]); + uint32_t mapped_tei = nr_pool_next(&hub->tei_pool); tun->endpoint[side_idx][plane_idx].tei_orig = tei_from_ie; tun->endpoint[side_idx][plane_idx].tei_repl = mapped_tei; @@ -2105,10 +2105,10 @@ void gtphub_init(struct gtphub *hub) expiry_init(&hub->expire_quickly, GTPH_EXPIRE_QUICKLY_SECS); expiry_init(&hub->expire_slowly, GTPH_EXPIRE_SLOWLY_MINUTES * 60); + nr_pool_init(&hub->tei_pool, 1, 0xffffffff); + int plane_idx; for_each_plane(plane_idx) { - nr_pool_init(&hub->tei_pool[plane_idx], 1, 0xffffffff); - gtphub_bind_init(&hub->to_ggsns[plane_idx]); gtphub_bind_init(&hub->to_sgsns[plane_idx]); } -- cgit v1.2.3