Commit 7a0c0033 authored by Robert Schmidt's avatar Robert Schmidt

put intra-/inter slice sharing within slice config

parent 44481a56
...@@ -1393,6 +1393,8 @@ void flexran_create_config_structures(mid_t mod_id) ...@@ -1393,6 +1393,8 @@ void flexran_create_config_structures(mid_t mod_id)
sc_update[mod_id] = flexran_agent_create_slice_config(n_dl, m_ul); sc_update[mod_id] = flexran_agent_create_slice_config(n_dl, m_ul);
if (!slice_config[mod_id] || !sc_update[mod_id]) return; if (!slice_config[mod_id] || !sc_update[mod_id]) return;
flexran_agent_read_slice_config(mod_id, slice_config[mod_id]);
flexran_agent_read_slice_config(mod_id, sc_update[mod_id]);
for (i = 0; i < n_dl; i++) { for (i = 0; i < n_dl; i++) {
flexran_agent_read_slice_dl_config(mod_id, i, slice_config[mod_id]->dl[i]); flexran_agent_read_slice_dl_config(mod_id, i, slice_config[mod_id]->dl[i]);
flexran_agent_read_slice_dl_config(mod_id, i, sc_update[mod_id]->dl[i]); flexran_agent_read_slice_dl_config(mod_id, i, sc_update[mod_id]->dl[i]);
...@@ -1526,6 +1528,7 @@ void flexran_agent_slice_update(mid_t mod_id) ...@@ -1526,6 +1528,7 @@ void flexran_agent_slice_update(mid_t mod_id)
sc_update[mod_id]->ul[i]); sc_update[mod_id]->ul[i]);
flexran_agent_read_slice_ul_config(mod_id, i, slice_config[mod_id]->ul[i]); flexran_agent_read_slice_ul_config(mod_id, i, slice_config[mod_id]->ul[i]);
} }
flexran_agent_read_slice_config(mod_id, slice_config[mod_id]);
if (n_ue_slice_assoc_updates > 0) { if (n_ue_slice_assoc_updates > 0) {
changes += apply_ue_slice_assoc_update(mod_id); changes += apply_ue_slice_assoc_update(mod_id);
} }
......
...@@ -939,6 +939,14 @@ Protocol__FlexSliceConfig *flexran_agent_create_slice_config(int n_dl, int m_ul) ...@@ -939,6 +939,14 @@ Protocol__FlexSliceConfig *flexran_agent_create_slice_config(int n_dl, int m_ul)
return fsc; return fsc;
} }
void flexran_agent_read_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *s)
{
s->intraslice_share_active = flexran_get_intraslice_sharing_active(mod_id);
s->has_intraslice_share_active = 1;
s->interslice_share_active = flexran_get_interslice_sharing_active(mod_id);
s->has_interslice_share_active = 1;
}
void flexran_agent_read_slice_dl_config(mid_t mod_id, int slice_idx, Protocol__FlexDlSlice *dl_slice) void flexran_agent_read_slice_dl_config(mid_t mod_id, int slice_idx, Protocol__FlexDlSlice *dl_slice)
{ {
dl_slice->id = flexran_get_dl_slice_id(mod_id, slice_idx); dl_slice->id = flexran_get_dl_slice_id(mod_id, slice_idx);
...@@ -1042,6 +1050,24 @@ int check_ul_sorting_update(Protocol__FlexUlSlice *old, Protocol__FlexUlSlice *n ...@@ -1042,6 +1050,24 @@ int check_ul_sorting_update(Protocol__FlexUlSlice *old, Protocol__FlexUlSlice *n
return sorting_update; return sorting_update;
} }
void overwrite_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *exist, Protocol__FlexSliceConfig *update)
{
if (update->has_intraslice_share_active
&& exist->intraslice_share_active != update->intraslice_share_active) {
LOG_I(FLEXRAN_AGENT, "[%d] update intraslice_share_active: %d -> %d\n",
mod_id, exist->intraslice_share_active, update->intraslice_share_active);
exist->intraslice_share_active = update->intraslice_share_active;
exist->has_intraslice_share_active = 1;
}
if (update->has_interslice_share_active
&& exist->interslice_share_active != update->interslice_share_active) {
LOG_I(FLEXRAN_AGENT, "[%d] update interslice_share_active: %d -> %d\n",
mod_id, exist->interslice_share_active, update->interslice_share_active);
exist->interslice_share_active = update->interslice_share_active;
exist->has_interslice_share_active = 1;
}
}
void overwrite_slice_config_dl(mid_t mod_id, Protocol__FlexDlSlice *exist, Protocol__FlexDlSlice *update) void overwrite_slice_config_dl(mid_t mod_id, Protocol__FlexDlSlice *exist, Protocol__FlexDlSlice *update)
{ {
if (update->label != exist->label) { if (update->label != exist->label) {
...@@ -1333,6 +1359,11 @@ void prepare_update_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *sup) ...@@ -1333,6 +1359,11 @@ void prepare_update_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *sup)
} }
pthread_mutex_lock(&sc_update_mtx); pthread_mutex_lock(&sc_update_mtx);
/* no need for tests in the current state as there are only two protobuf
* bools for intra-/interslice sharing. The function applies new values if
* applicable */
overwrite_slice_config(mod_id, sc_update[mod_id], sup);
if (sup->n_dl == 0) { if (sup->n_dl == 0) {
LOG_I(FLEXRAN_AGENT, "[%d] no DL slice configuration in flex_slice_config message\n", mod_id); LOG_I(FLEXRAN_AGENT, "[%d] no DL slice configuration in flex_slice_config message\n", mod_id);
} else { } else {
...@@ -1408,6 +1439,23 @@ void prepare_update_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *sup) ...@@ -1408,6 +1439,23 @@ void prepare_update_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *sup)
perform_slice_config_update_count = 1; perform_slice_config_update_count = 1;
} }
int apply_new_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *olds, Protocol__FlexSliceConfig *news)
{
/* not setting the old configuration is intentional, as it will be picked up
* later when reading the configuration. There is thus a direct feedback
* whether it has been set. */
int changes = 0;
if (olds->intraslice_share_active != news->intraslice_share_active) {
flexran_set_intraslice_sharing_active(mod_id, news->intraslice_share_active);
changes++;
}
if (olds->interslice_share_active != news->interslice_share_active) {
flexran_set_interslice_sharing_active(mod_id, news->interslice_share_active);
changes++;
}
return changes;
}
int apply_new_slice_dl_config(mid_t mod_id, Protocol__FlexDlSlice *oldc, Protocol__FlexDlSlice *newc) int apply_new_slice_dl_config(mid_t mod_id, Protocol__FlexDlSlice *oldc, Protocol__FlexDlSlice *newc)
{ {
/* not setting the old configuration is intentional, as it will be picked up /* not setting the old configuration is intentional, as it will be picked up
......
...@@ -113,6 +113,10 @@ int load_dl_scheduler_function(mid_t mod_id, const char *function_name); ...@@ -113,6 +113,10 @@ int load_dl_scheduler_function(mid_t mod_id, const char *function_name);
* configs and m_ul UL slice configs */ * configs and m_ul UL slice configs */
Protocol__FlexSliceConfig *flexran_agent_create_slice_config(int n_dl, int m_ul); Protocol__FlexSliceConfig *flexran_agent_create_slice_config(int n_dl, int m_ul);
/* read the general slice parameters via RAN into the given
* Protocol__FlexSliceConfig struct */
void flexran_agent_read_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *s);
/* read the DL slice config via the RAN into a given Protocol__FlexDlSlice /* read the DL slice config via the RAN into a given Protocol__FlexDlSlice
* struct */ * struct */
void flexran_agent_read_slice_dl_config(mid_t mod_id, int slice_idx, Protocol__FlexDlSlice *dl_slice); void flexran_agent_read_slice_dl_config(mid_t mod_id, int slice_idx, Protocol__FlexDlSlice *dl_slice);
...@@ -125,6 +129,10 @@ void flexran_agent_read_slice_ul_config(mid_t mod_id, int slice_idx, Protocol__F ...@@ -125,6 +129,10 @@ void flexran_agent_read_slice_ul_config(mid_t mod_id, int slice_idx, Protocol__F
* applied later by performing a diff between slice_config and sc_update */ * applied later by performing a diff between slice_config and sc_update */
void prepare_update_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *slice); void prepare_update_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *slice);
/* apply generic slice parameters (e.g. intra-/interslice sharing activated or
* not) if there are changes. Returns the number of changed parameters. */
int apply_new_slice_config(mid_t mod_id, Protocol__FlexSliceConfig *olds, Protocol__FlexSliceConfig *news);
/* apply new configuration of slice in DL if there are changes between the /* apply new configuration of slice in DL if there are changes between the
* parameters. Returns the number of changed parameters. */ * parameters. Returns the number of changed parameters. */
int apply_new_slice_dl_config(mid_t mod_id, Protocol__FlexDlSlice *oldc, Protocol__FlexDlSlice *newc); int apply_new_slice_dl_config(mid_t mod_id, Protocol__FlexDlSlice *oldc, Protocol__FlexDlSlice *newc);
......
...@@ -44,16 +44,16 @@ message flex_cell_config { ...@@ -44,16 +44,16 @@ message flex_cell_config {
optional int32 dl_pdsch_power = 38; // operating downlink power optional int32 dl_pdsch_power = 38; // operating downlink power
optional int32 ul_pusch_power = 39; // operating uplink power optional int32 ul_pusch_power = 39; // operating uplink power
// whether remaining RBs after first intra-slice allocation will
// be allocated to UEs of the same slice
optional bool intraslice_share_active = 40;
// whether remaining RBs after slice allocation will be allocated
// to UEs of another slice. Isolated slices will be ignored.
optional bool interslice_share_active = 41;
optional flex_slice_config slice_config = 42; optional flex_slice_config slice_config = 42;
} }
message flex_slice_config { message flex_slice_config {
// whether remaining RBs after first intra-slice allocation will
// be allocated to UEs of the same slice
optional bool intraslice_share_active = 4;
// whether remaining RBs after slice allocation will be allocated
// to UEs of another slice. Isolated slices will be ignored.
optional bool interslice_share_active = 3;
repeated flex_dl_slice dl = 1; repeated flex_dl_slice dl = 1;
repeated flex_ul_slice ul = 2; repeated flex_ul_slice ul = 2;
} }
......
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