Commit 30e403f4 authored by Robert Schmidt's avatar Robert Schmidt

Merge remote-tracking branch 'origin/bsr-estim' into integration_2024_w22

parents ba9d4afb 7fe29041
...@@ -22,8 +22,8 @@ gNBs = ...@@ -22,8 +22,8 @@ gNBs =
tr_s_preference = "f1"; tr_s_preference = "f1";
local_s_address = "192.168.68.194"; local_s_address = "127.0.0.4";
remote_s_address = "192.168.68.195"; remote_s_address = "127.0.0.5";
local_s_portc = 501; local_s_portc = 501;
local_s_portd = 2153; local_s_portd = 2153;
remote_s_portc = 500; remote_s_portc = 500;
...@@ -44,8 +44,8 @@ gNBs = ...@@ -44,8 +44,8 @@ gNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.68.194"; GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.109";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.68.194"; GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.109";
GNB_PORT_FOR_S1U = 2152; # Spec 2152 GNB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
} }
......
...@@ -23,8 +23,8 @@ gNBs = ...@@ -23,8 +23,8 @@ gNBs =
tr_s_preference = "f1"; tr_s_preference = "f1";
local_s_address = "192.168.68.194"; local_s_address = "127.0.0.4";
remote_s_address = "192.168.68.195"; remote_s_address = "127.0.0.5";
local_s_portc = 501; local_s_portc = 501;
local_s_portd = 2153; local_s_portd = 2153;
remote_s_portc = 500; remote_s_portc = 500;
...@@ -46,16 +46,16 @@ gNBs = ...@@ -46,16 +46,16 @@ gNBs =
( (
{ {
type = "cp"; type = "cp";
ipv4_cucp = "192.168.68.194"; ipv4_cucp = "127.0.0.4";
port_cucp = 38462; port_cucp = 38462;
ipv4_cuup = "192.168.68.196"; ipv4_cuup = "127.0.0.6";
port_cuup = 38462; port_cuup = 38462;
} }
) )
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.68.194"; GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.109";
}; };
} }
); );
......
...@@ -21,8 +21,8 @@ gNBs = ...@@ -21,8 +21,8 @@ gNBs =
tr_s_preference = "f1"; tr_s_preference = "f1";
local_s_address = "192.168.68.196"; local_s_address = "127.0.0.6";
remote_s_address = "192.168.68.195"; remote_s_address = "127.0.0.5";
local_s_portc = 501; local_s_portc = 501;
local_s_portd = 2153; local_s_portd = 2153;
remote_s_portc = 500; remote_s_portc = 500;
...@@ -40,15 +40,15 @@ gNBs = ...@@ -40,15 +40,15 @@ gNBs =
( (
{ {
type = "up"; type = "up";
ipv4_cucp = "192.168.68.194"; ipv4_cucp = "127.0.0.4";
ipv4_cuup = "192.168.68.196"; ipv4_cuup = "127.0.0.6";
} }
) )
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.68.196"; GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.109";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.68.196"; GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.109";
GNB_PORT_FOR_S1U = 2152; # Spec 2152 GNB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
} }
......
...@@ -162,8 +162,8 @@ MACRLCs = ( ...@@ -162,8 +162,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "f1"; tr_n_preference = "f1";
local_n_address = "192.168.68.195"; local_n_address = "127.0.0.5";
remote_n_address = "192.168.68.194"; remote_n_address = "127.0.0.4";
local_n_portc = 500; local_n_portc = 500;
local_n_portd = 2153; local_n_portd = 2153;
remote_n_portc = 501; remote_n_portc = 501;
......
...@@ -169,8 +169,8 @@ MACRLCs = ( ...@@ -169,8 +169,8 @@ MACRLCs = (
num_cc = 1; num_cc = 1;
tr_s_preference = "local_L1"; tr_s_preference = "local_L1";
tr_n_preference = "f1"; tr_n_preference = "f1";
local_n_address = "192.168.68.195"; local_n_address = "127.0.0.5";
remote_n_address = "192.168.68.194"; remote_n_address = "127.0.0.4";
local_n_portc = 500; local_n_portc = 500;
local_n_portd = 2153; local_n_portd = 2153;
remote_n_portc = 501; remote_n_portc = 501;
......
...@@ -161,8 +161,8 @@ gNBs = ...@@ -161,8 +161,8 @@ gNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.68.194"; GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.109";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.68.194"; GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.109";
GNB_PORT_FOR_S1U = 2152; # Spec 2152 GNB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
...@@ -161,8 +161,8 @@ gNBs = ...@@ -161,8 +161,8 @@ gNBs =
NETWORK_INTERFACES : NETWORK_INTERFACES :
{ {
GNB_IPV4_ADDRESS_FOR_NG_AMF = "192.168.68.194"; GNB_IPV4_ADDRESS_FOR_NG_AMF = "172.21.16.109";
GNB_IPV4_ADDRESS_FOR_NGU = "192.168.68.194"; GNB_IPV4_ADDRESS_FOR_NGU = "172.21.16.109";
GNB_PORT_FOR_S1U = 2152; # Spec 2152 GNB_PORT_FOR_S1U = 2152; # Spec 2152
}; };
......
...@@ -185,14 +185,14 @@ ...@@ -185,14 +185,14 @@
<class>Custom_Command</class> <class>Custom_Command</class>
<desc>Trigger Reestablishment</desc> <desc>Trigger Reestablishment</desc>
<node>ofqot</node> <node>ofqot</node>
<command>echo ci force_reestab | nc -N 192.168.68.194 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command> <command>echo ci force_reestab | nc -N 127.0.0.1 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail> <command_fail>yes</command_fail>
</testCase> </testCase>
<testCase id="060002"> <testCase id="060002">
<class>Custom_Command</class> <class>Custom_Command</class>
<desc>Verify Reestablishment</desc> <desc>Verify Reestablishment</desc>
<node>ofqot</node> <node>ofqot</node>
<command>echo ci get_reestab_count | nc -N 192.168.68.194 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command> <command>echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail> <command_fail>yes</command_fail>
</testCase> </testCase>
......
...@@ -177,14 +177,14 @@ ...@@ -177,14 +177,14 @@
<class>Custom_Command</class> <class>Custom_Command</class>
<desc>Trigger Reestablishment (on DU)</desc> <desc>Trigger Reestablishment (on DU)</desc>
<node>ofqot</node> <node>ofqot</node>
<command>echo ci force_reestab | nc -N 192.168.68.195 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command> <command>echo ci force_reestab | nc -N 127.0.0.1 9091 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail> <command_fail>yes</command_fail>
</testCase> </testCase>
<testCase id="360002"> <testCase id="360002">
<class>Custom_Command</class> <class>Custom_Command</class>
<desc>Verify Reestablishment (on CU)</desc> <desc>Verify Reestablishment (on CU)</desc>
<node>ofqot</node> <node>ofqot</node>
<command>echo ci get_reestab_count | nc -N 192.168.68.194 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command> <command>echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail> <command_fail>yes</command_fail>
</testCase> </testCase>
......
...@@ -209,14 +209,14 @@ ...@@ -209,14 +209,14 @@
<class>Custom_Command</class> <class>Custom_Command</class>
<desc>Trigger Reestablishment (on DU)</desc> <desc>Trigger Reestablishment (on DU)</desc>
<node>ofqot</node> <node>ofqot</node>
<command>echo ci force_reestab | nc -N 192.168.68.195 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command> <command>echo ci force_reestab | nc -N 127.0.0.1 9091 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail> <command_fail>yes</command_fail>
</testCase> </testCase>
<testCase id="160002"> <testCase id="160002">
<class>Custom_Command</class> <class>Custom_Command</class>
<desc>Verify Reestablishment (on CU)</desc> <desc>Verify Reestablishment (on CU)</desc>
<node>ofqot</node> <node>ofqot</node>
<command>echo ci get_reestab_count | nc -N 192.168.68.194 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command> <command>echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail> <command_fail>yes</command_fail>
</testCase> </testCase>
......
...@@ -179,14 +179,14 @@ ...@@ -179,14 +179,14 @@
<class>Custom_Command</class> <class>Custom_Command</class>
<desc>Trigger Reestablishment</desc> <desc>Trigger Reestablishment</desc>
<node>ofqot</node> <node>ofqot</node>
<command>echo ci force_reestab | nc -N 192.168.68.194 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command> <command>echo ci force_reestab | nc -N 127.0.0.1 9090 | grep -E 'Reset RLC counters of UE RNTI [0-9a-f]{4} to trigger reestablishment'</command>
<command_fail>yes</command_fail> <command_fail>yes</command_fail>
</testCase> </testCase>
<testCase id="260002"> <testCase id="260002">
<class>Custom_Command</class> <class>Custom_Command</class>
<desc>Verify Reestablishment</desc> <desc>Verify Reestablishment</desc>
<node>ofqot</node> <node>ofqot</node>
<command>echo ci get_reestab_count | nc -N 192.168.68.194 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command> <command>echo ci get_reestab_count | nc -N 127.0.0.1 9090 | grep -E 'UE RNTI [0-9a-f]{4} reestab 1'</command>
<command_fail>yes</command_fail> <command_fail>yes</command_fail>
</testCase> </testCase>
......
...@@ -11,9 +11,11 @@ services: ...@@ -11,9 +11,11 @@ services:
volumes: volumes:
- ../../conf_files/gnb.sa.band78.51prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf - ../../conf_files/gnb.sa.band78.51prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev - /dev:/dev
networks: # for performance reasons, we use host mode: in bridge mode, we have
public_net: # unacceptable DL TCP performance. However, the whole point of
ipv4_address: 192.168.68.194 # containerization is to not be in host mode, so update this to macvlan
# later.
network_mode: "host"
#entrypoint: /bin/bash -c "sleep infinity" #entrypoint: /bin/bash -c "sleep infinity"
healthcheck: healthcheck:
# pgrep does NOT work # pgrep does NOT work
...@@ -21,12 +23,3 @@ services: ...@@ -21,12 +23,3 @@ services:
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
networks:
public_net:
name: sa-b200-gnb-net
ipam:
config:
- subnet: 192.168.68.192/26
driver_opts:
com.docker.network.bridge.name: "sa-gnb-net"
...@@ -6,12 +6,16 @@ services: ...@@ -6,12 +6,16 @@ services:
ulimits: ulimits:
core: -1 # for core dumps core: -1 # for core dumps
environment: environment:
USE_ADDITIONAL_OPTIONS: --sa --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function USE_ADDITIONAL_OPTIONS: --sa
--telnetsrv --telnetsrv.listenport 9090 --telnetsrv.shrmod ci
--log_config.global_log_options level,nocolor,time,line_num,function
volumes: volumes:
- ../../conf_files/gnb-cucp.sa.f1.quectel.conf:/opt/oai-gnb/etc/gnb.conf - ../../conf_files/gnb-cucp.sa.f1.quectel.conf:/opt/oai-gnb/etc/gnb.conf
networks: # for performance reasons, we use host mode: in bridge mode, we have
public_net: # unacceptable DL TCP performance. However, the whole point of
ipv4_address: 192.168.68.194 # containerization is to not be in host mode, so update this to macvlan
# later.
network_mode: "host"
healthcheck: healthcheck:
# pgrep does NOT work # pgrep does NOT work
test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem" test: /bin/bash -c "ps aux | grep -v grep | grep -c softmodem"
...@@ -26,12 +30,15 @@ services: ...@@ -26,12 +30,15 @@ services:
ulimits: ulimits:
core: -1 # for core dumps core: -1 # for core dumps
environment: environment:
USE_ADDITIONAL_OPTIONS: --sa --log_config.global_log_options level,nocolor,time,line_num,function USE_ADDITIONAL_OPTIONS: --sa
--log_config.global_log_options level,nocolor,time,line_num,function
volumes: volumes:
- ../../conf_files/gnb-cuup.sa.f1.quectel.conf:/opt/oai-gnb/etc/gnb.conf - ../../conf_files/gnb-cuup.sa.f1.quectel.conf:/opt/oai-gnb/etc/gnb.conf
networks: # for performance reasons, we use host mode: in bridge mode, we have
public_net: # unacceptable DL TCP performance. However, the whole point of
ipv4_address: 192.168.68.196 # containerization is to not be in host mode, so update this to macvlan
# later.
network_mode: "host"
healthcheck: healthcheck:
# pgrep does NOT work # pgrep does NOT work
test: /bin/bash -c "ps aux | grep -v grep | grep -c nr-cuup" test: /bin/bash -c "ps aux | grep -v grep | grep -c nr-cuup"
...@@ -50,16 +57,18 @@ services: ...@@ -50,16 +57,18 @@ services:
USE_ADDITIONAL_OPTIONS: --sa USE_ADDITIONAL_OPTIONS: --sa
--RUs.[0].sdr_addrs serial=30C51D4 --RUs.[0].sdr_addrs serial=30C51D4
--continuous-tx -E --continuous-tx -E
--telnetsrv --telnetsrv.shrmod ci --telnetsrv --telnetsrv.listenport 9091 --telnetsrv.shrmod ci
--gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 1 --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 1
--RUs.[0].att_rx 14 --RUs.[0].att_tx 14 --RUs.[0].att_rx 14 --RUs.[0].att_tx 14
--log_config.global_log_options level,nocolor,time,line_num,function --log_config.global_log_options level,nocolor,time,line_num,function
volumes: volumes:
- ../../conf_files/gnb-du.sa.band78.106prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf - ../../conf_files/gnb-du.sa.band78.106prb.usrpb200.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev - /dev:/dev
networks: # for performance reasons, we use host mode: in bridge mode, we have
public_net: # unacceptable DL TCP performance. However, the whole point of
ipv4_address: 192.168.68.195 # containerization is to not be in host mode, so update this to macvlan
# later.
network_mode: "host"
#entrypoint: /bin/bash -c "sleep infinity" #entrypoint: /bin/bash -c "sleep infinity"
healthcheck: healthcheck:
# pgrep does NOT work # pgrep does NOT work
...@@ -67,12 +76,3 @@ services: ...@@ -67,12 +76,3 @@ services:
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
networks:
public_net:
name: sa-b200-gnb-net
ipam:
config:
- subnet: 192.168.68.192/26
driver_opts:
com.docker.network.bridge.name: "sa-gnb-net"
...@@ -6,12 +6,16 @@ services: ...@@ -6,12 +6,16 @@ services:
ulimits: ulimits:
core: -1 # for core dumps core: -1 # for core dumps
environment: environment:
USE_ADDITIONAL_OPTIONS: --sa --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function USE_ADDITIONAL_OPTIONS: --sa
--telnetsrv --telnetsrv.listenport 9090 --telnetsrv.shrmod ci
--log_config.global_log_options level,nocolor,time,line_num,function
volumes: volumes:
- ../../conf_files/gnb-cu.sa.f1.conf:/opt/oai-gnb/etc/gnb.conf - ../../conf_files/gnb-cu.sa.f1.conf:/opt/oai-gnb/etc/gnb.conf
networks: # for performance reasons, we use host mode: in bridge mode, we have
public_net: # unacceptable DL TCP performance. However, the whole point of
ipv4_address: 192.168.68.194 # containerization is to not be in host mode, so update this to macvlan
# later.
network_mode: "host"
#entrypoint: /bin/bash -c "sleep infinity" #entrypoint: /bin/bash -c "sleep infinity"
healthcheck: healthcheck:
# pgrep does NOT work # pgrep does NOT work
...@@ -28,13 +32,18 @@ services: ...@@ -28,13 +32,18 @@ services:
core: -1 # for core dumps core: -1 # for core dumps
environment: environment:
USE_B2XX: 'yes' USE_B2XX: 'yes'
USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx --telnetsrv --telnetsrv.shrmod ci --log_config.global_log_options level,nocolor,time,line_num,function --gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 0 --L1s.[0].max_ldpc_iterations 20 USE_ADDITIONAL_OPTIONS: --sa --RUs.[0].sdr_addrs serial=30C51D4 --continuous-tx
--telnetsrv --telnetsrv.listenport 9091 --telnetsrv.shrmod ci
--gNBs.[0].min_rxtxtime 2 --gNBs.[0].do_CSIRS 1 --gNBs.[0].do_SRS 0 --L1s.[0].max_ldpc_iterations 20
--log_config.global_log_options level,nocolor,time,line_num,function
volumes: volumes:
- ../../conf_files/gnb-du.sa.band1.52prb.usrpb210.conf:/opt/oai-gnb/etc/gnb.conf - ../../conf_files/gnb-du.sa.band1.52prb.usrpb210.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev - /dev:/dev
networks: # for performance reasons, we use host mode: in bridge mode, we have
public_net: # unacceptable DL TCP performance. However, the whole point of
ipv4_address: 192.168.68.195 # containerization is to not be in host mode, so update this to macvlan
# later.
network_mode: "host"
#entrypoint: /bin/bash -c "sleep infinity" #entrypoint: /bin/bash -c "sleep infinity"
healthcheck: healthcheck:
# pgrep does NOT work # pgrep does NOT work
...@@ -42,12 +51,3 @@ services: ...@@ -42,12 +51,3 @@ services:
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
networks:
public_net:
name: sa-b200-gnb-net
ipam:
config:
- subnet: 192.168.68.192/26
driver_opts:
com.docker.network.bridge.name: "sa-gnb-net"
...@@ -11,9 +11,11 @@ services: ...@@ -11,9 +11,11 @@ services:
volumes: volumes:
- ../../conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf:/opt/oai-gnb/etc/gnb.conf - ../../conf_files/gnb.sa.band78.106prb.usrpb200.sc-fdma.conf:/opt/oai-gnb/etc/gnb.conf
- /dev:/dev - /dev:/dev
networks: # for performance reasons, we use host mode: in bridge mode, we have
public_net: # unacceptable DL TCP performance. However, the whole point of
ipv4_address: 192.168.68.194 # containerization is to not be in host mode, so update this to macvlan
# later.
network_mode: "host"
#entrypoint: /bin/bash -c "sleep infinity" #entrypoint: /bin/bash -c "sleep infinity"
healthcheck: healthcheck:
# pgrep does NOT work # pgrep does NOT work
...@@ -21,12 +23,3 @@ services: ...@@ -21,12 +23,3 @@ services:
interval: 10s interval: 10s
timeout: 5s timeout: 5s
retries: 5 retries: 5
networks:
public_net:
name: sa-b200-gnb-net
ipam:
config:
- subnet: 192.168.68.192/26
driver_opts:
com.docker.network.bridge.name: "sa-gnb-net"
...@@ -111,6 +111,65 @@ static int compute_ph_factor(int mu, int tbs_bits, int rb, int n_layers, int n_s ...@@ -111,6 +111,65 @@ static int compute_ph_factor(int mu, int tbs_bits, int rb, int n_layers, int n_s
return ((int)roundf(delta_tf + bw_factor)); return ((int)roundf(delta_tf + bw_factor));
} }
/* \brief over-estimate the BSR index, given real_index.
*
* BSR does not account for headers, so we need to estimate. See 38.321
* 6.1.3.1: "The size of the RLC headers and MAC subheaders are not considered
* in the buffer size computation." */
static int overestim_bsr_index(int real_index)
{
/* if UE reports BSR 0, it means "no data"; otherwise, overestimate to
* account for headers */
const int add_overestim = 1;
return real_index > 0 ? real_index + add_overestim : real_index;
}
static int estimate_ul_buffer_short_bsr(const NR_BSR_SHORT *bsr)
{
/* NOTE: the short BSR might be for different LCGID than 0, but we do not
* differentiate them */
int rep_idx = bsr->Buffer_size;
int estim_idx = overestim_bsr_index(rep_idx);
int max = sizeofArray(NR_SHORT_BSR_TABLE);
int idx = min(estim_idx, max);
int estim_size = NR_SHORT_BSR_TABLE[idx];
LOG_D(NR_MAC, "short BSR LCGID %d index %d estim index %d size %d\n", bsr->LcgID, rep_idx, estim_idx, estim_size);
return estim_size;
}
static int estimate_ul_buffer_long_bsr(const NR_BSR_LONG *bsr)
{
LOG_D(NR_MAC,
"LONG BSR, LCG ID(7-0) %d/%d/%d/%d/%d/%d/%d/%d\n",
bsr->LcgID7,
bsr->LcgID6,
bsr->LcgID5,
bsr->LcgID4,
bsr->LcgID3,
bsr->LcgID2,
bsr->LcgID1,
bsr->LcgID0);
bool bsr_active[8] = {bsr->LcgID0 != 0, bsr->LcgID1 != 0, bsr->LcgID2 != 0, bsr->LcgID3 != 0, bsr->LcgID4 != 0, bsr->LcgID5 != 0, bsr->LcgID6 != 0, bsr->LcgID7 != 0};
int estim_size = 0;
int max = sizeofArray(NR_LONG_BSR_TABLE);
uint8_t *payload = ((uint8_t*) bsr) + 1;
int m = 0;
const int total_lcgids = 8; /* see 38.321 6.1.3.1 */
for (int n = 0; n < total_lcgids; n++) {
if (!bsr_active[n])
continue;
int rep_idx = payload[m];
int estim_idx = overestim_bsr_index(rep_idx);
int idx = min(estim_idx, max);
estim_size += NR_LONG_BSR_TABLE[idx];
LOG_D(NR_MAC, "LONG BSR LCGID/m %d/%d Index %d estim index %d size %d", n, m, rep_idx, estim_idx, estim_size);
m++;
}
return estim_size;
}
// For both UL-SCH except: // For both UL-SCH except:
// - UL-SCH: fixed-size MAC CE(known by LCID) // - UL-SCH: fixed-size MAC CE(known by LCID)
// - UL-SCH: padding // - UL-SCH: padding
...@@ -166,7 +225,6 @@ static int nr_process_mac_pdu(instance_t module_idP, ...@@ -166,7 +225,6 @@ static int nr_process_mac_pdu(instance_t module_idP,
LOG_D(NR_MAC, "In %s: received UL-SCH sub-PDU with LCID 0x%x in %d.%d (remaining PDU length %d)\n", __func__, rx_lcid, frameP, slot, pdu_len); LOG_D(NR_MAC, "In %s: received UL-SCH sub-PDU with LCID 0x%x in %d.%d (remaining PDU length %d)\n", __func__, rx_lcid, frameP, slot, pdu_len);
unsigned char *ce_ptr; unsigned char *ce_ptr;
int n_Lcg = 0;
switch(rx_lcid){ switch(rx_lcid){
// MAC CE // MAC CE
...@@ -192,17 +250,8 @@ static int nr_process_mac_pdu(instance_t module_idP, ...@@ -192,17 +250,8 @@ static int nr_process_mac_pdu(instance_t module_idP,
} }
/* Extract short BSR value */ /* Extract short BSR value */
ce_ptr = &pduP[mac_subheader_len]; ce_ptr = &pduP[mac_subheader_len];
NR_BSR_SHORT *bsr_s = (NR_BSR_SHORT *) ce_ptr; sched_ctrl->estimated_ul_buffer = estimate_ul_buffer_short_bsr((NR_BSR_SHORT *)ce_ptr);
sched_ctrl->estimated_ul_buffer = 0; LOG_D(NR_MAC, "SHORT BSR at %4d.%2d, est buf %d\n", frameP, slot, sched_ctrl->estimated_ul_buffer);
sched_ctrl->estimated_ul_buffer = NR_SHORT_BSR_TABLE[bsr_s->Buffer_size];
LOG_D(NR_MAC,
"SHORT BSR at %4d.%2d, LCG ID %d, BS Index %d, BS value < %d, est buf %d\n",
frameP,
slot,
bsr_s->LcgID,
bsr_s->Buffer_size,
NR_SHORT_BSR_TABLE[bsr_s->Buffer_size],
sched_ctrl->estimated_ul_buffer);
break; break;
case UL_SCH_LCID_L_BSR: case UL_SCH_LCID_L_BSR:
case UL_SCH_LCID_L_TRUNCATED_BSR: case UL_SCH_LCID_L_TRUNCATED_BSR:
...@@ -219,32 +268,8 @@ static int nr_process_mac_pdu(instance_t module_idP, ...@@ -219,32 +268,8 @@ static int nr_process_mac_pdu(instance_t module_idP,
} }
/* Extract long BSR value */ /* Extract long BSR value */
ce_ptr = &pduP[mac_subheader_len]; ce_ptr = &pduP[mac_subheader_len];
NR_BSR_LONG *bsr_l = (NR_BSR_LONG *) ce_ptr; sched_ctrl->estimated_ul_buffer = estimate_ul_buffer_long_bsr((NR_BSR_LONG *)ce_ptr);
sched_ctrl->estimated_ul_buffer = 0; LOG_D(NR_MAC, "LONG BSR at %4d.%2d, estim buf %d\n", frameP, slot, sched_ctrl->estimated_ul_buffer);
n_Lcg = bsr_l->LcgID7 + bsr_l->LcgID6 + bsr_l->LcgID5 + bsr_l->LcgID4 +
bsr_l->LcgID3 + bsr_l->LcgID2 + bsr_l->LcgID1 + bsr_l->LcgID0;
LOG_D(NR_MAC, "LONG BSR, LCG ID(7-0) %d/%d/%d/%d/%d/%d/%d/%d\n",
bsr_l->LcgID7, bsr_l->LcgID6, bsr_l->LcgID5, bsr_l->LcgID4,
bsr_l->LcgID3, bsr_l->LcgID2, bsr_l->LcgID1, bsr_l->LcgID0);
for (int n = 0; n < n_Lcg; n++){
LOG_D(NR_MAC, "LONG BSR, %d/%d (n/n_Lcg), BS Index %d, BS value < %d",
n, n_Lcg, pduP[mac_subheader_len + 1 + n],
NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]]);
sched_ctrl->estimated_ul_buffer += NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]];
LOG_D(NR_MAC,
"LONG BSR at %4d.%2d, %d/%d (n/n_Lcg), BS Index %d, BS value < %d, total %d\n",
frameP,
slot,
n,
n_Lcg,
pduP[mac_subheader_len + 1 + n],
NR_LONG_BSR_TABLE[pduP[mac_subheader_len + 1 + n]],
sched_ctrl->estimated_ul_buffer);
}
break; break;
case UL_SCH_LCID_C_RNTI: case UL_SCH_LCID_C_RNTI:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment