Change in osmo-bts[master]: cbch: Improve verbosity and extend logging; Always indicate BASIC/EXT...

2019-05-22 Thread Harald Welte
Hello osmith, Jenkins Builder,

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

https://gerrit.osmocom.org/14117

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

Change subject: cbch: Improve verbosity and extend logging; Always indicate 
BASIC/EXTD CBCH
..

cbch: Improve verbosity and extend logging; Always indicate BASIC/EXTD CBCH

Change-Id: I6c8f9fc6215b616371e46c1f4ca4e44b8c7ac096
---
M src/common/cbch.c
1 file changed, 35 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/17/14117/3
--
To view, visit https://gerrit.osmocom.org/14117
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6c8f9fc6215b616371e46c1f4ca4e44b8c7ac096
Gerrit-Change-Number: 14117
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith 


Change in osmo-bts[master]: cbch: Improve verbosity and extend logging; Always indicate BASIC/EXT...

2019-05-22 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/14117 )

Change subject: cbch: Improve verbosity and extend logging; Always indicate 
BASIC/EXTD CBCH
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/14117
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6c8f9fc6215b616371e46c1f4ca4e44b8c7ac096
Gerrit-Change-Number: 14117
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Wed, 22 May 2019 12:52:41 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: cbch: Improve verbosity and extend logging; Always indicate BASIC/EXT...

2019-05-23 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/14117 )

Change subject: cbch: Improve verbosity and extend logging; Always indicate 
BASIC/EXTD CBCH
..

cbch: Improve verbosity and extend logging; Always indicate BASIC/EXTD CBCH

Change-Id: I6c8f9fc6215b616371e46c1f4ca4e44b8c7ac096
---
M src/common/cbch.c
1 file changed, 35 insertions(+), 19 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/common/cbch.c b/src/common/cbch.c
index 6b65679..7ed11c2 100644
--- a/src/common/cbch.c
+++ b/src/common/cbch.c
@@ -71,6 +71,14 @@
OSMO_ASSERT(0);
 }

+static const char *tb_to_chan_str(uint8_t tb)
+{
+   if (tb < 4)
+   return "CBCH-BASIC";
+   else
+   return "CBCH-EXTENDED";
+}
+
 /* construct a SMSCB NULL block in the user-provided output buffer at 'out' */
 static int get_smscb_null_block(uint8_t *out)
 {
@@ -86,24 +94,26 @@
 }

 /* get the next block of the current CB message */
-static int get_smscb_block(struct bts_smscb_state *bts_ss, uint8_t *out, 
uint8_t block_nr,
+static int get_smscb_block(struct bts_smscb_state *bts_ss, uint8_t *out, 
uint8_t tb,
   const struct gsm_time *g_time)
 {
int to_copy;
struct gsm412_block_type *block_type;
struct smscb_msg *msg = bts_ss->cur_msg;
+   uint8_t block_nr = tb % 4;
+   const char *chan_name = tb_to_chan_str(tb);

if (!msg) {
/* No message: Send NULL block */
-   DEBUGPGT(DLSMS, g_time, "No cur_msg; requesting NULL block\n");
+   DEBUGPGT(DLSMS, g_time, "%s: No cur_msg; requesting NULL 
block\n", chan_name);
return get_smscb_null_block(out);
}
OSMO_ASSERT(block_nr < 4);

if (block_nr >= msg->num_segs) {
/* Higher block number than this message has blocks: Send NULL 
block */
-   DEBUGPGT(DLSMS, g_time, "cur_msg has only %u blocks; requesting 
NULL block\n",
-msg->num_segs);
+   DEBUGPGT(DLSMS, g_time, "%s: cur_msg has only %u blocks; 
requesting NULL block\n",
+chan_name, msg->num_segs);
return get_smscb_null_block(out);
}

@@ -136,12 +146,14 @@

if (block_nr == 4) {
if (msg != bts_ss->default_msg) {
-   DEBUGPGT(DLSMS, g_time, "deleting fully-transmitted 
message %p\n", msg);
+   DEBUGPGT(DLSMS, g_time, "%s: deleting fully-transmitted 
message %p\n",
+chan_name, msg);
/* delete any fully-transmitted normal message (or 
superseded default) */
talloc_free(bts_ss->cur_msg);
bts_ss->cur_msg = NULL;
} else {
-   DEBUGPGT(DLSMS, g_time, "keeping fully-transmitted 
default message %p\n", msg);
+   DEBUGPGT(DLSMS, g_time, "%s: keeping fully-transmitted 
default message %p\n",
+chan_name, msg);
}
}

@@ -170,16 +182,19 @@
 {
struct smscb_msg *scm;
struct bts_smscb_state *bts_ss;
+   const char *chan_name;

-   if (extended_cbch)
+   if (extended_cbch) {
+   chan_name = tb_to_chan_str(4);
bts_ss = &bts->smscb_extended;
-   else
+   } else {
+   chan_name = tb_to_chan_str(0);
bts_ss = &bts->smscb_basic;
+   }

if (msg_len > sizeof(scm->msg)) {
-   LOGP(DLSMS, LOGL_ERROR,
-"Cannot process SMSCB of %u bytes (max %zu)\n",
-msg_len, sizeof(scm->msg));
+   LOGP(DLSMS, LOGL_ERROR, "%s: Cannot process SMSCB of %u bytes 
(max %zu)\n",
+chan_name, msg_len, sizeof(scm->msg));
return -EINVAL;
}

@@ -197,8 +212,7 @@
memcpy(scm->msg, msg, msg_len);

LOGP(DLSMS, LOGL_INFO, "RSL SMSCB COMMAND (chan=%s, type=%s, 
num_blocks=%u)\n",
-   extended_cbch ? "EXTENDED" : "BASIC",
-   get_value_string(rsl_cb_cmd_names, cmd_type.command), 
scm->num_segs);
+   chan_name, get_value_string(rsl_cb_cmd_names, 
cmd_type.command), scm->num_segs);

switch (cmd_type.command) {
case RSL_CB_CMD_TYPE_NORMAL:
@@ -207,6 +221,8 @@
/* def_bcast is ignored as per Section 9.3.41 of 3GPP TS 48.058 
*/
/* limit queue size and optionally send CBCH LOAD Information 
(overflow) via RSL */
if (bts_ss->queue_len >= bts->smscb_queue_max_len) {
+   LOGP(DLSMS, LOGL_NOTICE, "RSL SMSCB COMMAND (chan=%s, 
type=%s): OVERFLOW\n",
+chan_name, get_value_string(rsl_cb

Change in osmo-bts[master]: cbch: Improve verbosity and extend logging; Always indicate BASIC/EXT...

2019-05-23 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/14117 )

Change subject: cbch: Improve verbosity and extend logging; Always indicate 
BASIC/EXTD CBCH
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/14117
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6c8f9fc6215b616371e46c1f4ca4e44b8c7ac096
Gerrit-Change-Number: 14117
Gerrit-PatchSet: 3
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Thu, 23 May 2019 19:16:10 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes