Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG UE
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lizhongxiao
OpenXG UE
Commits
505bbf80
Commit
505bbf80
authored
Apr 03, 2020
by
Robert Schmidt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use CCE_try_allocate_dlsch()
parent
f66d5888
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
275 additions
and
276 deletions
+275
-276
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
+206
-276
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
+61
-0
openair2/LAYER2/MAC/mac.h
openair2/LAYER2/MAC/mac.h
+1
-0
openair2/LAYER2/MAC/mac_proto.h
openair2/LAYER2/MAC/mac_proto.h
+6
-0
openair2/LAYER2/MAC/pre_processor.c
openair2/LAYER2/MAC/pre_processor.c
+1
-0
No files found.
openair2/LAYER2/MAC/eNB_scheduler_dlsch.c
View file @
505bbf80
...
...
@@ -617,38 +617,11 @@ schedule_ue_spec(module_id_t module_idP,
continue
;
}
int
aggregation
=
2
;
switch
(
get_tmode
(
module_idP
,
CC_id
,
UE_id
))
{
case
1
:
case
2
:
case
7
:
aggregation
=
get_aggregation
(
get_bw_index
(
module_idP
,
CC_id
),
ue_sched_ctrl
->
dl_cqi
[
CC_id
],
format1
);
break
;
case
3
:
aggregation
=
get_aggregation
(
get_bw_index
(
module_idP
,
CC_id
),
ue_sched_ctrl
->
dl_cqi
[
CC_id
],
format2A
);
break
;
default:
AssertFatal
(
1
==
0
,
"Unsupported transmission mode %d
\n
"
,
get_tmode
(
module_idP
,
CC_id
,
UE_id
));
aggregation
=
2
;
break
;
}
if
(
CCE_allocation_infeasible
(
module_idP
,
CC_id
,
1
,
subframeP
,
aggregation
,
rnti
))
{
int
dci_dl_pdu_idx
=
ue_sched_ctrl
->
pre_dci_dl_pdu_idx
;
if
(
dci_dl_pdu_idx
<
0
)
{
dci_dl_pdu_idx
=
CCE_try_allocate_dlsch
(
module_idP
,
CC_id
,
subframeP
,
UE_id
,
ue_sched_ctrl
->
dl_cqi
[
CC_id
]);
if
(
dci_dl_pdu_idx
<
0
)
{
LOG_W
(
MAC
,
"%d.%d: Dropping Allocation for RNTI 0x%04x/UE %d
\n
"
,
frameP
,
subframeP
,
...
...
@@ -656,6 +629,21 @@ schedule_ue_spec(module_id_t module_idP,
UE_id
);
continue
;
}
}
/* verify it is the right UE */
nfapi_dl_config_request_pdu_t
*
dci
=
&
dl_req
->
dl_config_pdu_list
[
dci_dl_pdu_idx
];
nfapi_dl_config_request_pdu_t
*
dlsch
=
&
dl_req
->
dl_config_pdu_list
[
dci_dl_pdu_idx
+
1
];
if
(
dci
->
pdu_type
!=
NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE
||
dci
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
rnti
!=
rnti
||
dlsch
->
pdu_type
!=
NFAPI_DL_CONFIG_DLSCH_PDU_TYPE
||
dlsch
->
dlsch_pdu
.
dlsch_pdu_rel8
.
rnti
!=
rnti
)
{
LOG_E
(
MAC
,
"illegal dl_config_pdu_list index %d for UE %d/RNTI %04x
\n
"
,
dci_dl_pdu_idx
,
UE_id
,
rnti
);
continue
;
}
const
int
harq_pid
=
frame_subframe2_dl_harq_pid
(
cc
->
tdd_Config
,
frameP
,
...
...
@@ -691,7 +679,16 @@ schedule_ue_spec(module_id_t module_idP,
const
uint32_t
rbc
=
allocate_prbs_sub
(
nb_rb
,
N_RB_DL
,
N_RBG
,
ue_sched_ctrl
->
rballoc_sub_UE
[
CC_id
]);
if
(
nb_rb
<=
ue_sched_ctrl
->
pre_nb_available_rbs
[
CC_id
])
{
if
(
nb_rb
>
ue_sched_ctrl
->
pre_nb_available_rbs
[
CC_id
])
{
LOG_D
(
MAC
,
"[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have
\n
"
,
module_idP
,
frameP
,
CC_id
,
UE_id
);
continue
;
}
/* CDRX */
ue_sched_ctrl
->
harq_rtt_timer
[
CC_id
][
harq_pid
]
=
1
;
// restart HARQ RTT timer
...
...
@@ -720,8 +717,7 @@ schedule_ue_spec(module_id_t module_idP,
ue_template
->
DAI
);
}
nfapi_dl_config_request_pdu_t
*
dl_config_pdu
=
&
dl_req
->
dl_config_pdu_list
[
dl_req
->
number_pdu
];
memset
(
dl_config_pdu
,
0
,
sizeof
(
nfapi_dl_config_request_pdu_t
));
nfapi_dl_config_request_pdu_t
*
dl_config_pdu
=
&
dl_req
->
dl_config_pdu_list
[
dci_dl_pdu_idx
];
switch
(
get_tmode
(
module_idP
,
CC_id
,
UE_id
))
{
case
1
:
case
2
:
...
...
@@ -729,16 +725,8 @@ schedule_ue_spec(module_id_t module_idP,
default:
LOG_D
(
MAC
,
"retransmission DL_REQ: rnti:%x
\n
"
,
rnti
);
dl_config_pdu
->
pdu_type
=
NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE
;
dl_config_pdu
->
pdu_size
=
(
uint8_t
)
(
2
+
sizeof
(
nfapi_dl_config_dci_dl_pdu
));
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
tl
.
tag
=
NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG
;
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
dci_format
=
NFAPI_DL_DCI_FORMAT_1
;
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
aggregation_level
=
get_aggregation
(
get_bw_index
(
module_idP
,
CC_id
),
ue_sched_ctrl
->
dl_cqi
[
CC_id
],
format1
);
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
rnti
=
rnti
;
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
rnti_type
=
1
;
// CRNTI: see Table 4-10 from SCF082 - nFAPI specifications
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
transmission_power
=
6000
;
// equal to RS power
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
harq_process
=
harq_pid
;
...
...
@@ -768,18 +756,10 @@ schedule_ue_spec(module_id_t module_idP,
ue_template
->
oldmcs1
[
harq_pid
]);
}
if
(
!
CCE_allocation_infeasible
(
module_idP
,
CC_id
,
1
,
subframeP
,
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
aggregation_level
,
rnti
))
{
dl_req
->
number_dci
++
;
dl_req
->
number_pdu
++
;
dl_req
->
tl
.
tag
=
NFAPI_DL_CONFIG_REQUEST_BODY_TAG
;
eNB
->
DL_req
[
CC_id
].
sfn_sf
=
frameP
<<
4
|
subframeP
;
eNB
->
DL_req
[
CC_id
].
header
.
message_id
=
NFAPI_DL_CONFIG_REQUEST
;
fill_nfapi_dlsch_config
(
&
dl_req
->
dl_config_pdu_list
[
dl_req
->
number_pdu
],
fill_nfapi_dlsch_config
(
&
dl_req
->
dl_config_pdu_list
[
dci_dl_pdu_idx
+
1
],
TBS
,
-
1
,
// retransmission, no pdu_index
rnti
,
...
...
@@ -802,7 +782,6 @@ schedule_ue_spec(module_id_t module_idP,
cc
[
CC_id
].
p_eNB
==
1
?
1
:
2
,
// transmission mode
0
,
//number of PRBs treated as one subband, not used here
0
);
// number of beamforming vectors, not used here
dl_req
->
number_pdu
++
;
LOG_D
(
MAC
,
"Filled NFAPI configuration for DCI/DLSCH %d, retransmission round %d
\n
"
,
eNB
->
pdu_index
[
CC_id
],
round_DL
);
...
...
@@ -813,13 +792,6 @@ schedule_ue_spec(module_id_t module_idP,
subframeP
,
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
cce_idx
);
// No TX request for retransmission (check if null request for FAPI)
}
else
{
LOG_W
(
MAC
,
"Frame %d, Subframe %d: Dropping DLSCH allocation for UE %d\%x, infeasible CCE allocation
\n
"
,
frameP
,
subframeP
,
UE_id
,
rnti
);
}
}
//eNB_UE_stats->dlsch_trials[round]++;
...
...
@@ -827,14 +799,6 @@ schedule_ue_spec(module_id_t module_idP,
eNB_UE_stats
->
rbs_used_retx
=
nb_rb
;
eNB_UE_stats
->
total_rbs_used_retx
+=
nb_rb
;
eNB_UE_stats
->
dlsch_mcs2
=
eNB_UE_stats
->
dlsch_mcs1
;
}
else
{
LOG_D
(
MAC
,
"[eNB %d] Frame %d CC_id %d : don't schedule UE %d, its retransmission takes more resources than we have
\n
"
,
module_idP
,
frameP
,
CC_id
,
UE_id
);
}
}
else
{
// Now check RLC information to compute number of required RBs
// get maximum TBS size for RLC request
...
...
@@ -1115,18 +1079,9 @@ schedule_ue_spec(module_id_t module_idP,
}
// Po_PUCCH has been updated
}
nfapi_dl_config_request_pdu_t
*
dl_config_pdu
=
&
dl_req
->
dl_config_pdu_list
[
dl_req
->
number_pdu
];
memset
(
dl_config_pdu
,
0
,
sizeof
(
nfapi_dl_config_request_pdu_t
));
dl_config_pdu
->
pdu_type
=
NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE
;
nfapi_dl_config_request_pdu_t
*
dl_config_pdu
=
&
dl_req
->
dl_config_pdu_list
[
dci_dl_pdu_idx
];
dl_config_pdu
->
pdu_size
=
(
uint8_t
)
(
2
+
sizeof
(
nfapi_dl_config_dci_dl_pdu
));
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
dci_format
=
NFAPI_DL_DCI_FORMAT_1
;
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
aggregation_level
=
get_aggregation
(
get_bw_index
(
module_idP
,
CC_id
),
ue_sched_ctrl
->
dl_cqi
[
CC_id
],
format1
);
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
tl
.
tag
=
NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG
;
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
rnti
=
rnti
;
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
rnti_type
=
1
;
// CRNTI : see Table 4-10 from SCF082 - nFAPI specifications
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
transmission_power
=
6000
;
// equal to RS power
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
harq_process
=
harq_pid
;
...
...
@@ -1159,15 +1114,7 @@ schedule_ue_spec(module_id_t module_idP,
LOG_D
(
MAC
,
"Checking feasibility pdu %d (new sdu)
\n
"
,
dl_req
->
number_pdu
);
if
(
!
CCE_allocation_infeasible
(
module_idP
,
CC_id
,
1
,
subframeP
,
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
aggregation_level
,
rnti
))
{
ue_sched_ctrl
->
round
[
CC_id
][
harq_pid
]
=
0
;
dl_req
->
number_dci
++
;
dl_req
->
number_pdu
++
;
dl_req
->
tl
.
tag
=
NFAPI_DL_CONFIG_REQUEST_BODY_TAG
;
eNB
->
DL_req
[
CC_id
].
sfn_sf
=
frameP
<<
4
|
subframeP
;
eNB
->
DL_req
[
CC_id
].
header
.
message_id
=
NFAPI_DL_CONFIG_REQUEST
;
...
...
@@ -1202,7 +1149,7 @@ schedule_ue_spec(module_id_t module_idP,
AssertFatal
(
ue_template
->
physicalConfigDedicated
!=
NULL
,
"physicalConfigDedicated is NULL
\n
"
);
AssertFatal
(
ue_template
->
physicalConfigDedicated
->
pdsch_ConfigDedicated
!=
NULL
,
"physicalConfigDedicated->pdsch_ConfigDedicated is NULL
\n
"
);
fill_nfapi_dlsch_config
(
&
dl_req
->
dl_config_pdu_list
[
dl_req
->
number_pdu
],
fill_nfapi_dlsch_config
(
&
dl_req
->
dl_config_pdu_list
[
dci_dl_pdu_idx
+
1
],
TBS
,
eNB
->
pdu_index
[
CC_id
],
rnti
,
...
...
@@ -1225,7 +1172,6 @@ schedule_ue_spec(module_id_t module_idP,
cc
[
CC_id
].
p_eNB
==
1
?
1
:
2
,
// transmission mode
0
,
//number of PRBs treated as one subband, not used here
0
);
// number of beamforming vectors, not used here
dl_req
->
number_pdu
++
;
eNB
->
TX_req
[
CC_id
].
sfn_sf
=
fill_nfapi_tx_req
(
&
eNB
->
TX_req
[
CC_id
].
tx_request_body
,
(
frameP
*
10
)
+
subframeP
,
TBS
,
...
...
@@ -1240,23 +1186,7 @@ schedule_ue_spec(module_id_t module_idP,
frameP
,
subframeP
,
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
cce_idx
);
}
else
{
LOG_W
(
MAC
,
"Frame %d, Subframe %d: Dropping DLSCH allocation for UE %d/%x, infeasible CCE allocations
\n
"
,
frameP
,
subframeP
,
UE_id
,
rnti
);
}
}
}
/* TODO this seems to not be necessary, we already do this above */
if
(
cc
[
CC_id
].
tdd_Config
!=
NULL
)
{
// TDD
set_ul_DAI
(
module_idP
,
UE_id
,
CC_id
,
frameP
,
subframeP
);
}
}
// UE_id loop
stop_meas
(
&
eNB
->
schedule_dlsch
);
...
...
openair2/LAYER2/MAC/eNB_scheduler_primitives.c
View file @
505bbf80
...
...
@@ -3510,6 +3510,67 @@ CCE_allocation_infeasible(int module_idP,
return
res
;
}
int
CCE_try_allocate_dlsch
(
int
module_id
,
int
CC_id
,
int
subframe
,
int
UE_id
,
uint8_t
dl_cqi
)
{
const
rnti_t
rnti
=
RC
.
mac
[
module_id
]
->
UE_info
.
UE_template
[
CC_id
][
UE_id
].
rnti
;
nfapi_dl_config_request_body_t
*
DL_req
=
&
RC
.
mac
[
module_id
]
->
DL_req
[
CC_id
].
dl_config_request_body
;
if
(
DL_req
->
number_pdu
>=
MAX_NUM_DL_PDU
)
{
LOG_W
(
MAC
,
"Subframe %d: FAPI DL structure is full, skip scheduling UE %d
\n
"
,
subframe
,
rnti
);
return
-
1
;
}
int
aggregation
=
2
;
const
uint8_t
tm
=
get_tmode
(
module_id
,
CC_id
,
UE_id
);
switch
(
tm
)
{
case
1
:
case
2
:
case
7
:
aggregation
=
get_aggregation
(
get_bw_index
(
module_id
,
CC_id
),
dl_cqi
,
format1
);
break
;
case
3
:
aggregation
=
get_aggregation
(
get_bw_index
(
module_id
,
CC_id
),
dl_cqi
,
format2A
);
break
;
default:
AssertFatal
(
0
,
"Unsupported transmission mode %d
\n
"
,
tm
);
break
;
}
nfapi_dl_config_request_pdu_t
*
dl_config_pdu
=
&
DL_req
->
dl_config_pdu_list
[
DL_req
->
number_pdu
];
memset
(
dl_config_pdu
,
0
,
sizeof
(
nfapi_dl_config_request_pdu_t
));
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
tl
.
tag
=
NFAPI_DL_CONFIG_REQUEST_DCI_DL_PDU_REL8_TAG
;
dl_config_pdu
->
pdu_type
=
NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE
;
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
rnti
=
rnti
;
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
rnti_type
=
1
;
dl_config_pdu
->
dci_dl_pdu
.
dci_dl_pdu_rel8
.
aggregation_level
=
aggregation
;
DL_req
->
number_pdu
++
;
LOG_D
(
MAC
,
"Subframe %d: Checking CCE feasibility format 1: (%x,%d)
\n
"
,
subframe
,
rnti
,
aggregation
);
if
(
allocate_CCEs
(
module_id
,
CC_id
,
0
,
subframe
,
0
)
<
0
)
{
DL_req
->
number_pdu
--
;
return
-
1
;
}
DL_req
->
number_dci
++
;
nfapi_dl_config_request_pdu_t
*
dl_dlsch_pdu
=
&
DL_req
->
dl_config_pdu_list
[
DL_req
->
number_pdu
];
dl_dlsch_pdu
->
pdu_type
=
NFAPI_DL_CONFIG_DLSCH_PDU_TYPE
;
dl_dlsch_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
tl
.
tag
=
NFAPI_DL_CONFIG_REQUEST_DLSCH_PDU_REL8_TAG
;
dl_dlsch_pdu
->
dlsch_pdu
.
dlsch_pdu_rel8
.
rnti
=
rnti
;
DL_req
->
number_pdu
++
;
return
DL_req
->
number_pdu
-
2
;
}
//------------------------------------------------------------------------------
void
get_retransmission_timing
(
LTE_TDD_Config_t
*
tdd_Config
,
...
...
openair2/LAYER2/MAC/mac.h
View file @
505bbf80
...
...
@@ -933,6 +933,7 @@ typedef struct {
uint8_t
dl_pow_off
[
NFAPI_CC_MAX
];
uint16_t
pre_nb_available_rbs
[
NFAPI_CC_MAX
];
unsigned
char
rballoc_sub_UE
[
NFAPI_CC_MAX
][
N_RBG_MAX
];
int
pre_dci_dl_pdu_idx
;
uint16_t
ta_timer
;
int16_t
ta_update
;
uint16_t
ul_consecutive_errors
;
...
...
openair2/LAYER2/MAC/mac_proto.h
View file @
505bbf80
...
...
@@ -413,6 +413,12 @@ boolean_t CCE_allocation_infeasible(int module_idP,
int
common_flag
,
int
subframe
,
int
aggregation
,
int
rnti
);
/* tries to allocate a CCE. If it succeeds, reserves NFAPI DCI and DLSCH config */
int
CCE_try_allocate_dlsch
(
int
module_id
,
int
CC_id
,
int
subframe
,
int
UE_id
,
uint8_t
dl_cqi
);
void
set_ue_dai
(
sub_frame_t
subframeP
,
int
UE_id
,
...
...
openair2/LAYER2/MAC/pre_processor.c
View file @
505bbf80
...
...
@@ -293,6 +293,7 @@ dlsch_scheduler_pre_processor(module_id_t Mod_id,
ue_sched_ctrl
->
pre_nb_available_rbs
[
CC_id
]
=
0
;
ue_sched_ctrl
->
dl_pow_off
[
CC_id
]
=
2
;
memset
(
ue_sched_ctrl
->
rballoc_sub_UE
[
CC_id
],
0
,
sizeof
(
ue_sched_ctrl
->
rballoc_sub_UE
[
CC_id
]));
ue_sched_ctrl
->
pre_dci_dl_pdu_idx
=
-
1
;
const
rnti_t
rnti
=
UE_RNTI
(
Mod_id
,
UE_id
);
if
(
rnti
==
NOT_A_RNTI
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment