aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2020-12-26 18:00:17 +0100
committerAlexander Couzens <lynxis@fe80.eu>2020-12-26 18:43:08 +0100
commit8a2a1a4959a2d51c74e87c8329d3dd35792f6ef5 (patch)
treef78508cf991177303e2898e0755dc604cbb0390b
parentd01163a977d53e64f745e59d8886bab520aeb4ca (diff)
gprs_ns2: rework frame relay load distribution function
For frame relay the traffic will be even distributed across all NS-VCs. Do not differentiate between signalling and data traffic. Change-Id: I6c060941db335a7a6a555ac8d1b9269fa8fb2023
-rw-r--r--src/gb/gprs_ns2.c37
-rw-r--r--src/gb/gprs_ns2_internal.h4
2 files changed, 18 insertions, 23 deletions
diff --git a/src/gb/gprs_ns2.c b/src/gb/gprs_ns2.c
index 5603fce4..1098f221 100644
--- a/src/gb/gprs_ns2.c
+++ b/src/gb/gprs_ns2.c
@@ -350,15 +350,12 @@ static struct gprs_ns2_vc *ns2_load_sharing_modulor(
uint32_t load_selector)
{
struct gprs_ns2_vc *tmp;
- uint32_t mod = (bvci + load_selector) % nse->nsvc_data_count;
+ uint32_t mod = (bvci + load_selector) % nse->nsvc_count;
uint32_t i = 0;
llist_for_each_entry(tmp, &nse->nsvc, list) {
if (!gprs_ns2_vc_is_unblocked(tmp))
continue;
- if (tmp->data_weight == 0)
- continue;
-
if (i == mod)
return tmp;
i++;
@@ -393,22 +390,20 @@ static struct gprs_ns2_vc *ns2_load_sharing(
{
struct gprs_ns2_vc *nsvc = NULL;
- if (bvci == 0) {
- /* signalling */
- nsvc = ns2_load_sharing_signal(nse);
- } else {
- /* data with load sharing parameter */
- if (llist_empty(&nse->nsvc))
- return NULL;
-
- switch (nse->ll) {
- case GPRS_NS2_LL_FR:
- nsvc = ns2_load_sharing_modulor(nse, bvci, link_selector);
- break;
- default:
+ switch (nse->ll) {
+ case GPRS_NS2_LL_FR:
+ nsvc = ns2_load_sharing_modulor(nse, bvci, link_selector);
+ break;
+ case GPRS_NS2_LL_UDP:
+ default:
+ if (bvci == 0) {
+ /* signalling */
+ nsvc = ns2_load_sharing_signal(nse);
+ } else {
+ /* data with load sharing parameter */
nsvc = ns2_load_sharing_first(nse);
- break;
}
+ break;
}
return nsvc;
@@ -1087,13 +1082,13 @@ int ns2_recv_vc(struct gprs_ns2_vc *nsvc,
void ns2_nse_data_sum(struct gprs_ns2_nse *nse)
{
struct gprs_ns2_vc *nsvc;
- nse->nsvc_data_count = 0;
+ nse->nsvc_count = 0;
llist_for_each_entry(nsvc, &nse->nsvc, list) {
if (!gprs_ns2_vc_is_unblocked(nsvc))
continue;
- if (nsvc->data_weight > 0)
- nse->nsvc_data_count++;
+
+ nse->nsvc_count++;
}
}
diff --git a/src/gb/gprs_ns2_internal.h b/src/gb/gprs_ns2_internal.h
index 5cb1630e..4c0cdd01 100644
--- a/src/gb/gprs_ns2_internal.h
+++ b/src/gb/gprs_ns2_internal.h
@@ -116,8 +116,8 @@ struct gprs_ns2_nse {
/*! llist head to hold all nsvc */
struct llist_head nsvc;
- /*! count all active NSVCs with data capabilities */
- int nsvc_data_count;
+ /*! count all active NSVCs */
+ int nsvc_count;
/*! true if this NSE was created by VTY or pcu socket) */
bool persistent;