keith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/28340 )
Change subject: Avoid UPDATE immediately followed by DELETE
......................................................................
Avoid UPDATE immediately followed by DELETE
There is no need to mark an SMS as sent before deleting it.
Avoid the extra database overhead involved in doing this.
Change-Id: I777155c0f818b979c636bb59953719e472771603
---
M include/osmocom/msc/db.h
M include/osmocom/msc/sms_queue.h
M src/libmsc/db.c
M src/libmsc/gsm_04_11.c
M src/libmsc/sms_queue.c
5 files changed, 54 insertions(+), 23 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/40/28340/1
diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h
index a67c050..4294b9f 100644
--- a/include/osmocom/msc/db.h
+++ b/include/osmocom/msc/db.h
@@ -50,6 +50,7 @@
int db_sms_mark_delivered(struct gsm_sms *sms);
int db_sms_inc_deliver_attempts(struct gsm_sms *sms);
int db_sms_delete_by_msisdn(const char *msisdn);
+int db_sms_delete_message_by_id(unsigned long long sms_id);
int db_sms_delete_sent_message_by_id(unsigned long long sms_id);
int db_sms_delete_expired_message_by_id(unsigned long long sms_id);
void db_sms_delete_oldest_expired_message(void);
diff --git a/include/osmocom/msc/sms_queue.h b/include/osmocom/msc/sms_queue.h
index a6e6aeb..e4b2a12 100644
--- a/include/osmocom/msc/sms_queue.h
+++ b/include/osmocom/msc/sms_queue.h
@@ -2,9 +2,26 @@
#define SMS_QUEUE_H
#include <stdbool.h>
+#include <osmocom/core/timer.h>
+#include <osmocom/msc/gsm_subscriber.h>
struct gsm_network;
-struct gsm_sms_queue;
+/* (global) state of the SMS queue. */
+struct gsm_sms_queue {
+ struct osmo_timer_list resend_pending; /* timer triggering sms_resend_pending() */
+ struct osmo_timer_list push_queue; /* timer triggering sms_submit_pending() */
+ struct gsm_network *network;
+ struct llist_head pending_sms; /* list of gsm_sms_pending */
+ struct sms_queue_config *cfg;
+ int pending; /* current number of gsm_sms_pending in RAM */
+
+ /* last MSISDN for which we read SMS from the database and created gsm_sms_pending records */
+ char last_msisdn[GSM23003_MSISDN_MAX_DIGITS+1];
+
+ /* statistics / counters */
+ struct osmo_stat_item_group *statg;
+ struct rate_ctr_group *ctrg;
+};
struct vty;
struct sms_queue_config {
diff --git a/src/libmsc/db.c b/src/libmsc/db.c
index 6fe8803..ea0fef3 100644
--- a/src/libmsc/db.c
+++ b/src/libmsc/db.c
@@ -54,6 +54,7 @@
DB_STMT_SMS_INC_DELIVER_ATTEMPTS,
DB_STMT_SMS_DEL_BY_MSISDN,
DB_STMT_SMS_DEL_BY_ID,
+ DB_STMT_SMS_DEL_SENT_BY_ID,
DB_STMT_SMS_DEL_EXPIRED,
DB_STMT_SMS_GET_VALID_UNTIL_BY_ID,
DB_STMT_SMS_GET_OLDEST_EXPIRED,
@@ -310,8 +311,10 @@
" WHERE id = $id",
[DB_STMT_SMS_DEL_BY_MSISDN] =
"DELETE FROM SMS WHERE src_addr=$src_addr OR dest_addr=$dest_addr",
- [DB_STMT_SMS_DEL_BY_ID] =
+ [DB_STMT_SMS_DEL_SENT_BY_ID] =
"DELETE FROM SMS WHERE id = $id AND sent is NOT NULL",
+ [DB_STMT_SMS_DEL_BY_ID] =
+ "DELETE FROM SMS WHERE id = $id LIMIT 1",
[DB_STMT_SMS_DEL_EXPIRED] =
"DELETE FROM SMS WHERE id = $id",
[DB_STMT_SMS_GET_VALID_UNTIL_BY_ID] =
@@ -986,7 +989,7 @@
return 0;
}
-int db_sms_delete_sent_message_by_id(unsigned long long sms_id)
+int db_sms_delete_message_by_id(unsigned long long sms_id)
{
OSMO_ASSERT(g_dbc);
sqlite3_stmt *stmt = g_dbc->stmt[DB_STMT_SMS_DEL_BY_ID];
@@ -1005,6 +1008,25 @@
return 0;
}
+int db_sms_delete_sent_message_by_id(unsigned long long sms_id)
+{
+ OSMO_ASSERT(g_dbc);
+ sqlite3_stmt *stmt = g_dbc->stmt[DB_STMT_SMS_DEL_SENT_BY_ID];
+ int rc;
+
+ db_bind_int64(stmt, "$id", sms_id);
+
+ rc = sqlite3_step(stmt);
+ if (rc != SQLITE_DONE) {
+ db_remove_reset(stmt);
+ LOGP(DDB, LOGL_ERROR, "Failed to delete SMS %llu.\n", sms_id);
+ return 1;
+ }
+
+ db_remove_reset(stmt);
+ return 0;
+}
+
static int delete_expired_sms(unsigned long long sms_id, time_t validity_timestamp)
{
OSMO_ASSERT(g_dbc);
diff --git a/src/libmsc/gsm_04_11.c b/src/libmsc/gsm_04_11.c
index 743e272..a9d5bd6 100644
--- a/src/libmsc/gsm_04_11.c
+++ b/src/libmsc/gsm_04_11.c
@@ -56,6 +56,7 @@
#include <osmocom/msc/msub.h>
#include <osmocom/msc/msc_a.h>
#include <osmocom/msc/paging.h>
+#include <osmocom/msc/sms_queue.h>
#ifdef BUILD_SMPP
#include "smpp_smsc.h"
@@ -845,6 +846,7 @@
struct gsm411_rp_hdr *rph)
{
struct gsm_sms *sms = trans->sms.sms;
+ struct gsm_sms_queue *smq = trans->net->sms_queue;
/* Acnkowledgement to MT RP_DATA, i.e. the MS confirms it
* successfully received a SMS. We can now safely mark it as
@@ -861,8 +863,14 @@
GSM411_RP_CAUSE_PROTOCOL_ERR);
}
- /* mark this SMS as sent in database */
- db_sms_mark_delivered(sms);
+ /* If we are deleting delivered SMS, then this SMS will very soon be deleted
+ * in the signal callback.
+ * In this case, let's avoid the extra database overhead involved in doing
+ * an UPDATE followed by an immediate DELETE */
+
+ /* msc_vlr tests will not pass any sms_queue, hence need to check smq != NULL */
+ if (smq && smq->cfg->delete_delivered == 0)
+ db_sms_mark_delivered(sms);
send_signal(S_SMS_DELIVERED, trans, sms, 0);
diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c
index a1cc465..9b42024 100644
--- a/src/libmsc/sms_queue.c
+++ b/src/libmsc/sms_queue.c
@@ -119,23 +119,6 @@
int resend; /* should we try re-sending it (now) ? */
};
-/* (global) state of the SMS queue. */
-struct gsm_sms_queue {
- struct osmo_timer_list resend_pending; /* timer triggering sms_resend_pending() */
- struct osmo_timer_list push_queue; /* timer triggering sms_submit_pending() */
- struct gsm_network *network;
- struct llist_head pending_sms; /* list of gsm_sms_pending */
- struct sms_queue_config *cfg;
- int pending; /* current number of gsm_sms_pending in RAM */
-
- /* last MSISDN for which we read SMS from the database and created gsm_sms_pending records */
- char last_msisdn[GSM23003_MSISDN_MAX_DIGITS+1];
-
- /* statistics / counters */
- struct osmo_stat_item_group *statg;
- struct rate_ctr_group *ctrg;
-};
-
/* private wrapper function to make sure we count all SMS delivery attempts */
static void _gsm411_send_sms(struct gsm_network *net, struct vlr_subscr *vsub, struct gsm_sms *sms)
{
@@ -625,7 +608,7 @@
vsub = pending->vsub;
vlr_subscr_get(vsub, __func__);
if (smq->cfg->delete_delivered)
- db_sms_delete_sent_message_by_id(pending->sms_id);
+ db_sms_delete_message_by_id(pending->sms_id);
sms_pending_free(smq, pending);
/* Attempt to send another SMS to this subscriber */
sms_send_next(vsub);
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28340
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I777155c0f818b979c636bb59953719e472771603
Gerrit-Change-Number: 28340
Gerrit-PatchSet: 1
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-MessageType: newchange
keith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-msc/+/28338 )
Change subject: Refactor smsq_take_next_sms()
......................................................................
Refactor smsq_take_next_sms()
The logic in sms_submit_pending() was:
Loop up to 1,000 times around smsq_take_next_sms():
In smsq_take_next_sms(), loop up to 100 times around a DB query
where this query will get one SMS record:
We then allocate memory for the SMS, calling sqlite3_column_XXX()
on each column and also check if the destination addr is attached in
the VLR. If not, we discard (free) this SMS and continue the loop.
A problem with the above occurs when there are more than 100 SMS in the
database for subscribers that are not attached.
In this case smsq_take_next_sms() reaches the "sanity" limit of 100
iterations and returns NULL.
sms_submit_pending() consequently breaks out of its loop of 1000
iterations and no SMS is added to the pending (in-memory) queue.
However, other activity will very likely soon trigger sms_submit_pending()
again and we will repepat the above, pointlessly.
It appears that these 100 iterations over a sqlite3 SELECT + subsequent
sqlite3_column_XXXX() processing is causing osmo-msc to spend a significant
of time in libsqlite3.
So, rather than getting many SMS from the DB only to then discard them
as the subscriber is not attached, let's add a WHERE clause to the query in
order to only select SMS for attached subscribers.
This way we should never have more than one iteration in smsq_take_next_sms()
and we do not do any needless processing in libsqlite3 only to immediately
free() the result.
Change-Id: I06c418d4919dd8d28c643b7e0a735bc74d66212c
---
M include/osmocom/msc/db.h
M src/libmsc/db.c
M src/libmsc/sms_queue.c
M tests/sms_queue/sms_queue_test.c
M tests/sms_queue/sms_queue_test.ok
5 files changed, 66 insertions(+), 39 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-msc refs/changes/38/28338/1
diff --git a/include/osmocom/msc/db.h b/include/osmocom/msc/db.h
index fc1781b..a67c050 100644
--- a/include/osmocom/msc/db.h
+++ b/include/osmocom/msc/db.h
@@ -36,6 +36,7 @@
int db_fini(void);
/* SMS store-and-forward */
+int db_save_to_temp_vlr(char *msisdn);
int db_sms_store(struct gsm_sms *sms);
struct gsm_sms *db_sms_get(struct gsm_network *net, unsigned long long id);
struct gsm_sms *db_sms_get_next_unsent(struct gsm_network *net,
diff --git a/src/libmsc/db.c b/src/libmsc/db.c
index 07081d5..68cc038 100644
--- a/src/libmsc/db.c
+++ b/src/libmsc/db.c
@@ -46,6 +46,7 @@
enum stmt_idx {
DB_STMT_SMS_STORE,
DB_STMT_SMS_GET,
+ DB_STMT_SMS_GET_NEXT_UNSENT_RR_FOR_ATTACHED,
DB_STMT_SMS_GET_NEXT_UNSENT,
DB_STMT_SMS_GET_UNSENT_FOR_SUBSCR,
DB_STMT_SMS_GET_NEXT_UNSENT_RR_MSISDN,
@@ -56,6 +57,7 @@
DB_STMT_SMS_DEL_EXPIRED,
DB_STMT_SMS_GET_VALID_UNTIL_BY_ID,
DB_STMT_SMS_GET_OLDEST_EXPIRED,
+ DB_STMT_VLR_INSERT,
_NUM_DB_STMT
};
@@ -88,6 +90,7 @@
SCHEMA_RATE,
SCHEMA_AUTHKEY,
SCHEMA_AUTHLAST,
+ SCHEMA_TEMP_VLR,
};
static const char *create_stmts[] = {
@@ -203,6 +206,9 @@
"sres BLOB NOT NULL, "
"kc BLOB NOT NULL "
")",
+ [SCHEMA_TEMP_VLR] = "CREATE TEMPORARY TABLE IF NOT EXISTS t_vlr ("
+ "msisdn TEXT NOT NULL"
+ ")"
};
/***********************************************************************
@@ -270,6 +276,12 @@
"$msg_ref, $protocol_id, $data_coding_scheme, $ud_hdr_ind, $user_data, $text, "
"$dest_addr, $dest_ton, $dest_npi, $src_addr, $src_ton, $src_npi)",
[DB_STMT_SMS_GET] = "SELECT " SEL_COLUMNS " FROM SMS WHERE SMS.id = $id",
+ [DB_STMT_SMS_GET_NEXT_UNSENT_RR_FOR_ATTACHED] =
+ "SELECT " SEL_COLUMNS " FROM SMS "
+ "WHERE sent IS NULL "
+ "AND dest_addr in (SELECT msisdn FROM t_vlr WHERE msisdn > $dest_addr) "
+ " AND deliver_attempts <= $attempts"
+ " ORDER BY dest_addr, id LIMIT 1",
[DB_STMT_SMS_GET_NEXT_UNSENT] =
"SELECT " SEL_COLUMNS " FROM SMS"
" WHERE sent IS NULL"
@@ -306,6 +318,8 @@
"SELECT strftime('%s', valid_until) FROM SMS WHERE id = $id",
[DB_STMT_SMS_GET_OLDEST_EXPIRED] =
"SELECT id, strftime('%s', valid_until) FROM SMS ORDER BY valid_until LIMIT 1",
+ [DB_STMT_VLR_INSERT] =
+ "REPLACE INTO t_vlr (msisdn) VALUES ($msisdn)",
};
/***********************************************************************
@@ -568,6 +582,12 @@
sqlite3_free(err_msg);
/* non-fatal */
}
+ rc = sqlite3_exec(g_dbc->db, "PRAGMA temp_store=MEMORY;", 0, 0, &err_msg);
+ if (rc != SQLITE_OK) {
+ LOGP(DDB, LOGL_ERROR, "Unable to set TEMP_STORE: %s\n", err_msg);
+ sqlite3_free(err_msg);
+ /* non-fatal */
+ }
return 0;
}
@@ -648,6 +668,22 @@
return 0;
}
+/* Add a connected subscriber MSISDN to the temporary table */
+int db_save_to_temp_vlr(char *msisdn)
+{
+ OSMO_ASSERT(g_dbc);
+ sqlite3_stmt *stmt = g_dbc->stmt[DB_STMT_VLR_INSERT];
+ int rc;
+
+ db_bind_text(stmt, "$msisdn", (char *)msisdn);
+ rc = sqlite3_step(stmt);
+ db_remove_reset(stmt);
+ if (rc != SQLITE_DONE) {
+ LOGP(DDB, LOGL_ERROR, "Cannot add to VLR: SQL error: (%d) %s\n", rc, sqlite3_errmsg(g_dbc->db));
+ return -EIO;
+ }
+ return 0;
+}
/* store an [unsent] SMS to the database */
int db_sms_store(struct gsm_sms *sms)
{
@@ -858,7 +894,7 @@
int max_failed)
{
OSMO_ASSERT(g_dbc);
- sqlite3_stmt *stmt = g_dbc->stmt[DB_STMT_SMS_GET_NEXT_UNSENT_RR_MSISDN];
+ sqlite3_stmt *stmt = g_dbc->stmt[DB_STMT_SMS_GET_NEXT_UNSENT_RR_FOR_ATTACHED];
struct gsm_sms *sms;
int rc;
diff --git a/src/libmsc/sms_queue.c b/src/libmsc/sms_queue.c
index 9f18f4f..a1cc465 100644
--- a/src/libmsc/sms_queue.c
+++ b/src/libmsc/sms_queue.c
@@ -294,10 +294,26 @@
struct gsm_sms *sms;
int wrapped = 0;
int sanity = 100;
+ unsigned int count = 0;
char started_with_msisdn[last_msisdn_buflen];
+ struct vlr_subscr *vsub;
OSMO_STRLCPY_ARRAY(started_with_msisdn, last_msisdn);
+ if (net != NULL) { /* db_sms_test passes NULL, so we need to be tolerant */
+ llist_for_each_entry(vsub, &net->vlr->subscribers, list) {
+ if (vsub->msisdn[0] != '\0') {
+ count++;
+ DEBUGP(DLSMS, "SMS queue: %s is attached.\n", vsub->msisdn);
+ db_save_to_temp_vlr(vsub->msisdn);
+ }
+ }
+ if (count == 0) {
+ DEBUGP(DLSMS, "SMS queue: no subscribers attached.\n");
+ return NULL;
+ }
+ }
+
while (wrapped < 2 && (--sanity)) {
/* If we wrapped around and passed the first msisdn, we're
* through the entire SMS DB; end it. */
@@ -305,27 +321,16 @@
break;
sms = db_sms_get_next_unsent_rr_msisdn(net, last_msisdn, 9);
+
if (!sms) {
last_msisdn[0] = '\0';
wrapped++;
continue;
}
- /* Whatever happens, next time around service another recipient
- */
+ /* Whatever happens, next time around service another recipient */
osmo_strlcpy(last_msisdn, sms->dst.addr, last_msisdn_buflen);
- /* Is the subscriber attached? If not, go to next SMS */
- if (!sms->receiver || !sms->receiver->lu_complete) {
- LOGP(DLSMS, LOGL_DEBUG,
- "Subscriber %s%s is not attached, skipping SMS %llu\n",
- sms->receiver ? "" : "MSISDN-",
- sms->receiver ? vlr_subscr_msisdn_or_name(sms->receiver)
- : sms->dst.addr, sms->id);
- sms_free(sms);
- continue;
- }
-
return sms;
}
diff --git a/tests/sms_queue/sms_queue_test.c b/tests/sms_queue/sms_queue_test.c
index f681657..20c31eb 100644
--- a/tests/sms_queue/sms_queue_test.c
+++ b/tests/sms_queue/sms_queue_test.c
@@ -132,6 +132,10 @@
osmo_strlcpy(sms->text, fake_sms_db[i].msisdn, sizeof(sms->text));
if (fake_sms_db[i].vsub_attached)
fake_sms_db[i].nr_of_sms--;
+ if (!sms->receiver) {
+ sms_free(sms);
+ return NULL;
+ }
return sms;
}
diff --git a/tests/sms_queue/sms_queue_test.ok b/tests/sms_queue/sms_queue_test.ok
index 146400d..6ccc95f 100644
--- a/tests/sms_queue/sms_queue_test.ok
+++ b/tests/sms_queue/sms_queue_test.ok
@@ -12,21 +12,17 @@
hitting database: looking for MSISDN > '2222', failed_attempts <= 9
#1: sending SMS to 3333 (last_msisdn='3333')
hitting database: looking for MSISDN > '3333', failed_attempts <= 9
- hitting database: looking for MSISDN > '5555', failed_attempts <= 9
hitting database: looking for MSISDN > '', failed_attempts <= 9
#2: sending SMS to 2222 (last_msisdn='2222')
hitting database: looking for MSISDN > '2222', failed_attempts <= 9
#3: sending SMS to 3333 (last_msisdn='3333')
hitting database: looking for MSISDN > '3333', failed_attempts <= 9
- hitting database: looking for MSISDN > '5555', failed_attempts <= 9
hitting database: looking for MSISDN > '', failed_attempts <= 9
-#4: no SMS to send (last_msisdn='5555')
- hitting database: looking for MSISDN > '5555', failed_attempts <= 9
+#4: no SMS to send (last_msisdn='')
hitting database: looking for MSISDN > '', failed_attempts <= 9
-#5: no SMS to send (last_msisdn='5555')
- hitting database: looking for MSISDN > '5555', failed_attempts <= 9
+#5: no SMS to send (last_msisdn='')
hitting database: looking for MSISDN > '', failed_attempts <= 9
-#6: no SMS to send (last_msisdn='5555')
+#6: no SMS to send (last_msisdn='')
- SMS are pending at various nr failed attempts (cutoff at >= 10)
1111 has 1 SMS pending, 0 failed attempts
@@ -60,27 +56,12 @@
5555 (NOT attached) has 1 SMS pending, 0 failed attempts
-->
hitting database: looking for MSISDN > '2345', failed_attempts <= 9
- hitting database: looking for MSISDN > '3333', failed_attempts <= 9
- hitting database: looking for MSISDN > '4444', failed_attempts <= 9
- hitting database: looking for MSISDN > '5555', failed_attempts <= 9
hitting database: looking for MSISDN > '', failed_attempts <= 9
- hitting database: looking for MSISDN > '1111', failed_attempts <= 9
- hitting database: looking for MSISDN > '2222', failed_attempts <= 9
-#0: no SMS to send (last_msisdn='3333')
- hitting database: looking for MSISDN > '3333', failed_attempts <= 9
- hitting database: looking for MSISDN > '4444', failed_attempts <= 9
- hitting database: looking for MSISDN > '5555', failed_attempts <= 9
+#0: no SMS to send (last_msisdn='')
hitting database: looking for MSISDN > '', failed_attempts <= 9
- hitting database: looking for MSISDN > '1111', failed_attempts <= 9
- hitting database: looking for MSISDN > '2222', failed_attempts <= 9
-#1: no SMS to send (last_msisdn='3333')
- hitting database: looking for MSISDN > '3333', failed_attempts <= 9
- hitting database: looking for MSISDN > '4444', failed_attempts <= 9
- hitting database: looking for MSISDN > '5555', failed_attempts <= 9
+#1: no SMS to send (last_msisdn='')
hitting database: looking for MSISDN > '', failed_attempts <= 9
- hitting database: looking for MSISDN > '1111', failed_attempts <= 9
- hitting database: looking for MSISDN > '2222', failed_attempts <= 9
-#2: no SMS to send (last_msisdn='3333')
+#2: no SMS to send (last_msisdn='')
- there are no SMS in the DB
1111 has 0 SMS pending, 0 failed attempts
--
To view, visit https://gerrit.osmocom.org/c/osmo-msc/+/28338
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-Change-Id: I06c418d4919dd8d28c643b7e0a735bc74d66212c
Gerrit-Change-Number: 28338
Gerrit-PatchSet: 1
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-MessageType: newchange
Attention is currently required from: fixeria.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-bsc/+/28328
to look at the new patch set (#2).
Change subject: lchan_select: implement dynamic selection mode for assignment
......................................................................
lchan_select: implement dynamic selection mode for assignment
Change-Id: I1b7a0d706976b73cc5c30a8714b830811addfe8d
Related: SYS#5460
---
M include/osmocom/bsc/bts.h
M include/osmocom/bsc/lchan_select.h
M src/osmo-bsc/abis_rsl.c
M src/osmo-bsc/assignment_fsm.c
M src/osmo-bsc/bsc_vty.c
M src/osmo-bsc/bts.c
M src/osmo-bsc/bts_vty.c
M src/osmo-bsc/handover_decision_2.c
M src/osmo-bsc/handover_fsm.c
M src/osmo-bsc/lchan_select.c
M tests/osmo-bsc.vty
11 files changed, 263 insertions(+), 30 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/28/28328/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28328
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I1b7a0d706976b73cc5c30a8714b830811addfe8d
Gerrit-Change-Number: 28328
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: neels.
fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/28326 )
Change subject: lchan_select: prepare a list of timeslots once, iterate over it
......................................................................
Patch Set 1:
(1 comment)
File src/osmo-bsc/lchan_select.c:
https://gerrit.osmocom.org/c/osmo-bsc/+/28326/comment/3ff23657_d6febd73
PS1, Line 68: for (unsigned int tn = 0; tn < ts_list->num; tn++) {
I just realized that this patch also improves interference aware allocation mode (SYS#5313), because now we can pick an lchan with the least interference within the scope of all TRXes. Without this patch we're limited to the scope of a single TRX here. On the other hand, this improvement nullifies the meaning of ascending/descending modes...
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/28326
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I7ccc56856bfd40fd7c63b7437736de60c2b516ff
Gerrit-Change-Number: 28326
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 17 Jun 2022 22:18:13 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Attention is currently required from: laforge, pespin.
neels has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-upf/+/28244 )
Change subject: add pfcp_endpoint
......................................................................
Patch Set 4:
(1 comment)
File src/libosmo-pfcp/pfcp_endpoint.c:
https://gerrit.osmocom.org/c/osmo-upf/+/28244/comment/f38ce1a3_ac80ec72
PS4, Line 268: /* Slight optimization: Add sent requests to the start of the list: we will usually receive a response shortly
> I haven't done a deep review, but if there is no reason to have a shared path/queue for requests and […]
indeed. i have applied this in https://gerrit.osmocom.org/c/libosmo-pfcp/+/28337
--
To view, visit https://gerrit.osmocom.org/c/osmo-upf/+/28244
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-upf
Gerrit-Branch: master
Gerrit-Change-Id: Ic8d42e201b63064a71b40ca45a5a40e29941e8ac
Gerrit-Change-Number: 28244
Gerrit-PatchSet: 4
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Fri, 17 Jun 2022 21:57:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-pfcp/+/28337 )
Change subject: separate pfcp_queue_timer_cb() in req and resp
......................................................................
separate pfcp_queue_timer_cb() in req and resp
Having separate callbacks for request and response messages makes for
an easier read. No functional change.
This applies code review from
https://gerrit.osmocom.org/c/osmo-upf/+/28244
Ic8d42e201b63064a71b40ca45a5a40e29941e8ac (osmo-upf.git)
Related: SYS#5599
Change-Id: Ic8ab71f5efd4cf669689a0b075f9a52ce66bdd5d
---
M src/libosmo-pfcp/pfcp_endpoint.c
1 file changed, 30 insertions(+), 17 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-pfcp refs/changes/37/28337/1
diff --git a/src/libosmo-pfcp/pfcp_endpoint.c b/src/libosmo-pfcp/pfcp_endpoint.c
index 83b7c1a..e58cc1d 100644
--- a/src/libosmo-pfcp/pfcp_endpoint.c
+++ b/src/libosmo-pfcp/pfcp_endpoint.c
@@ -171,27 +171,38 @@
return true;
}
-/* T1 for a given queue entry has expired */
-static void pfcp_queue_timer_cb(void *data)
+/* T1 for a given sent_requests queue entry has expired */
+static void pfcp_queue_sent_req_timer_cb(void *data)
{
struct osmo_pfcp_queue_entry *qe = data;
bool keep;
- if (qe->m->is_response) {
- /* The response has waited in the queue for any retransmissions of its initiating request. Now that time
- * has passed and the response can be dropped from the queue. */
- keep = false;
- } else {
- /* The request is still here, which means it has not received a response from the remote side.
- * Retransmit the request. */
- keep = pfcp_queue_retrans(qe);
- }
+ /* qe->m is a request sent earlier */
+ OSMO_ASSERT(!qe->m->is_response);
+ /* The request is still here, which means it has not received a response from the remote side.
+ * Retransmit the request. */
+ keep = pfcp_queue_retrans(qe);
if (keep)
return;
+
+ /* Retransmission has elapsed. Notify resp_cb that receiving a response has failed. */
+ if (qe->m->ctx.resp_cb)
+ qe->m->ctx.resp_cb(qe->m, NULL, "PFCP request retransmissions elapsed, no response received");
/* Drop the queue entry. No more retransmissions. */
- if (!qe->m->is_response && qe->m->ctx.resp_cb)
- qe->m->ctx.resp_cb(qe->m, NULL, "PFCP retransmissions elapsed, no response received");
+ osmo_pfcp_queue_del(qe);
+}
+
+/* T1 for a given sent_responses queue entry has expired */
+static void pfcp_queue_sent_resp_timer_cb(void *data)
+{
+ struct osmo_pfcp_queue_entry *qe = data;
+
+ /* qe->m is a response sent earlier */
+ OSMO_ASSERT(qe->m->is_response);
+
+ /* The response has waited in the queue for any retransmissions of its initiating request. Now that time
+ * has passed and the response can be dropped from the queue. */
osmo_pfcp_queue_del(qe);
}
@@ -268,13 +279,15 @@
/* Slight optimization: Add sent requests to the start of the list: we will usually receive a response shortly
* after sending a request, removing that entry from the queue quickly.
* Add sent responses to the end of the list: they will rarely be retransmitted at all. */
- if (m->is_response)
+ if (m->is_response) {
llist_add_tail(&qe->entry, &endpoint->sent_responses);
- else
- llist_add_tail(&qe->entry, &endpoint->sent_requests);
+ osmo_timer_setup(&qe->t1, pfcp_queue_sent_resp_timer_cb, qe);
+ } else {
+ llist_add(&qe->entry, &endpoint->sent_requests);
+ osmo_timer_setup(&qe->t1, pfcp_queue_sent_req_timer_cb, qe);
+ }
talloc_set_destructor(qe, osmo_pfcp_queue_destructor);
- osmo_timer_setup(&qe->t1, pfcp_queue_timer_cb, qe);
osmo_timer_schedule(&qe->t1, timeout/1000, timeout%1000);
return 0;
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-pfcp/+/28337
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-pfcp
Gerrit-Branch: master
Gerrit-Change-Id: Ic8ab71f5efd4cf669689a0b075f9a52ce66bdd5d
Gerrit-Change-Number: 28337
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr(a)sysmocom.de>
Gerrit-MessageType: newchange
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/28335 )
Change subject: update git URLs (git -> https; gitea)
......................................................................
update git URLs (git -> https; gitea)
Change-Id: Idac4924a077b5389e85efaf62081589fc3de06ad
---
M README.md
M configure.ac
M contrib/test/test-m3ua.sh
M contrib/test/test-sua.sh
M debian/control
5 files changed, 7 insertions(+), 8 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/35/28335/1
diff --git a/README.md b/README.md
index 98b3591..2ec30c8 100644
--- a/README.md
+++ b/README.md
@@ -20,10 +20,9 @@
You can clone from the official git repository using
- git clone git://git.osmocom.org/libosmo-sccp.git
- git clone https://git.osmocom.org/libosmo-sccp.git
+ git clone https://gitea.osmocom.org/osmocom/libosmo-sccp
-There is a cgit interface at https://git.osmocom.org/libosmo-sccp/
+There is a web interface at <https://gitea.osmocom.org/osmocom/libosmo-sccp>
Documentation
-------------
diff --git a/configure.ac b/configure.ac
index 4367b8a..92325d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -170,7 +170,7 @@
AM_PATH_PYTHON
AC_CHECK_PROG(OSMOTESTEXT_CHECK,osmo_verify_transcript_vty.py,yes)
if test "x$OSMOTESTEXT_CHECK" != "xyes" ; then
- AC_MSG_ERROR([Please install git://osmocom.org/python/osmo-python-tests to run the VTY/CTRL tests.])
+ AC_MSG_ERROR([Please install https://gitea.osmocom.org/cellular-infrastructure/osmo-python-tests to run the VTY/CTRL tests.])
fi
fi
AC_MSG_CHECKING([whether to enable VTY/CTRL tests])
diff --git a/contrib/test/test-m3ua.sh b/contrib/test/test-m3ua.sh
index 0f81fe8..927f514 100755
--- a/contrib/test/test-m3ua.sh
+++ b/contrib/test/test-m3ua.sh
@@ -3,7 +3,7 @@
# this script executes m3ua-testtool against osmo-stp. It assumes that
# it is called from within libosmo-sccp/contrib/test and also assumes
# that adjacent to the libosmo-sccp, there's a check-out of
-# git://git.osmocom.org/nplab/m3ua-testtool
+# https://gitea.osmocom.org/nplab/m3ua-testtool
# the top of the libosmo-sccp git repository
TOPDIR=../../
diff --git a/contrib/test/test-sua.sh b/contrib/test/test-sua.sh
index 0cb4e35..9f97f43 100755
--- a/contrib/test/test-sua.sh
+++ b/contrib/test/test-sua.sh
@@ -3,7 +3,7 @@
# this script executes m3ua-testtool against osmo-stp. It assumes that
# it is called from within libosmo-sccp/contrib/test and also assumes
# that adjacent to the libosmo-sccp, there's a check-out of
-# git://git.osmocom.org/nplab/m3ua-testtool
+# https://gitea.osmocom.org/nplab/sua-testtool
# the top of the libosmo-sccp git repository
TOPDIR=../../
diff --git a/debian/control b/debian/control
index 7955055..5885de9 100644
--- a/debian/control
+++ b/debian/control
@@ -17,8 +17,8 @@
libsctp-dev,
osmo-gsm-manuals-dev (>= 1.1.0)
Standards-Version: 3.9.7
-Vcs-Git: git://git.osmocom.org/libosmo-sccp.git
-Vcs-Browser: http://git.osmocom.org/libosmo-sccp/
+Vcs-Git: https://gitea.osmocom.org/osmocom/libosmo-sccp
+Vcs-Browser: https://gitea.osmocom.org/osmocom/libosmo-sccp
Homepage: https://projects.osmocom.org/projects/libosmo-sccp
Package: libosmo-sccp-dev
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/28335
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Idac4924a077b5389e85efaf62081589fc3de06ad
Gerrit-Change-Number: 28335
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newchange