lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

October 2022

  • 2 participants
  • 2331 discussions
Change in libosmocore[master]: Add osmo_sock_get_name_multiaddr_buf()
by msuraev 13 Oct '22

13 Oct '22
Attention is currently required from: neels, pespin, fixeria. msuraev has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/28997 ) Change subject: Add osmo_sock_get_name_multiaddr_buf() ...................................................................... Patch Set 14: (1 comment) Patchset: PS14: > I wonder why do we need an extra API for that. […] It's more consistent with existing multiaddr API: we already have separate functions like osmo_sock_init2_multiaddr() instead of trying to bundle everything into osmo_sock_init*(). Also I think proper place for "universal" API is libosmo-netif which will use the added function as a buildiing block. I'll update https://gerrit.osmocom.org/c/libosmo-netif/+/29079 once this one is merged. -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/28997 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: If76595ebd1cf26ba904887a36c4cc14a1b5c4521 Gerrit-Change-Number: 28997 Gerrit-PatchSet: 14 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Thu, 13 Oct 2022 17:59:10 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-sgsn[master]: GMM: permit E_GMM_COMMON_PROC_SUCCESS in normal state
by msuraev 13 Oct '22

13 Oct '22
Attention is currently required from: pespin. Hello Jenkins Builder, laforge, pespin, keith, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-sgsn/+/29676 to look at the new patch set (#3). Change subject: GMM: permit E_GMM_COMMON_PROC_SUCCESS in normal state ...................................................................... GMM: permit E_GMM_COMMON_PROC_SUCCESS in normal state The FSM might be moved out of ST_GMM_COMMON_PROC_INIT state either by E_GMM_ATTACH_SUCCESS or by E_GMM_COMMON_PROC_SUCCESS events which are not mutually exclusive. Hence the later event will arrive when we're already in the ST_GMM_REGISTERED_NORMAL state. Let's have both events permitted to keep the logs clean from useless error. Related: OS#5349 Change-Id: Ia97b50aac6c665812ddca9010de7f97b17b78bd5 --- M src/sgsn/gprs_gmm_fsm.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/76/29676/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/29676 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ia97b50aac6c665812ddca9010de7f97b17b78bd5 Gerrit-Change-Number: 29676 Gerrit-PatchSet: 3 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith <keith(a)rhizomatica.org> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-sgsn[master]: GMM: permit E_GMM_COMMON_PROC_SUCCESS in normal state
by msuraev 13 Oct '22

13 Oct '22
Attention is currently required from: pespin. msuraev has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/29676 ) Change subject: GMM: permit E_GMM_COMMON_PROC_SUCCESS in normal state ...................................................................... Patch Set 2: (2 comments) Patchset: PS2: Fixed in next revision. File src/sgsn/gprs_gmm_fsm.c: https://gerrit.osmocom.org/c/osmo-sgsn/+/29676/comment/e360188e_23a6714f PS2, Line 92: } > Please add an explicit case E_GMM_COMMON_PROC_SUCCESS here, with a comment explaining why we ignore […] Done -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/29676 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ia97b50aac6c665812ddca9010de7f97b17b78bd5 Gerrit-Change-Number: 29676 Gerrit-PatchSet: 2 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: keith <keith(a)rhizomatica.org> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Thu, 13 Oct 2022 17:43:13 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Move internal API acting on mgcp_client_pool to the corr...
by pespin 13 Oct '22

13 Oct '22
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-mgw/+/29746 ) Change subject: mgcp-client: Move internal API acting on mgcp_client_pool to the correct file section ...................................................................... mgcp-client: Move internal API acting on mgcp_client_pool to the correct file section Change-Id: Ia0cccb783918eea72c4a77861dac4b60ad369b95 --- M src/libosmo-mgcp-client/mgcp_client_pool.c 1 file changed, 26 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/46/29746/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29746 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ia0cccb783918eea72c4a77861dac4b60ad369b95 Gerrit-Change-Number: 29746 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Introduce APIs to manually select mgcp_client from pool
by pespin 13 Oct '22

