Change in osmo-bsc[master]: assignment_fsm: send BSSMAP response only after Assignment Request

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Sun May 23 15:04:41 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/24350 )


Change subject: assignment_fsm: send BSSMAP response only after Assignment Request
......................................................................

assignment_fsm: send BSSMAP response only after Assignment Request

So far, only the MSC asked for Assignment via Assignment Request, which
we answer with a BSSMAP Assignment Complete or Assignment Failure when
done.

When Assignment is triggered for any other reason (congestion
resolution, VAMOS, VTY), we will not send any such messages to the MSC.

Additional enum values will be added in subsequent commits:
Id56a890106b93fcee67ac9401b890e7b63bba421 ASSIGN_FOR_CONGESTION_RESOLUTION
If006f5caaf83b07675f57e5665cfa79328da55e6 ASSIGN_FOR_VTY

Change-Id: Ie0cddbdb00abcec78e153f4ae6d04ce75080a111
---
M include/osmocom/bsc/gsm_data.h
M src/osmo-bsc/assignment_fsm.c
M src/osmo-bsc/gsm_data.c
M src/osmo-bsc/osmo_bsc_bssap.c
4 files changed, 42 insertions(+), 16 deletions(-)



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

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 5a202bf..4b175a4 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -111,10 +111,21 @@
 	uint16_t s15_s0;
 };
 
+enum assign_for {
+	ASSIGN_FOR_NONE,
+	ASSIGN_FOR_BSSMAP_REQ,
+};
+
+extern const struct value_string assign_for_names[];
+static inline const char *assign_for_name(enum assign_for assign_for)
+{ return get_value_string(assign_for_names, assign_for); }
+
 /* Information retrieved during an Assignment Request from the MSC. This is storage of the Assignment instructions
  * parsed from the Assignment Request message, to pass on until the gscon and assignment FSMs have decided whether an
  * Assignment is actually going to be carried out. Should remain unchanged after initial decoding. */
 struct assignment_request {
+	enum assign_for assign_for;
+
 	bool aoip;
 
 	uint16_t msc_assigned_cic;
diff --git a/src/osmo-bsc/assignment_fsm.c b/src/osmo-bsc/assignment_fsm.c
index cf3c50e..bfb4043 100644
--- a/src/osmo-bsc/assignment_fsm.c
+++ b/src/osmo-bsc/assignment_fsm.c
@@ -134,13 +134,17 @@
 
 static void on_assignment_failure(struct gsm_subscriber_connection *conn)
 {
-	struct msgb *resp = gsm0808_create_assignment_failure(conn->assignment.failure_cause, NULL);
+	/* Send Assignment Failure to MSC only when the assignment was requested via BSSAP. Do not send anything to the
+	 * MSC if re-assignment was requested for congestion resolution, for VAMOS multiplexing, or by VTY. */
+	if (conn->assignment.req.assign_for == ASSIGN_FOR_BSSMAP_REQ) {
+		struct msgb *resp = gsm0808_create_assignment_failure(conn->assignment.failure_cause, NULL);
 
-	if (!resp) {
-		LOG_ASSIGNMENT(conn, LOGL_ERROR, "Unable to compose BSSMAP Assignment Failure message\n");
-	} else {
-		rate_ctr_inc(&conn->sccp.msc->msc_ctrs->ctr[MSC_CTR_BSSMAP_TX_DT1_ASSIGMENT_FAILURE]);
-		gscon_sigtran_send(conn, resp);
+		if (!resp) {
+			LOG_ASSIGNMENT(conn, LOGL_ERROR, "Unable to compose BSSMAP Assignment Failure message\n");
+		} else {
+			rate_ctr_inc(&conn->sccp.msc->msc_ctrs->ctr[MSC_CTR_BSSMAP_TX_DT1_ASSIGMENT_FAILURE]);
+			gscon_sigtran_send(conn, resp);
+		}
 	}
 
 	/* If assignment failed as early as in assignment_fsm_start(), there may not be an fi yet. */
@@ -259,15 +263,17 @@
 	}
 	conn->assignment.new_lchan = NULL;
 
-	send_assignment_complete(conn);
-	/* If something went wrong during send_assignment_complete(), the fi will be gone from
-	 * error handling in there. Almost a success, but then again the whole thing failed. */
-	if (!conn->assignment.fi) {
-		/* The lchan was ready, and we failed to tell the MSC about it. By releasing this lchan,
-		 * the conn will notice that its primary lchan is gone and should clean itself up. */
-		lchan_release(conn->lchan, true, true, RSL_ERR_EQUIPMENT_FAIL,
-			      gscon_last_eutran_plmn(conn));
-		return;
+	if (conn->assignment.req.assign_for == ASSIGN_FOR_BSSMAP_REQ) {
+		send_assignment_complete(conn);
+		/* If something went wrong during send_assignment_complete(), the fi will be gone from
+		 * error handling in there. Almost a success, but then again the whole thing failed. */
+		if (!conn->assignment.fi) {
+			/* The lchan was ready, and we failed to tell the MSC about it. By releasing this lchan,
+			 * the conn will notice that its primary lchan is gone and should clean itself up. */
+			lchan_release(conn->lchan, true, true, RSL_ERR_EQUIPMENT_FAIL,
+				      gscon_last_eutran_plmn(conn));
+			return;
+		}
 	}
 
 	if (lchan_changed) {
@@ -486,7 +492,8 @@
 				       gsm48_chan_mode_name(conn->lchan->ch_mode_rate.chan_mode),
 				       gsm_lchan_name(conn->lchan));
 
-			send_assignment_complete(conn);
+			if (req->assign_for == ASSIGN_FOR_BSSMAP_REQ)
+				send_assignment_complete(conn);
 			/* If something went wrong during send_assignment_complete(),
 			 * the fi will be gone from error handling in there. */
 			if (conn->assignment.fi) {
diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 6c08229..781db7c 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -923,6 +923,12 @@
 	{}
 };
 
+const struct value_string assign_for_names[] = {
+	OSMO_VALUE_STRING(ASSIGN_FOR_NONE),
+	OSMO_VALUE_STRING(ASSIGN_FOR_BSSMAP_REQ),
+	{}
+};
+
 /* This may be specific to RR Channel Release, and the mappings were chosen by pure naive guessing without a proper
  * specification available. */
 enum gsm48_rr_cause bsc_gsm48_rr_cause_from_gsm0808_cause(enum gsm0808_cause c)
diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 7a7579b..fff5fbb 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -923,6 +923,7 @@
 		}
 
 		req = (struct assignment_request){
+			.assign_for = ASSIGN_FOR_BSSMAP_REQ,
 			.aoip = aoip,
 			.msc_assigned_cic = cic,
 			.use_osmux = use_osmux,
@@ -951,6 +952,7 @@
 		break;
 	case GSM0808_CHAN_SIGN:
 		req = (struct assignment_request){
+			.assign_for = ASSIGN_FOR_BSSMAP_REQ,
 			.aoip = aoip,
 		};
 

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ie0cddbdb00abcec78e153f4ae6d04ce75080a111
Gerrit-Change-Number: 24350
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210523/48018caa/attachment.htm>


More information about the gerrit-log mailing list