Improve data-path performance using talloc_pool()
allocate a talloc pool for GTP to ensure it doesn't have to go back to the libc malloc all the time.
This commit is contained in:
parent
1c9a48bfb1
commit
e213f65406
|
@ -244,7 +244,14 @@ int sgwu_gtp_init(void)
|
||||||
|
|
||||||
config.cluster_2048_pool = ogs_app()->pool.packet;
|
config.cluster_2048_pool = ogs_app()->pool.packet;
|
||||||
|
|
||||||
|
#if OGS_USE_TALLOC
|
||||||
|
/* allocate a talloc pool for GTP to ensure it doesn't have to go back
|
||||||
|
* to the libc malloc all the time */
|
||||||
|
packet_pool = talloc_pool(__ogs_talloc_core, 1000*1024);
|
||||||
|
ogs_assert(packet_pool);
|
||||||
|
#else
|
||||||
packet_pool = ogs_pkbuf_pool_create(&config);
|
packet_pool = ogs_pkbuf_pool_create(&config);
|
||||||
|
#endif
|
||||||
|
|
||||||
return OGS_OK;
|
return OGS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -222,7 +222,7 @@ static void _gtpv1_u_recv_cb(short when, ogs_socket_t fd, void *data)
|
||||||
|
|
||||||
ogs_assert(fd != INVALID_SOCKET);
|
ogs_assert(fd != INVALID_SOCKET);
|
||||||
|
|
||||||
pkbuf = ogs_pkbuf_alloc(NULL, OGS_MAX_PKT_LEN);
|
pkbuf = ogs_pkbuf_alloc(packet_pool, OGS_MAX_PKT_LEN);
|
||||||
ogs_assert(pkbuf);
|
ogs_assert(pkbuf);
|
||||||
ogs_pkbuf_reserve(pkbuf, OGS_TUN_MAX_HEADROOM);
|
ogs_pkbuf_reserve(pkbuf, OGS_TUN_MAX_HEADROOM);
|
||||||
ogs_pkbuf_put(pkbuf, OGS_MAX_PKT_LEN-OGS_TUN_MAX_HEADROOM);
|
ogs_pkbuf_put(pkbuf, OGS_MAX_PKT_LEN-OGS_TUN_MAX_HEADROOM);
|
||||||
|
@ -579,7 +579,14 @@ int upf_gtp_init(void)
|
||||||
|
|
||||||
config.cluster_2048_pool = ogs_app()->pool.packet;
|
config.cluster_2048_pool = ogs_app()->pool.packet;
|
||||||
|
|
||||||
|
#if OGS_USE_TALLOC
|
||||||
|
/* allocate a talloc pool for GTP to ensure it doesn't have to go back
|
||||||
|
* to the libc malloc all the time */
|
||||||
|
packet_pool = talloc_pool(__ogs_talloc_core, 1000*1024);
|
||||||
|
ogs_assert(packet_pool);
|
||||||
|
#else
|
||||||
packet_pool = ogs_pkbuf_pool_create(&config);
|
packet_pool = ogs_pkbuf_pool_create(&config);
|
||||||
|
#endif
|
||||||
|
|
||||||
return OGS_OK;
|
return OGS_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1937,6 +1937,9 @@ static void test5_func(abts_case *tc, void *data)
|
||||||
OGS_NAS_5GS_5GMM_STATUS,
|
OGS_NAS_5GS_5GMM_STATUS,
|
||||||
test_ue->gmm_message_type);
|
test_ue->gmm_message_type);
|
||||||
|
|
||||||
|
/* Waiting for deleting PDU session */
|
||||||
|
ogs_msleep(100);
|
||||||
|
|
||||||
/* Send De-registration request */
|
/* Send De-registration request */
|
||||||
gmmbuf = testgmm_build_de_registration_request(test_ue, 1, true, true);
|
gmmbuf = testgmm_build_de_registration_request(test_ue, 1, true, true);
|
||||||
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
ABTS_PTR_NOTNULL(tc, gmmbuf);
|
||||||
|
|
Loading…
Reference in New Issue