Commit Graph

1033 Commits

Author SHA1 Message Date
Harald Welte 5d93f0f4ec Fix GSMTAP logging in case direct PHY access is enabled
In the existing code, GSMTAP messages were only generated in case no
direct PHY access was being used (i.e. in the case all user traffic goes
over the PCU socket).  I'm not quite sure what the reason is for that
would be and conclud this is not intentional.

Let's first send the message to GSMTAP and then decide whether to send
it via the direct PHY access or via the PCU socket into the BTS/BSC.

Change-Id: I5d2e018f7009cb947abc874881c0c440feca3ade
2016-11-17 21:09:55 +01:00
Harald Welte bb47d957a8 pcu_l1_if: get rid of magic numbers and use ARRAY_SIZE() for array iteration
Change-Id: I61d00950b4eb0b8bcbaf386d5081be84580dac75
2016-11-17 21:09:55 +01:00
Mrinal Mishra f86307e1e4 Add BTS level counters
Adds counters for MCS blocks, 11 bit Rach counters and others.

Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a
2016-11-14 01:15:16 +00:00
aravind sirsikar ed3413e397 Handle packet access reject during EPDAN/PDAN with channel description
When PDAN/EPDAN with channel description is received, PCU will generate the
packet access reject if no resources are present. The encoding is done
based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7.
This patch also includes the test case to validate the generated
packet access reject message.

This patch is integration tested on Osmo-trx setup with Ettus B210 board
and LG F70 MS with some simulation code changes in Osmo-pcu.

Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6
2016-11-11 17:15:10 +05:30
aravind sirsikar c0c3afd079 Handle Immediate assignment reject
When RACH is received, PCU will generate the Immediate assignment reject
message if no resources are present. The encoding is done based on section
9.1.20 of 44.018 version 11.7.0 Release 11. This patch also includes the
test case to validate the generated Immediate assignment reject message.

This patch is integration tested on Osmo-trx setup with Ettus B210 board
and LG F70 MS with some simulation code changes in Osmo-pcu.

Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b
2016-11-09 16:27:00 +05:30
Max ae4838101a Handle Timing Advance IE properly
Move writing Timing Advance IE and Timing Advance Index into separate
functions to simplify adding PTCCH support. This also fixes previous
incorrect (and unused) code for writing Packet TA IE which has not set
TS for TA.

Change-Id: I786bf7fc999d401cc3d9e7f1e7a1fba953b5d458
Related: OS#1545
2016-11-09 09:30:49 +00:00
aravind sirsikar fb41afaaf6 EGPRS: fix for EPDAN out of window
Fix alignment of EPDAN outside the RLC transmit window,
according to section 9.1.8.2.4 in 44.060 version 7.27.0 Release 7.
The specification explains that a bit within the uncompressed bitmap
whose corresponding BSN is not within the transmit window shall be
ignored. Without this fix PCU was dropping the EPDAN message and not
updating the status of BSNs which are inside the RLC window. This patch
updates the status of the BSNs which are inside the window and ignores
the remaining bits.

Related: OS#1789

Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6
2016-11-02 15:48:00 +05:30
aravind sirsikar 9434e52af9 Modify return type of gprs_rlc_dl_window::distance to uint16_t
Since there is a "&mod_sns()" present in this function, the outcome
is always unsigned.

Change-Id: I66f3db4dc27a6cbef146c832bf8b43f1492358a4
2016-11-02 15:43:10 +05:30
aravind sirsikar f276138202 EGPRS: add test case to show EPDAN BSN out of window bug
This patch adds a test case test_tbf_epdan_out_of_rx_window,
which expects a current bug with EPDAN for interpretation of the
bitmap explained in section 9.1.8.2.4 in 44.060 version 7.27.0
Release 7. The specification explains that a bit within the
uncompressed bitmap whose corresponding BSN is not within the
transmit window shall be ignored. But current PCU implementation
drops the EPDAN and does not update status of the BSN which are
inside the window. The test's expectation is corrected along with
the bug fix in a subsequent commit.

Related: OS#1789

Change-Id: If32b67f5c05707155281128b776a90a1e3d587b2
2016-10-30 03:15:22 +00:00
Mrinal Mishra d453eaa788 Add logging support
This commit adds the TRX_ID in the output of VTY command "show tbf all".

Change-Id: Ia5412dddb899e20963f884e02bdf796b6ea7ee6c
2016-10-26 15:41:56 +05:30
Neels Hofmeyr f868bdbe76 jenkins.sh: use osmo-build-dep.sh, output testlogs
Also make cosmetically similar to the other jenkins.sh scripts in various osmo
repositories.

Change-Id: I34c19ed7c80aa56bd131f738f37324aed1cd73db
2016-10-20 11:42:03 +00:00
Max d71e8b32e3 Use qbit-TA to update Timing Advance
Separate qbit-TA to TA conversion into separate function and use it for
computing and updating Timing Advance.

Note: the code was tested with TA=0 only to make sure it does not
introduce regressions.

Change-Id: I96fdbb20b09fb85fdd9fb6dcf3c25f6bee7f80e4
Fixes: OS#1531
2016-10-19 08:23:29 +00:00
Neels Hofmeyr 4ea452689d Revert "tbf: Add state WAIT_ASSIGN"
This reverts commit f1a7b8fc66.

Conflicts:
	tests/tbf/TbfTest.err

The commit broke GPRS service at least for osmo-bts-sysmo on a SysmoBTS 1002
with current master of osmo-bts (ef30f50d5d6d5f863fc147d05ccdceb89284934e).

The error observed is the following log output (was viewing both osmo-bts-sysmo
and osmo-pcu logs interleaved):

<0002> tbf.cpp:874 TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=WAIT ASSIGN) T3169 timeout during transsmission
<0002> tbf.cpp:893 - Assignment was on CCCH
<0002> tbf.cpp:899 - No uplink data received yet
<0007> l1sap.c:904 RACH for packet access
<0001> pcu_l1_if.cpp:311 RACH request received: sapi=1 qta=0, ra=121, fn=13653
[repeat]

When removing this single commit from current osmo-pcu master, GPRS service
works well on SysmoBTS, with current osmo-bts master.

The TbfTest.err expected output needed adjustment after the revert.

Disclaimer: I am not aware of adverse effects this commit may have. I have no
idea what the WAIT_ASSIGN state is used for -- further review is required.

Change-Id: I1532f8e93194368cdc1e3846f82afa6d68cd5fbd
2016-10-18 14:48:36 +02:00
Alexander Couzens e4727a3591 llc: remove NULL-pointer check of gprs_llc_queue::size()/octets()
All callers now check the pointer before calling it.
gcc6 is optimizing `if (!this) {CODE}` as this is assumed to never be a
std::nullptr here.

Change-Id: I918a094e0dc59098a9eb00d152c9ae42d36b3a99
2016-10-18 11:51:02 +02:00
Alexander Couzens d38b92e972 tbf: add llc_queue_size() to check llc_queue is valid before calling size()
gcc6 is optimizing if (!this) {CODE} as this is assumed to never be a
std::nullptr here. Move the null check to the caller. In preparation of
removing the check within llc_queue->size(), all callers must check the object
before calling it. Make sure of that: make the llc_queue() access function
protected and offer only a public llc_queue_size() function that incorporates
the NULL check. All current callers are only interested in the
llc_queue_size().

Tweaked-by: nhofmeyr
Change-Id: I88cc3180f8f86785e3f07981895dabddf50b60a2
2016-10-18 09:49:57 +00:00
Pravin Kumarvel 0a4a6c1200 EGPRS: Add EPDAN CRBB Tree based decoding
Implemented tree based algorithm to decode compressed bitmap in EPDAN
as described in section 9.1.10 of 3GPP 44.060.
This algorithm intends to improve the performance over existing method.
New Regression test is added under bitcomp directory.
Test case is added to validate decompressed result of the bitmap
Present in EPDAN.
Test is done for multiple bitmaps of varying length.
Invalid inputs are also part of the test vector.

Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce
2016-10-17 11:00:57 +05:30
Neels Hofmeyr 6348aea6a2 build: add -Wall
I noticed that unused variables are not complained about by the build. Let's
add -Wall.

I also noticed that the Makefile.ams include STD_DEFINES_AND_INCLUDES, which is
never set in configure.ac, so using that to add -Wall to all build contexts.

Change-Id: I16711cf5a1ef8bd611074b3dd486ed7a0ae9df64
2016-10-03 10:02:17 +00:00
Neels Hofmeyr da66f71ffe configure: check for pkg-config presence
Change-Id: Iaaeb2a926fc3832793dfb3f02e4ced2500950997
2016-10-01 01:06:19 +02:00
Neels Hofmeyr da933e0ff8 build: be robust against install-sh files above the root dir
Explicitly set AC_CONFIG_AUX_DIR.

To reproduce the error avoided by this patch:

  rm install-sh        # in case it was already generated.
  touch ../install-sh  # yes, outside this source tree
  autoreconf -fi

This will produce an error like

  ...
  configure.ac:16: error: required file '../ltmain.sh' not found
  configure.ac:5: installing '../missing'
  src/Makefile.am: installing '../depcomp'
  autoreconf: automake failed with exit status: 1

See also automake (vim `which automake`) and look for 'sub locate_aux_dir'.

Change-Id: Ie9a10f14c5e8c5e9b6ea4910b4b9abb7e70f5e04
2016-10-01 01:06:19 +02:00
Neels Hofmeyr fd9e16ce97 heed VTY 'line vty'/'bind' command
Like most other osmo-* programs, bind the telnet VTY to the address specified
by the 'line vty'/'bind' command. This is added by vty_init(), so until now the
PCU offered this config but ignored it.

Change-Id: I4cca05a212ec0d493b906014dc3a83e687ebbb1d
2016-09-22 07:06:41 +02:00
bhargava 465f5bbb6f Update the function immediate assignment for EGPRS
Encode the EGPRS fields of immediate assignment message in uplink
when EGPRS PACKET CHANNEL REQUEST (11 bit RACH) is received.
The series of patches for 11 bit RACH are dependent on libosmocore
and osmo-bts patches for 11 bit RACH.

Change-Id: Ie5e309156e5dbbb6add74a1b4d257c4ee2332e52
2016-09-16 05:55:41 +00:00
bhargava 628dcfbc97 Handle EGPRS 11 bit RACH in osmo-pcu
A function is_single_block is added to get request type of RACH.
EGPRS 11 bit RACH is handled.

Change-Id: I61d74a32f7764644ed86f7fdf97fa3c2f61503f7
2016-09-16 05:54:15 +00:00
Aravind Sirsikar 0ee31cfa38 Fix EGPRS DL window calculation during tbf update
Earlier there was no handling for recalculation of DL window
size during tbf update. Which has been fixed in this patch.

Related: OS#1808
Change-Id: I41aa807068520460fd665a55e3529e60f6bbb630
2016-09-15 17:54:46 +05:30
Aravind Sirsikar 8e70bb5bb4 tbf_dl: factor out EGPRS DL window size calculation
A subsequent patch needs to call this from gprs_rlcmac_tbf::update(),
so to avoid code dup, put the calculation in a separate function.

Related: OS#1808

Change-Id: I7c7777d43f843bbd3421503fc2a8600f148ca035
2016-09-15 17:51:16 +05:30
Aravind Sirsikar 22a901905c EGPRS: Fix issue with row 4 of Table 10.4.14a.1 of 44.060 version 7.27.0 Release 7
row 4 of Table 10.4.14a.1 of Spec 44.060 version 7.27.0 Release 7. Says
"The previous RLC data block contains a Upper Layer PDU, or a part of it,
that fills precisely the previous data block and for which there is no
length indicator in that RLC data block.
The current RLC data block contains a Upper Layer PDU that either fills
the current RLC data block precisely or continues in the next RLC data block."
So when we receive block with 1st LI: value=0 and Value of E bit in the
same octet as 1, we expect 2 chunks with 1st chunk as length as 0 and complete
and 2nd chunk as length non zero. But with this bug we see only 1 chunk causing
incorrect assembling

