From 471f859d77cf3fb0d280e05e94d69a1bda28a345 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sat, 16 Mar 2024 10:18:40 +0100 Subject: [PATCH] Use same msgb allocation size like before osmo_io introduction In Change-Id Ia1910f3b99d918ec2a34d5304c3f40ba015c25c9 we introduced osmo_io support for xUA + IPA. However, when we did that, the msgb allocation sizes of libosmo-sigtran were neglected, and rather the defaults of osmo_io used. This commit returns libosmo-sigtran to the exact msgb allocation + headroom sizes used before the osmo_io migration. Related: OS#5752 Closes: OS#6403 Depends: libosmo-netif.git Change-Id Ie19c8294ddb12dfe5e0fd44e047c47e6f9cbd384 Change-Id: I0c6dcff4523e4c04aae43a4585b5e0c3617ef1a6 --- src/m3ua.c | 3 --- src/osmo_ss7_asp.c | 3 +++ src/osmo_ss7_xua_srv.c | 3 +++ src/xua_internal.h | 3 +++ 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/m3ua.c b/src/m3ua.c index f4dbf766..fcbc7590 100644 --- a/src/m3ua.c +++ b/src/m3ua.c @@ -310,9 +310,6 @@ void m3ua_dh_to_xfer_param(struct osmo_mtp_transfer_param *param, (mdh->ni & 0x3 << 6); } -#define M3UA_MSG_SIZE 2048 -#define M3UA_MSG_HEADROOM 512 - struct msgb *m3ua_msgb_alloc(const char *name) { if (!name) diff --git a/src/osmo_ss7_asp.c b/src/osmo_ss7_asp.c index 92b3a5bb..1f457492 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -900,6 +901,8 @@ static int xua_cli_connect_cb(struct osmo_stream_cli *cli) if (fd < 0) return fd; + osmo_iofd_set_alloc_info(osmo_stream_cli_get_iofd(cli), M3UA_MSG_SIZE, M3UA_MSG_HEADROOM); + /* update the socket name */ talloc_free(asp->sock_name); asp->sock_name = osmo_sock_get_name(asp, fd); diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c index eeb67680..473826fd 100644 --- a/src/osmo_ss7_xua_srv.c +++ b/src/osmo_ss7_xua_srv.c @@ -43,6 +43,7 @@ #include #include #include +#include #include #include @@ -80,6 +81,8 @@ static int xua_accept_cb(struct osmo_stream_srv_link *link, int fd) return -1; } + osmo_iofd_set_alloc_info(osmo_stream_srv_get_iofd(srv), M3UA_MSG_SIZE, M3UA_MSG_HEADROOM); + switch (oxs->cfg.proto) { case OSMO_SS7_ASP_PROT_IPA: osmo_stream_srv_set_read_cb(srv, ss7_asp_ipa_srv_conn_rx_cb); diff --git a/src/xua_internal.h b/src/xua_internal.h index b6b33af4..d4b16f92 100644 --- a/src/xua_internal.h +++ b/src/xua_internal.h @@ -4,6 +4,9 @@ #include #include +#define M3UA_MSG_SIZE 2048 +#define M3UA_MSG_HEADROOM 512 + struct osmo_sccp_addr; struct m3ua_data_hdr;