13 Oct '22
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-mgw/+/29750 ) Change subject: mgcp-client: Introduce APIs to manually select mgcp_client from pool ...................................................................... mgcp-client: Introduce APIs to manually select mgcp_client from pool This will be used by osmo-bsc to implement MGW-pinning for specific BTS. This is useful for instance to keep all BTS connections targeting the same MGW in order to make use of Osmux trunking optimizations (AMR payload of different calls filling same underlaying UDP packet). Related: SYS#5987 Change-Id: I75ce3e04cd3f6d9cc20d7b4fc0f51083780786c8 --- M TODO-RELEASE M include/osmocom/mgcp_client/mgcp_client_pool.h M include/osmocom/mgcp_client/mgcp_client_pool_internal.h M src/libosmo-mgcp-client/mgcp_client_pool.c M src/libosmo-mgcp-client/mgcp_client_vty.c 5 files changed, 32 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/50/29750/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29750 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I75ce3e04cd3f6d9cc20d7b4fc0f51083780786c8 Gerrit-Change-Number: 29750 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-MessageType: newpatchset
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Introduce APIs to manually select mgcp_client from pool
by Jenkins Builder 13 Oct '22

13 Oct '22
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29750 ) Change subject: mgcp-client: Introduce APIs to manually select mgcp_client from pool ...................................................................... Patch Set 1: (1 comment) File include/osmocom/mgcp_client/mgcp_client_pool.h: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-124): https://gerrit.osmocom.org/c/osmo-mgw/+/29750/comment/0f9c27da_4d3ce676 PS1, Line 18: bool mgcp_client_pool_member_is_blocked(const struct mgcp_client_pool_member *pool_member); adding a line without newline at end of file -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29750 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I75ce3e04cd3f6d9cc20d7b4fc0f51083780786c8 Gerrit-Change-Number: 29750 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Thu, 13 Oct 2022 16:43:05 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Move internal API acting on mgcp_client_pool to the corr...
by Jenkins Builder 13 Oct '22

13 Oct '22
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29746 ) Change subject: mgcp-client: Move internal API acting on mgcp_client_pool to the correct file section ...................................................................... Patch Set 1: (1 comment) File src/libosmo-mgcp-client/mgcp_client_pool.c: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-119): https://gerrit.osmocom.org/c/osmo-mgw/+/29746/comment/0bed4f56_cb85133e PS1, Line 265: } adding a line without newline at end of file -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29746 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ia0cccb783918eea72c4a77861dac4b60ad369b95 Gerrit-Change-Number: 29746 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Thu, 13 Oct 2022 16:41:11 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Introduce APIs to manually select mgcp_client from pool
by pespin 13 Oct '22

