Change in osmo-bts[master]: osmo-bts-trx: refactor handling of version specific TRXD parts

fixeria gerrit-no-reply at
Wed Apr 21 15:14:30 UTC 2021

fixeria has posted comments on this change. ( )

Change subject: osmo-bts-trx: refactor handling of version specific TRXD parts

Patch Set 3:

File src/osmo-bts-trx/trx_if.c: 
PS3, Line 785: 		bi->mod = TRX_MOD_T_GMSK;
> shouldn't this be 8PSK sometimes?
It should definitely be 8-PSK here, thanks! 
PS3, Line 810: 	buf_len -= TRX_UL_V0HDR_LEN;
> buf_len is not used here, so let's drop this unused op which is run for each TRXD packet.
PS3, Line 905: } trx_data_codec[16] = {
> why is this size=16?
It's basically the maximum number of versions we can have. If we somehow negotiate a non-existing version, we will not run into buffer overflow. But I think instead of checking if 'trx_data_codec[pdu_ver].parse != NULL' below we can also do 'pdu_ver < ARRAY_SIZE(trx_data_codec)'. 
PS3, Line 959: 	hdr_len = trx_data_codec[pdu_ver].parse(l1h->phy_inst, &bi, buf, buf_len);
> fyi, func pointer call is SLOW, not sure it's the best idea to use them here which are called a lot, […]
Wow, I thought it's the opposite. After checking the assembly of the current code I found out that gcc does not inline functions (even with -O2) and does not optimize the 'switch(pdu_ver)' statement as I would expect. We end up with CMP and CALL instructions for each TRXD PDU version. Maybe I should just mark the version specific parsers with 'inline' instead.

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Change-Id: I7aedd85a8d4f6d6191cd3b75272a688208fb2879
Gerrit-Change-Number: 23832
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria <vyanitskiy at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin at>
Gerrit-Comment-Date: Wed, 21 Apr 2021 15:14:30 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin at>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list