Change in ...osmo-bsc[master]: neighbor config: allow re-using ARFCN+BSIC pairs

2019-08-13 Thread neels
neels has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/14769 )

Change subject: neighbor config: allow re-using ARFCN+BSIC pairs
..

neighbor config: allow re-using ARFCN+BSIC pairs

Fix neighbor config to match OsmoBSC manual: implement the plan for neighbor
configuration that was so far only described in the manual without actually
being in operation.

This first allows re-using ARFCN+BSIC pairs in and across BSS.

So far the handover_start() code always looked for handover target cells across
*all* local cells, even if they were not listed as neighbors to a source cell.
Imply all cells as neighbors only as long as there are no explicit neighbors
configured. As soon as the first 'neighbor' line appears in a 'bts' config,
only the listed neighbors are regarded as handover target cells. (The
'neighbor-list' commands are not related to this, only the relatively new
'neighbor (bts|lac|cgi|...)' commands affect actual handover procedures.)

TTCN3 tests TC_ho_neighbor_config_1 thru _7 play through the various aspects of
neighbor configuration: both the legacy implicit all-cells-are-neighbors as
well as allowing only explicit neighbors by config.

Related: OS#4056
Related: osmo-ttcn3-hacks Ia4ba0e75abd3d45a3422b2525e5f938cdc5a04cc
Change-Id: I29bca59ab232eddc74e0d4698efb9c9992443983
---
M include/osmocom/bsc/handover.h
M include/osmocom/bsc/handover_fsm.h
M include/osmocom/bsc/neighbor_ident.h
M src/osmo-bsc/handover_decision_2.c
M src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/handover_logic.c
M src/osmo-bsc/neighbor_ident_vty.c
M tests/bsc/bsc_test.c
8 files changed, 241 insertions(+), 61 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved



diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h
index 322913d..b00ee60 100644
--- a/include/osmocom/bsc/handover.h
+++ b/include/osmocom/bsc/handover.h
@@ -10,6 +10,15 @@
 #include 
 #include 

+#define LOG_HO(conn, level, fmt, args...) do { \
+   if (conn->ho.fi) \
+   LOGPFSML(conn->ho.fi, level, "%s: " fmt, \
+handover_status(conn), ## args); \
+   else \
+   LOGP(DHODEC, level, "%s: " fmt, \
+handover_status(conn), ## args); \
+   } while(0)
+
 struct gsm_network;
 struct gsm_lchan;
 struct gsm_bts;
@@ -25,6 +34,8 @@
HO_RESULT_ERROR,
 };

+const char *handover_status(struct gsm_subscriber_connection *conn);
+
 extern const struct value_string handover_result_names[];
 inline static const char *handover_result_name(enum handover_result val)
 { return get_value_string(handover_result_names, val); }
@@ -70,8 +81,11 @@
   struct gsm_lchan *lchan);
 void bsc_tx_bssmap_ho_failure(struct gsm_subscriber_connection *conn);

-struct gsm_bts *bts_by_neighbor_ident(const struct gsm_network *net,
- const struct neighbor_ident_key 
*search_for);
+int find_handover_target_cell(struct gsm_bts **local_target_cell_p,
+ const struct gsm0808_cell_id_list2 
**remote_target_cell_p,
+ struct gsm_subscriber_connection *conn, const 
struct neighbor_ident_key *search_for,
+ bool log_errors);
+
 struct neighbor_ident_key *bts_ident_key(const struct gsm_bts *bts);

 void handover_parse_inter_bsc_mt(struct gsm_subscriber_connection *conn,
diff --git a/include/osmocom/bsc/handover_fsm.h 
b/include/osmocom/bsc/handover_fsm.h
index 7c2145e..1628d8f 100644
--- a/include/osmocom/bsc/handover_fsm.h
+++ b/include/osmocom/bsc/handover_fsm.h
@@ -4,18 +4,6 @@
 #include 
 #include 

-const char *handover_status(struct gsm_subscriber_connection *conn);
-
-/* This macro automatically includes a final \n, if omitted. */
-#define LOG_HO(conn, level, fmt, args...) do { \
-   if (conn->ho.fi) \
-   LOGPFSML(conn->ho.fi, level, "%s: " fmt, \
-handover_status(conn), ## args); \
-   else \
-   LOGP(DHODEC, level, "%s: " fmt, \
-handover_status(conn), ## args); \
-   } while(0)
-
 /* Terminology:
  * Intra-Cell: stays within one BTS, this should actually be an Assignment.
  * Intra-BSC: stays within one BSC, but moves between BTSes.
diff --git a/include/osmocom/bsc/neighbor_ident.h 
b/include/osmocom/bsc/neighbor_ident.h
index 17bffbc..aa38276 100644
--- a/include/osmocom/bsc/neighbor_ident.h
+++ b/include/osmocom/bsc/neighbor_ident.h
@@ -47,6 +47,8 @@
 void neighbor_ident_vty_init(struct gsm_network *net, struct 
neighbor_ident_list *nil);
 void neighbor_ident_vty_write(struct vty *vty, const char *indent, struct 
gsm_bts *bts);
 
+bool neighbor_ident_bts_entry_exists(uint8_t from_bts);
+
 #define NEIGHBOR_IDENT_VTY_KEY_PARAMS "arfcn <0-1023> bsic (<0-63>|any)"
 #define NEIGHBOR_IDENT_VTY_KEY_DOC \
"ARFCN of neigh

Change in ...osmo-bsc[master]: neighbor config: allow re-using ARFCN+BSIC pairs

2019-07-29 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/14769 )

Change subject: neighbor config: allow re-using ARFCN+BSIC pairs
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/14769
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I29bca59ab232eddc74e0d4698efb9c9992443983
Gerrit-Change-Number: 14769
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 29 Jul 2019 18:15:50 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-bsc[master]: neighbor config: allow re-using ARFCN+BSIC pairs

2019-07-29 Thread neels
Hello pespin, laforge, Jenkins Builder,

I'd like you to reexamine a change. Please visit

https://gerrit.osmocom.org/c/osmo-bsc/+/14769

to look at the new patch set (#2).

Change subject: neighbor config: allow re-using ARFCN+BSIC pairs
..

neighbor config: allow re-using ARFCN+BSIC pairs

Fix neighbor config to match OsmoBSC manual: implement the plan for neighbor
configuration that was so far only described in the manual without actually
being in operation.

This first allows re-using ARFCN+BSIC pairs in and across BSS.

So far the handover_start() code always looked for handover target cells across
*all* local cells, even if they were not listed as neighbors to a source cell.
Imply all cells as neighbors only as long as there are no explicit neighbors
configured. As soon as the first 'neighbor' line appears in a 'bts' config,
only the listed neighbors are regarded as handover target cells. (The
'neighbor-list' commands are not related to this, only the relatively new
'neighbor (bts|lac|cgi|...)' commands affect actual handover procedures.)

TTCN3 tests TC_ho_neighbor_config_1 thru _7 play through the various aspects of
neighbor configuration: both the legacy implicit all-cells-are-neighbors as
well as allowing only explicit neighbors by config.

Related: OS#4056
Related: osmo-ttcn3-hacks Ia4ba0e75abd3d45a3422b2525e5f938cdc5a04cc
Change-Id: I29bca59ab232eddc74e0d4698efb9c9992443983
---
M include/osmocom/bsc/handover.h
M include/osmocom/bsc/handover_fsm.h
M include/osmocom/bsc/neighbor_ident.h
M src/osmo-bsc/handover_decision_2.c
M src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/handover_logic.c
M src/osmo-bsc/neighbor_ident_vty.c
M tests/bsc/bsc_test.c
8 files changed, 241 insertions(+), 61 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/14769/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/14769
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I29bca59ab232eddc74e0d4698efb9c9992443983
Gerrit-Change-Number: 14769
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: newpatchset


Change in ...osmo-bsc[master]: neighbor config: allow re-using ARFCN+BSIC pairs

2019-07-29 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/14769 )

Change subject: neighbor config: allow re-using ARFCN+BSIC pairs
..


Patch Set 1: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/14769/1/src/osmo-bsc/handover_decision_2.c
File src/osmo-bsc/handover_decision_2.c:

https://gerrit.osmocom.org/#/c/14769/1/src/osmo-bsc/handover_decision_2.c@903
PS1, Line 903:  find_handover_target_cell(&neighbor_bts, &neighbor_cil,
I'd usually expect an API to return error/success and then have out parameters 
set to meaningful values only when needed, that is, upon success. But fine 
anyway.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/14769
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I29bca59ab232eddc74e0d4698efb9c9992443983
Gerrit-Change-Number: 14769
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Mon, 29 Jul 2019 16:24:14 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-bsc[master]: neighbor config: allow re-using ARFCN+BSIC pairs

2019-07-29 Thread neels
neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/14769 )

Change subject: neighbor config: allow re-using ARFCN+BSIC pairs
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/14769/1/src/osmo-bsc/handover_decision_2.c
File src/osmo-bsc/handover_decision_2.c:

https://gerrit.osmocom.org/#/c/14769/1/src/osmo-bsc/handover_decision_2.c@903
PS1, Line 903:  find_handover_target_cell(&neighbor_bts, &neighbor_cil,
> no check for return code?
the return values neighbor_bts and neighbor_cil are checked, they will both be 
NULL for any errors.
Also, this is just collecting candidates, so it should not raise error logs, 
rather just yield no candidates.



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/14769
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I29bca59ab232eddc74e0d4698efb9c9992443983
Gerrit-Change-Number: 14769
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Mon, 29 Jul 2019 16:14:38 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in ...osmo-bsc[master]: neighbor config: allow re-using ARFCN+BSIC pairs

2019-07-16 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/14769 )

Change subject: neighbor config: allow re-using ARFCN+BSIC pairs
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/14769/1/src/osmo-bsc/handover_decision_2.c
File src/osmo-bsc/handover_decision_2.c:

https://gerrit.osmocom.org/#/c/14769/1/src/osmo-bsc/handover_decision_2.c@903
PS1, Line 903:  find_handover_target_cell(&neighbor_bts, &neighbor_cil,
no check for return code?



--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/14769
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I29bca59ab232eddc74e0d4698efb9c9992443983
Gerrit-Change-Number: 14769
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-CC: pespin 
Gerrit-Comment-Date: Tue, 16 Jul 2019 17:33:34 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in ...osmo-bsc[master]: neighbor config: allow re-using ARFCN+BSIC pairs

2019-07-13 Thread laforge
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/14769 )

Change subject: neighbor config: allow re-using ARFCN+BSIC pairs
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/14769
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I29bca59ab232eddc74e0d4698efb9c9992443983
Gerrit-Change-Number: 14769
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Comment-Date: Sun, 14 Jul 2019 00:18:12 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in ...osmo-bsc[master]: neighbor config: allow re-using ARFCN+BSIC pairs

2019-07-12 Thread neels
neels has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/14769


Change subject: neighbor config: allow re-using ARFCN+BSIC pairs
..

neighbor config: allow re-using ARFCN+BSIC pairs

Fix neighbor config to match OsmoBSC manual: implement the plan for neighbor
configuration that was so far only described in the manual without actually
being in operation.

This first allows re-using ARFCN+BSIC pairs in and across BSS.

So far the handover_start() code always looked for handover target cells across
*all* local cells, even if they were not listed as neighbors to a source cell.
Imply all cells as neighbors only as long as there are no explicit neighbors
configured. As soon as the first 'neighbor' line appears in a 'bts' config,
only the listed neighbors are regarded as handover target cells. (The
'neighbor-list' commands are not related to this, only the relatively new
'neighbor (bts|lac|cgi|...)' commands affect actual handover procedures.)

TTCN3 tests TC_ho_neighbor_config_1 thru _7 play through the various aspects of
neighbor configuration: both the legacy implicit all-cells-are-neighbors as
well as allowing only explicit neighbors by config.

Related: OS#4056
Related: osmo-ttcn3-hacks Ia4ba0e75abd3d45a3422b2525e5f938cdc5a04cc
Change-Id: I29bca59ab232eddc74e0d4698efb9c9992443983
---
M include/osmocom/bsc/handover.h
M include/osmocom/bsc/handover_fsm.h
M include/osmocom/bsc/neighbor_ident.h
M src/osmo-bsc/handover_decision_2.c
M src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/handover_logic.c
M src/osmo-bsc/neighbor_ident_vty.c
M tests/bsc/bsc_test.c
8 files changed, 244 insertions(+), 62 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/69/14769/1

diff --git a/include/osmocom/bsc/handover.h b/include/osmocom/bsc/handover.h
index 322913d..b00ee60 100644
--- a/include/osmocom/bsc/handover.h
+++ b/include/osmocom/bsc/handover.h
@@ -10,6 +10,15 @@
 #include 
 #include 

+#define LOG_HO(conn, level, fmt, args...) do { \
+   if (conn->ho.fi) \
+   LOGPFSML(conn->ho.fi, level, "%s: " fmt, \
+handover_status(conn), ## args); \
+   else \
+   LOGP(DHODEC, level, "%s: " fmt, \
+handover_status(conn), ## args); \
+   } while(0)
+
 struct gsm_network;
 struct gsm_lchan;
 struct gsm_bts;
@@ -25,6 +34,8 @@
HO_RESULT_ERROR,
 };

+const char *handover_status(struct gsm_subscriber_connection *conn);
+
 extern const struct value_string handover_result_names[];
 inline static const char *handover_result_name(enum handover_result val)
 { return get_value_string(handover_result_names, val); }
@@ -70,8 +81,11 @@
   struct gsm_lchan *lchan);
 void bsc_tx_bssmap_ho_failure(struct gsm_subscriber_connection *conn);

-struct gsm_bts *bts_by_neighbor_ident(const struct gsm_network *net,
- const struct neighbor_ident_key 
*search_for);
+int find_handover_target_cell(struct gsm_bts **local_target_cell_p,
+ const struct gsm0808_cell_id_list2 
**remote_target_cell_p,
+ struct gsm_subscriber_connection *conn, const 
struct neighbor_ident_key *search_for,
+ bool log_errors);
+
 struct neighbor_ident_key *bts_ident_key(const struct gsm_bts *bts);

 void handover_parse_inter_bsc_mt(struct gsm_subscriber_connection *conn,
diff --git a/include/osmocom/bsc/handover_fsm.h 
b/include/osmocom/bsc/handover_fsm.h
index 7c2145e..1628d8f 100644
--- a/include/osmocom/bsc/handover_fsm.h
+++ b/include/osmocom/bsc/handover_fsm.h
@@ -4,18 +4,6 @@
 #include 
 #include 

-const char *handover_status(struct gsm_subscriber_connection *conn);
-
-/* This macro automatically includes a final \n, if omitted. */
-#define LOG_HO(conn, level, fmt, args...) do { \
-   if (conn->ho.fi) \
-   LOGPFSML(conn->ho.fi, level, "%s: " fmt, \
-handover_status(conn), ## args); \
-   else \
-   LOGP(DHODEC, level, "%s: " fmt, \
-handover_status(conn), ## args); \
-   } while(0)
-
 /* Terminology:
  * Intra-Cell: stays within one BTS, this should actually be an Assignment.
  * Intra-BSC: stays within one BSC, but moves between BTSes.
diff --git a/include/osmocom/bsc/neighbor_ident.h 
b/include/osmocom/bsc/neighbor_ident.h
index 17bffbc..aa38276 100644
--- a/include/osmocom/bsc/neighbor_ident.h
+++ b/include/osmocom/bsc/neighbor_ident.h
@@ -47,6 +47,8 @@
 void neighbor_ident_vty_init(struct gsm_network *net, struct 
neighbor_ident_list *nil);
 void neighbor_ident_vty_write(struct vty *vty, const char *indent, struct 
gsm_bts *bts);

+bool neighbor_ident_bts_entry_exists(uint8_t from_bts);
+
 #define NEIGHBOR_IDENT_VTY_KEY_PARAMS "arfcn <0-1023> bsic (<0-63>|any)"
 #define NEIGHBOR_IDENT_VTY_KEY_DOC \
"ARFCN of neighbor cell\n"