13 Oct '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29750 ) Change subject: mgcp-client: Introduce APIs to manually select mgcp_client from pool ...................................................................... mgcp-client: Introduce APIs to manually select mgcp_client from pool This will be used by osmo-bsc to implement MGW-pinning for specific BTS. This is useful for instance to keep all BTS connections targeting the same MGW in order to make use of Osmux trunking optimizations (AMR payload of different calls filling same underlaying UDP packet). Related: SYS#5987 Change-Id: I75ce3e04cd3f6d9cc20d7b4fc0f51083780786c8 --- M TODO-RELEASE M include/osmocom/mgcp_client/mgcp_client_pool.h M include/osmocom/mgcp_client/mgcp_client_pool_internal.h M src/libosmo-mgcp-client/mgcp_client_pool.c M src/libosmo-mgcp-client/mgcp_client_vty.c 5 files changed, 32 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/50/29750/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index c480ba0..5fe3d53 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -25,4 +25,5 @@ # #library what description / commit summary line libosmo-netif >1.2.0 OSMUX_DEFAULT_PORT, osmux_xfrm_output_*, osmux_xfrm_input_* -libosmocore >1.7.0 osmo_sockaddr_is_any() \ No newline at end of file +libosmocore >1.7.0 osmo_sockaddr_is_any() +libmgcp-client NEW APIs mgcp_client_pool_member_...() \ No newline at end of file diff --git a/include/osmocom/mgcp_client/mgcp_client_pool.h b/include/osmocom/mgcp_client/mgcp_client_pool.h index d0a6ff4..ab79707 100644 --- a/include/osmocom/mgcp_client/mgcp_client_pool.h +++ b/include/osmocom/mgcp_client/mgcp_client_pool.h @@ -2,10 +2,17 @@ struct mgcp_client; struct mgcp_client_pool; +struct mgcp_client_pool_member; struct mgcp_client_pool *mgcp_client_pool_alloc(void *talloc_ctx); + void mgcp_client_pool_vty_init(int parent_node, int mgw_node, const char *indent, struct mgcp_client_pool *pool); unsigned int mgcp_client_pool_connect(struct mgcp_client_pool *pool); void mgcp_client_pool_register_single(struct mgcp_client_pool *pool, struct mgcp_client *mgcp_client); + struct mgcp_client *mgcp_client_pool_get(struct mgcp_client_pool *pool); void mgcp_client_pool_put(struct mgcp_client *mgcp_client); + +struct mgcp_client_pool_member *mgcp_client_pool_find_member_by_nr(struct mgcp_client_pool *pool, unsigned int nr); +struct mgcp_client *mgcp_client_pool_member_get(struct mgcp_client_pool_member *pool_member); +bool mgcp_client_pool_member_is_blocked(const struct mgcp_client_pool_member *pool_member); \ No newline at end of file diff --git a/include/osmocom/mgcp_client/mgcp_client_pool_internal.h b/include/osmocom/mgcp_client/mgcp_client_pool_internal.h index d71deaf..999c3ef 100644 --- a/include/osmocom/mgcp_client/mgcp_client_pool_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_pool_internal.h @@ -18,9 +18,6 @@ struct cmd_node *vty_node; }; -struct mgcp_client_pool_member *mgcp_client_pool_find_member_by_nr(struct mgcp_client_pool *pool, unsigned int nr); - - /* Struct to handle a member of a pool of MGWs. */ struct mgcp_client_pool_member { /* Entry in llist mgcp_client_pool->pool. */ diff --git a/src/libosmo-mgcp-client/mgcp_client_pool.c b/src/libosmo-mgcp-client/mgcp_client_pool.c index b62b40f..8468d27 100644 --- a/src/libosmo-mgcp-client/mgcp_client_pool.c +++ b/src/libosmo-mgcp-client/mgcp_client_pool.c @@ -148,12 +148,10 @@ /* Pick a suitable pool member */ pool_member = mgcp_client_pool_pick(pool); - if (pool_member) { - pool_member->refcount++; - return pool_member->client; - } + if (!pool_member) + return NULL; - return NULL; + return mgcp_client_pool_member_get(pool_member); } /*! put an MGCP client back into the pool (decrement reference counter). @@ -272,4 +270,23 @@ snprintf(name, sizeof(name), "%d:%s", pool_member->nr, description); return name; +} + +/*! Get the MGCP client associated with the pool reference from the pool (increment reference counter). + * \param[in] pool_member MGCP client pool descriptor. + * \returns MGCP client descriptor, NULL if no member was not ready. + */ +struct mgcp_client *mgcp_client_pool_member_get(struct mgcp_client_pool_member *pool_member) +{ + pool_member->refcount++; + return pool_member->client; +} + +/*! Get whether the MGCP client associated with the pool reference is blocked by policy. + * \param[in] pool_member MGCP client pool descriptor. + * \returns true if blocked, false otherwise + */ +bool mgcp_client_pool_member_is_blocked(const struct mgcp_client_pool_member *pool_member) +{ + return pool_member->blocked; } \ No newline at end of file diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index a823b0c..da017f6 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -32,6 +32,7 @@ #include <osmocom/mgcp_client/mgcp_client.h> #include <osmocom/mgcp_client/mgcp_client_internal.h> #include <osmocom/mgcp_client/mgcp_client_pool_internal.h> +#include <osmocom/mgcp_client/mgcp_client_pool.h> #define MGW_STR MGCP_CLIENT_MGW_STR -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29750 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I75ce3e04cd3f6d9cc20d7b4fc0f51083780786c8 Gerrit-Change-Number: 29750 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Rearrange order of structs and APIs in header
by pespin 13 Oct '22

13 Oct '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29748 ) Change subject: mgcp-client: Rearrange order of structs and APIs in header ...................................................................... mgcp-client: Rearrange order of structs and APIs in header Move mgcp_client_pool up in the file as a preparation for next commit, where pool_member will have a pointer to the pool added. The related APIs on the object are also moved up in the file. Change-Id: I9ff9c6e1e722690835c5d59b1fa87fb7d9e3120c --- M include/osmocom/mgcp_client/mgcp_client_pool_internal.h 1 file changed, 21 insertions(+), 20 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/48/29748/1 diff --git a/include/osmocom/mgcp_client/mgcp_client_pool_internal.h b/include/osmocom/mgcp_client/mgcp_client_pool_internal.h index d9beb6f..91e5a45 100644 --- a/include/osmocom/mgcp_client/mgcp_client_pool_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_pool_internal.h @@ -1,5 +1,26 @@ #pragma once +/* Struct to handle a pool of MGWs. (Use _pool functions) */ +struct mgcp_client_pool { + + /* A pointer to a 'single' mgcp client. This is a non-pooled MGCP client that is configured using + * mgcp_client_vty_init() and actively registered by the API user using mgcp_client_pool_register_single() */ + struct mgcp_client *mgcp_client_single; + + /* A list that manages the pool members (see mgcp_client_pool_member->list above) */ + struct llist_head member_list; + + /* String to use for indentation when writing the configuration file to the VTY. This field is populated by + * mgcp_client_pool_vty_init() */ + char *vty_indent; + + /* VTY node specification used with this pool. This field is populated by mgcp_client_pool_vty_init() */ + struct cmd_node *vty_node; +}; + +struct mgcp_client_pool_member *mgcp_client_pool_find_member_by_nr(struct mgcp_client_pool *pool, unsigned int nr); + + /* Struct to handle a member of a pool of MGWs. */ struct mgcp_client_pool_member { /* Entry in llist mgcp_client_pool->pool. */ @@ -25,26 +46,6 @@ unsigned int refcount; }; -/* Struct to handle a pool of MGWs. (Use _pool functions) */ -struct mgcp_client_pool { - - /* A pointer to a 'single' mgcp client. This is a non-pooled MGCP client that is configured using - * mgcp_client_vty_init() and actively registered by the API user using mgcp_client_pool_register_single() */ - struct mgcp_client *mgcp_client_single; - - /* A list that manages the pool members (see mgcp_client_pool_member->list above) */ - struct llist_head member_list; - - /* String to use for indentation when writing the configuration file to the VTY. This field is populated by - * mgcp_client_pool_vty_init() */ - char *vty_indent; - - /* VTY node specification used with this pool. This field is populated by mgcp_client_pool_vty_init() */ - struct cmd_node *vty_node; -}; - -struct mgcp_client_pool_member *mgcp_client_pool_find_member_by_nr(struct mgcp_client_pool *pool, unsigned int nr); - struct mgcp_client_pool_member *mgcp_client_pool_member_alloc(struct mgcp_client_pool *pool, unsigned int nr); void mgcp_client_pool_member_free(struct mgcp_client_pool_member *pool_member); int mgcp_client_pool_member_reinit_client(struct mgcp_client_pool_member *pool_member, struct mgcp_client_pool *pool); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29748 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I9ff9c6e1e722690835c5d59b1fa87fb7d9e3120c Gerrit-Change-Number: 29748 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-mgw[master]: mgcp-client: Rearrange internal backpointers
by pespin 13 Oct '22

13 Oct '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29749 ) Change subject: mgcp-client: Rearrange internal backpointers ...................................................................... mgcp-client: Rearrange internal backpointers Let's properly store backpointers so that it is easy to access all relation chain (pool<->pool_member<->mgcp_client). Related: SYS#5987 Change-Id: I5ec2465075da2e3c8eabca9df60681620a7db499 --- M include/osmocom/mgcp_client/mgcp_client_internal.h M include/osmocom/mgcp_client/mgcp_client_pool_internal.h M src/libosmo-mgcp-client/mgcp_client_pool.c M src/libosmo-mgcp-client/mgcp_client_vty.c 4 files changed, 16 insertions(+), 18 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/49/29749/1 diff --git a/include/osmocom/mgcp_client/mgcp_client_internal.h b/include/osmocom/mgcp_client/mgcp_client_internal.h index 73e3de2..2eb9b4c 100644 --- a/include/osmocom/mgcp_client/mgcp_client_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_internal.h @@ -16,7 +16,7 @@ mgcp_trans_id_t next_trans_id; struct llist_head responses_pending; struct llist_head inuse_endpoints; - struct mgcp_client_pool *pool; + struct mgcp_client_pool_member *pool_member; }; struct mgcp_inuse_endpoint { diff --git a/include/osmocom/mgcp_client/mgcp_client_pool_internal.h b/include/osmocom/mgcp_client/mgcp_client_pool_internal.h index 91e5a45..d71deaf 100644 --- a/include/osmocom/mgcp_client/mgcp_client_pool_internal.h +++ b/include/osmocom/mgcp_client/mgcp_client_pool_internal.h @@ -26,6 +26,9 @@ /* Entry in llist mgcp_client_pool->pool. */ struct llist_head list; + /* The pool managing this object: */ + struct mgcp_client_pool *pool; + /* Reference number assinged by VTY. This number is used to manage the pool from the VTY and to identify it in * the log. */ unsigned int nr; @@ -48,5 +51,5 @@ struct mgcp_client_pool_member *mgcp_client_pool_member_alloc(struct mgcp_client_pool *pool, unsigned int nr); void mgcp_client_pool_member_free(struct mgcp_client_pool_member *pool_member); -int mgcp_client_pool_member_reinit_client(struct mgcp_client_pool_member *pool_member, struct mgcp_client_pool *pool); +int mgcp_client_pool_member_reinit_client(struct mgcp_client_pool_member *pool_member); const char *mgcp_client_pool_member_name(const struct mgcp_client_pool_member *pool_member); diff --git a/src/libosmo-mgcp-client/mgcp_client_pool.c b/src/libosmo-mgcp-client/mgcp_client_pool.c index b3cc35d..b62b40f 100644 --- a/src/libosmo-mgcp-client/mgcp_client_pool.c +++ b/src/libosmo-mgcp-client/mgcp_client_pool.c @@ -55,7 +55,7 @@ llist_for_each_entry(pool_member, &pool->member_list, list) { /* Initialize client */ - if (mgcp_client_pool_member_reinit_client(pool_member, pool) == 0) + if (mgcp_client_pool_member_reinit_client(pool_member) == 0) pool_members_initialized++; } @@ -165,25 +165,19 @@ void mgcp_client_pool_put(struct mgcp_client *mgcp_client) { struct mgcp_client_pool_member *pool_member; - struct mgcp_client_pool *pool; if (!mgcp_client) return; - if (mgcp_client->pool) - pool = mgcp_client->pool; - else + if (!mgcp_client->pool_member) return; + pool_member = mgcp_client->pool_member; - llist_for_each_entry(pool_member, &pool->member_list, list) { - if (pool_member->client == mgcp_client) { - if (pool_member->refcount == 0) { - LOGPPMGW(pool_member, LOGL_ERROR, "MGW pool member has invalid refcount\n"); - return; - } - pool_member->refcount--; - } + if (pool_member->refcount == 0) { + LOGPPMGW(pool_member, LOGL_ERROR, "MGW pool member has invalid refcount\n"); + return; } + pool_member->refcount--; } /*************************** @@ -201,6 +195,7 @@ pool_member = talloc_zero(pool, struct mgcp_client_pool_member); OSMO_ASSERT(pool_member); mgcp_client_conf_init(&pool_member->conf); + pool_member->pool = pool; pool_member->nr = nr; llist_add_tail(&pool_member->list, &pool->member_list); return pool_member; @@ -224,7 +219,7 @@ /*! Recreate and reconnect the MGCP client associated to the pool descriptor. * \param[in] pool_member MGCP client pool descriptor. */ -int mgcp_client_pool_member_reinit_client(struct mgcp_client_pool_member *pool_member, struct mgcp_client_pool *pool) +int mgcp_client_pool_member_reinit_client(struct mgcp_client_pool_member *pool_member) { /* Get rid of a possibly existing old MGCP client instance first */ if (pool_member->client) { @@ -240,7 +235,7 @@ } /* Set backpointer so that we can detect later that this MGCP client is managed by this pool. */ - pool_member->client->pool = pool; + pool_member->client->pool_member = pool_member; /* Connect client */ if (mgcp_client_connect2(pool_member->client, 0)) { diff --git a/src/libosmo-mgcp-client/mgcp_client_vty.c b/src/libosmo-mgcp-client/mgcp_client_vty.c index 81f8f3e..a823b0c 100644 --- a/src/libosmo-mgcp-client/mgcp_client_vty.c +++ b/src/libosmo-mgcp-client/mgcp_client_vty.c @@ -401,7 +401,7 @@ return CMD_WARNING; } - if (mgcp_client_pool_member_reinit_client(pool_member, global_mgcp_client_pool) < 0) { + if (mgcp_client_pool_member_reinit_client(pool_member) < 0) { LOGP(DLMGCP, LOGL_ERROR, "(manual) MGW %s connect failed at (%s:%u)\n", mgcp_client_pool_member_name(pool_member), pool_member->conf.remote_addr, pool_member->conf.remote_port); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29749 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I5ec2465075da2e3c8eabca9df60681620a7db499 Gerrit-Change-Number: 29749 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • ...
  • 234
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.