This issue has been fixed in this patch.

Related: OS#1811

Change-Id: I2cd0fca3ed28a553ede3f4b8a7d3267284dd2c9b
2016-09-15 17:24:49 +05:30
Aravind Sirsikar 3463bd4adc EGPRS: add test case to show LI decoding bug
This patch adds a test case test_tbf_li_decoding which
expects a current bug with LI decoding for row 4 of Table 10.4.14a.1
in 44.060 version 7.27.0 Release 7.
The test's expectation is corrected along with the bug
fix in a subsequent commit

Related: OS#1811

Change-Id: Ida410dab1aa4b0cf3e15b2090586377eb19b2469
2016-09-15 17:19:54 +05:30
Aravind Sirsikar e26ee01d56 DL TS allocation: add test case to show TS allocation bug for 2nd DL TBF
This patch adds a test case test_2_consecutive_dl_tbfs which
expects a current bug with TS allocation for 2nd DL TBF.
The test's expectation is corrected along with the bug fix in a
subsequent commit

Related: OS#1792

Change-Id: I890e4fbb2b64037e051433e70082a197e2a929a6
2016-09-14 11:55:32 +00:00
Neels Hofmeyr 0241526836 Fix CSN1 decoding: CSN_LEFT_ALIGNED_VAR_BMP bounds
Fix attempted read past vector boundaries in case of a starting bit offset !=
0, so that the last amount of bits read should be < 8. In the case of
CSN_LEFT_ALIGNED_VAR_BMP, the mod-8 calculation was flawed, and in the final
step, 8 bits were read instead of the remainder < 8. This lead to -EINVAL being
returned by bitvec_get_bit_pos() and bogus resulting data.

Instead, read 8 bits only as long as at least 8 bits remain, and read any
remaining bits < 8 in a final step. Drop unneeded nB1 variable and an obvious
comment.

Adjust the unit test assertion in testCsnLeftAlignedVarBmpBounds() in
RLCMACTest.cpp.

Based on a fix by Aravind Sirsikar <Arvind.Sirsikar@radisys.com>, but
implemented differently.

Related: OS#1805
Change-Id: I490498c8da6b531f54acb673379379f7b10907c0
2016-09-14 01:26:34 +00:00
Aravind Sirsikar 9f5f008aed CSN1 decoding: add test to show bug in CSN_LEFT_ALIGNED_VAR_BMP
CSN1 decoding currently contains an attempted read past vector boundaries in
case of a starting bit offset != 0, so that the last amount of bits read should
be < 8. In the case of CSN_LEFT_ALIGNED_VAR_BMP, the mod-8 calculation is
flawed, and in what should be the final step of reading n < 8 bits, 8 bits are
read instead of n (with an extraneous read of n bits following after that).
This leads to -EINVAL being returned by bitvec_get_bit_pos() and bogus
resulting data.

Add testCsnLeftAlignedVarBmpBounds() in RLCMACTest.cpp to show and expect this
bug. The test's expectation shall be corrected along with the bug fix in a
subsequent commit.

Related: OS#1805
Tweaked-by: Neels Hofmeyr <nhofmeyr@sysmocom.de>
Change-Id: I4641f5d1d49f66cb1a5cd813befb3a2a266001b0
2016-09-14 01:26:33 +00:00
Aravind Sirsikar 8d2d9e8985 TBF flow: unit test compilation error fix
The test failure was introduced by 9bbe1600cc
"Fix Timing Advance handling": between patch build checking and patch
submission, a new section was added to TbfTest.cpp which also needs adjustment.

Tweaked-by: Neels Hofmeyr <nhofmeyr@sysmocom.de>
Change-Id: If077da5f21fd5cba54556f1dead05a1bc4ea5540
2016-09-12 15:16:38 +02:00
Max 9bbe1600cc Fix Timing Advance handling
* initialize with invalid TA instead of making assumption that phone is
  located within 550 meters (TA=0)
* only set valid TA

Change-Id: Idfc40ff0c11bdac13d9e28fbfa4e95dfc6b735b0
Related: OS#1526
2016-09-09 06:37:04 +00:00
Minh-Quang Nguyen 16ddc90eab LC15: Change TRX numbering for the latest Litecell15 hardware
Change-Id: If3c4aff0366587dd3e5baa3d15b9e91d8ebe7753
2016-09-06 10:27:11 -04:00
Aravind Sirsikar 7c7a86c080 Fix GPRS PUAN encoding: wrong BSN status
Earlier there was an incorrect encoding of BSN status in GPRS PUAN message.
This was a bottle neck for GPRS performance testing for UL. Which has been fixed
in this patch.

Related: OS#1806

Change-Id: I98e586aa5cb9200cf03e092556304211d4d459aa
2016-09-02 06:47:09 +00:00
Aravind Sirsikar a35c911a91 GPRS: PUAN encoding: add test case to show wrong BSNs status
This patch adds a test case which expects a current bug with
GPRS PUAN encoding. The test's expectation
is corrected along with the bug fix in a subsequent commit

Related: OS#1806

Change-Id: Ied0f1dd3037d8fac6a772f4e097defb72634f955
2016-09-02 06:45:32 +00:00
Aravind Sirsikar 3c2eaebd21 DL: add test case to show wrong window size
This patch adds a test case test_tbf_update_ws. Which expects a
current bug with DL window size calculation. The test's expectation
is corrected along with the bug fix in a subsequent commit

Related: OS#1808

Change-Id: I4659494c6f93ae89e4cc4ac79fff5fcaf2d23699
2016-08-30 15:40:19 +05:30
Aravind Sirsikar fd71384104 TBF flow: unit test compilation error fix
Change-Id: I89638ba908e7d9964a5525061ce0cf26049be438
2016-08-28 17:55:05 +05:30
Aravind Sirsikar b119198992 TBF flow: Coverity fix
Related: CID#1361925, CID:#1361924

Change-Id: Ib1f71a8940eed7ad74211092275dfa29aa353fc7
2016-08-28 11:55:01 +00:00
Neels Hofmeyr 01826c13b1 vty: use OSMO_VTY_PORT_PCU instead of number
Include vty/ports.h and use the proper constant.

Change-Id: I9c5b7683f76994c539da5551f40df32379dc685e
2016-08-27 02:19:48 +00:00
bhargava 959d1dee67 Change interface in osmo-pcu for 11 bit RACH
Interface structure between osmo-bts and osmo-pcu is updated with
the parameters to differentiate the type of RACH and further
support 11 bit RACH. The function prototype and definitions are
changed accordingly. Interface version number is increased.

Change-Id: I265c2d92d36d6cbcbeee60cdd8407dafe1da06a4
2016-08-27 01:22:48 +00:00
Aravind Sirsikar eebcb1e3e8 Fix EGPRS PUAN encoding: use correct urbb_len
Earlier there was an incorrect encoding of PUAN when VQ is not equal
VR case for EGPRS UL RLC window. The PCU was encoding the same PUAN
message always irrespective of radio condition. This was a bottle neck
for performance testing. Which has been fixed in this patch.

Related: OS#1793

unit test assertion in the previous commit is fixed in this patch.

Change-Id: Iba7b1995028bd81749ffb080616b2ad5f2540d57
2016-08-25 16:40:23 +05:30
Aravind Sirsikar 02352b487a EGPRS: PUAN encoding: add test case to show wrong urbb_len issue
This patch adds a test case which expects a current bug with EGPRS PUAN
encoding when VQ != VR. The test's expectation is corrected along with
the bugfix in a subsequent commit

Adds test_tbf_puan_urbb_len to describe the following bug:
EGPRS PUAN encoding disregards the urbb_len, leading to identical PUAN
messages regardless of the urbb_len.

Related: OS#1793

