laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/36315?usp=email )
Change subject: Use same msgb allocation size like before osmo_io introduction ......................................................................
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 --- M src/m3ua.c M src/osmo_ss7_asp.c M src/osmo_ss7_xua_srv.c M src/xua_internal.h 4 files changed, 29 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/15/36315/1
diff --git a/src/m3ua.c b/src/m3ua.c index f4dbf76..fcbc759 100644 --- a/src/m3ua.c +++ b/src/m3ua.c @@ -310,9 +310,6 @@ (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 92b3a5b..1f45749 100644 --- a/src/osmo_ss7_asp.c +++ b/src/osmo_ss7_asp.c @@ -43,6 +43,7 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/socket.h> #include <osmocom/core/sockaddr_str.h> +#include <osmocom/core/osmo_io.h>
#include <osmocom/netif/stream.h> #include <osmocom/netif/ipa.h> @@ -900,6 +901,8 @@ 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 eeb6768..473826f 100644 --- a/src/osmo_ss7_xua_srv.c +++ b/src/osmo_ss7_xua_srv.c @@ -43,6 +43,7 @@ #include <osmocom/core/msgb.h> #include <osmocom/core/socket.h> #include <osmocom/core/sockaddr_str.h> +#include <osmocom/core/osmo_io.h>
#include <osmocom/netif/stream.h> #include <osmocom/netif/ipa.h> @@ -80,6 +81,8 @@ 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 b6b33af..d4b16f9 100644 --- a/src/xua_internal.h +++ b/src/xua_internal.h @@ -4,6 +4,9 @@ #include <osmocom/sigtran/osmo_ss7.h> #include <osmocom/sigtran/xua_msg.h>
+#define M3UA_MSG_SIZE 2048 +#define M3UA_MSG_HEADROOM 512 + struct osmo_sccp_addr; struct m3ua_data_hdr;