Change-Id: I00662a564f64c0c83627401ae8f7bfef0f0a5de8
2016-08-25 16:37:30 +05:30
Aravind Sirsikar 50b097003b Modify EGPRS DL TBF flow to support SPB
Modify the EGPRS DL TBF flow to support Split block during
Retx. This patch will also Upgrade the test suite with test cases
to validate the EGPRS Downlink SPB for Retransmission

Scenarios like MCS6->MCS3, MCS4->MCS1, MCS5->MCS2, MCS9->MCS3
MCS7->MCS2, MCS8->MCS3 have been simulated and Integration tested
in NuRAN 1.0 hardware thoroughly.

Change-Id: I242afdd8ae7622dec8593b26382ad66bad5b9516
2016-08-25 10:41:33 +00:00
Aravind Sirsikar e6cadb4e3c Add data structure to handle SPB for EGPRS DL
Modify the header files with necessary data structure to handle
Split block for EGPRS DL TBF.

The EGPRS resegmentation feature allows PCU to retransmit
RLC blocks of HeaderType1, HeaderType2 by segmenting
them to 2 HeaderType3 blocks(Example MCS5 will be
retransmitted as 2 MCS2 blocks). Table 10.4.8b.2 of 44.060
explains the possible values of SPB in HeadrType3 for DL
direction. The PCU decides to retransmit the
blocks by resegmenting it based on Table 8.1.1.1 of 44.060.
The retransmission MCS is calculated based on current MCS of
the Block and demanded MCS by PCU. Section 10.3a.3.3 of 44.060
shows the HeadrType3 with SPB field present in it

Change-Id: I57673e53a9da2affa7e8aaa6551ac4b271c3d525
2016-08-25 10:34:00 +00:00
Aravind Sirsikar 1ec4d80176 Remove warning while using 'egprs only' command in VTY
This warning is not valid since the PCU is not failing when EGPRS is
activated. So removing this trace

Change-Id: I62278f998adc691b9a3563ac2a46d756e7bfb66c
2016-08-22 17:16:00 +00:00
Neels Hofmeyr 9876f4bb21 jenkins.sh: drop compat with old matrix params
Change-Id: I7b50a24cf5879cb473a5cf929768bdd30e863a26
2016-08-16 12:49:29 +02:00
Neels Hofmeyr 7fd177b91c jenkins.sh: change build matrix to $with_dsp and $with_vty
The new $with_dsp matrix parameter is defined as "sysmo" or empty/"none". The
lc15 DSP might be added in the future.

Fetch the sysmo layer 1 API only if with_dsp==sysmo.

The new $with_vty parameter is independent of $with_dsp, it is now up to
jenkins to define a matrix filter.

For compat, until jenkins is reconfigured with the new matrix parameters, use
$sysmodsp to init the new parameters to reflect previous behavior. The
$sysmobts matrix parameter made no sense, drop it.

Change-Id: Ia120f918342dc9563814252258b73bfb267e5253
2016-08-11 11:06:26 +00:00
Neels Hofmeyr 2d91260ea4 jenkins.sh: more quotes, cosmetics, less dup
Rename BTS_CONFIG to PCU_CONFIG.
More quotes.
Unify bash if-style.
Define *_PATH variables once globally instead of duping in every line.

Change-Id: If148632c3f340a8a395fa432135e593fecc41e82
2016-08-11 11:06:26 +00:00
Neels Hofmeyr 6bae2d11f1 jenkins.sh: use absolute paths instead of 'cd ..' and $PWD
Change-Id: If79d283fa0a559bb7ea319c513d09466eff523d1
2016-08-11 11:06:26 +00:00
Neels Hofmeyr 0b4da058ad jenkins.sh: ensure $MAKE is set
Change-Id: I2da8acdfe3abf79f68db4d00d04a7d162f0123ce
2016-08-11 11:06:26 +00:00
Max 79cb245157 LC: fix build error
Remove extra parameter which causes build to break. The error was
introduced in 878bd1f296

Change-Id: Id63187d925d448caa4fa85720582550919b1f216
2016-08-09 19:21:34 +02:00