Skip to main content
Homepage
Explore
Search or go to…
/
Sign in
Explore
Primary navigation
Project
M
map-controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Collapse sidebar
Snippets
Groups
Projects
Show more breadcrumbs
Multi-AP
map-controller
Commits
ccdef96e
Commit
ccdef96e
authored
7 months ago
by
Anjan Chanda
Browse files
Options
Downloads
Patches
Plain Diff
get estimate of max throughput for a node
parent
0f0b5512
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/cntlr.c
+50
-0
50 additions, 0 deletions
src/cntlr.c
src/cntlr.h
+4
-0
4 additions, 0 deletions
src/cntlr.h
src/cntlr_map.c
+8
-0
8 additions, 0 deletions
src/cntlr_map.c
src/topology.c
+2
-2
2 additions, 2 deletions
src/topology.c
with
64 additions
and
2 deletions
src/cntlr.c
+
50
−
0
View file @
ccdef96e
...
@@ -746,6 +746,43 @@ struct node *cntlr_alloc_node(struct controller *c, uint8_t *almacaddr)
...
@@ -746,6 +746,43 @@ struct node *cntlr_alloc_node(struct controller *c, uint8_t *almacaddr)
return
n
;
return
n
;
}
}
uint32_t
cntlr_estimate_max_thput_for_node
(
struct
controller
*
c
,
uint8_t
*
node_almacaddr
)
{
uint32_t
est_thput
=
0xffffffff
;
const
struct
backhaul_info
*
b
=
NULL
;
const
struct
bh_topology_dev
*
dev
;
dev
=
topology_find_device
(
&
c
->
topology
,
node_almacaddr
);
if
(
!
dev
)
return
est_thput
;
while
(
dev
->
bh
.
parent
)
{
b
=
&
dev
->
bh
;
if
(
b
->
own_iface
)
{
bool
is_wifi
=
!!
(
b
->
own_iface
->
media_type
&
0x0100
);
struct
sta
*
s
=
NULL
;
if
(
!
is_wifi
)
{
dev
=
b
->
parent
;
continue
;
}
s
=
cntlr_find_sta
(
c
->
sta_table
,
(
uint8_t
*
)
b
->
own_iface
->
macaddr
);
if
(
s
&&
s
->
is_bsta
&&
s
->
de_sta
)
{
if
(
s
->
de_sta
->
dl_est_thput
<
est_thput
)
est_thput
=
s
->
de_sta
->
dl_est_thput
;
}
}
dev
=
b
->
parent
;
}
if
(
est_thput
!=
0xffffffff
)
est_thput
/=
2
;
/* TODO: MLO link */
return
est_thput
;
}
void
cntlr_clean_bcnreqlist
(
struct
controller
*
c
)
void
cntlr_clean_bcnreqlist
(
struct
controller
*
c
)
{
{
dbg
(
"%s: --->
\n
"
,
__func__
);
dbg
(
"%s: --->
\n
"
,
__func__
);
...
@@ -1691,6 +1728,19 @@ static void cntlr_periodic_run(atimer_t *t)
...
@@ -1691,6 +1728,19 @@ static void cntlr_periodic_run(atimer_t *t)
if
((
c
->
uptime
%
METRIC_REP_INTERVAL
)
==
0
)
if
((
c
->
uptime
%
METRIC_REP_INTERVAL
)
==
0
)
cntlr_metric_collection
(
c
);
cntlr_metric_collection
(
c
);
#if 1 //TODO: move from here
if
(
c
->
uptime
%
7
==
0
)
{
struct
node
*
n
=
NULL
;
list_for_each_entry
(
n
,
&
c
->
nodelist
,
list
)
{
uint32_t
est_thput
=
cntlr_estimate_max_thput_for_node
(
c
,
n
->
almacaddr
);
cntlr_info
(
LOG_DEFAULT
,
"** Node = "
MACFMT
": est-throughput = %d
\n
"
,
MAC2STR
(
n
->
almacaddr
),
est_thput
);
n
->
est_thput_dl
=
est_thput
;
}
}
#endif
cntlr_ageout_nodes
(
c
);
cntlr_ageout_nodes
(
c
);
cntlr_remove_stale_sta
(
c
);
cntlr_remove_stale_sta
(
c
);
timer_set
(
&
c
->
heartbeat
,
1
*
1000
);
timer_set
(
&
c
->
heartbeat
,
1
*
1000
);
...
...
...
...
This diff is collapsed.
Click to expand it.
src/cntlr.h
+
4
−
0
View file @
ccdef96e
...
@@ -231,6 +231,8 @@ struct node {
...
@@ -231,6 +231,8 @@ struct node {
enum
nodetype
type
;
enum
nodetype
type
;
int
depth
;
/** >= 0 or -1 for unknown */
int
depth
;
/** >= 0 or -1 for unknown */
int
ul_type
;
/** uplink type */
int
ul_type
;
/** uplink type */
uint32_t
est_thput_ul
;
/* estimated l3 throughput achievable in uplink dir */
uint32_t
est_thput_dl
;
/* estimated l3 throughput achievable in downlink dir */
bool
scan_supported
;
/** whether scanning supported */
bool
scan_supported
;
/** whether scanning supported */
struct
controller
*
cntlr
;
struct
controller
*
cntlr
;
#define MAX_UOBJECTS 8
#define MAX_UOBJECTS 8
...
@@ -444,5 +446,7 @@ void cntlr_qos_sync_node(struct controller *c,
...
@@ -444,5 +446,7 @@ void cntlr_qos_sync_node(struct controller *c,
uint8_t
*
origin
);
uint8_t
*
origin
);
#endif
/* EASYMESH_VERSION > 2 */
#endif
/* EASYMESH_VERSION > 2 */
/* Estimate max-throughput achievable for an EasyMesh 'node' */
uint32_t
cntlr_estimate_max_thput_for_node
(
struct
controller
*
c
,
uint8_t
*
node_almacaddr
);
#endif
/* CNTLR_H */
#endif
/* CNTLR_H */
This diff is collapsed.
Click to expand it.
src/cntlr_map.c
+
8
−
0
View file @
ccdef96e
...
@@ -2102,6 +2102,14 @@ int handle_ap_metrics_response(void *cntlr, struct cmdu_buff *cmdu, struct node
...
@@ -2102,6 +2102,14 @@ int handle_ap_metrics_response(void *cntlr, struct cmdu_buff *cmdu, struct node
s
->
de_sta
->
dl_est_thput
=
dl_est_thput
;
s
->
de_sta
->
dl_est_thput
=
dl_est_thput
;
s
->
de_sta
->
ul_est_thput
=
ul_est_thput
;
s
->
de_sta
->
ul_est_thput
=
ul_est_thput
;
s
->
de_sta
->
rcpi
=
rcpi
;
s
->
de_sta
->
rcpi
=
rcpi
;
if
(
s
->
is_bsta
)
{
uint32_t
est_thput
=
cntlr_estimate_max_thput_for_node
(
c
,
n
->
almacaddr
);
cntlr_info
(
LOG_DEFAULT
,
"Node = "
MACFMT
": est-throughput = %d
\n
"
,
MAC2STR
(
n
->
almacaddr
),
est_thput
);
n
->
est_thput_dl
=
est_thput
;
}
}
}
}
}
...
...
...
...
This diff is collapsed.
Click to expand it.
src/topology.c
+
2
−
2
View file @
ccdef96e
...
@@ -365,7 +365,7 @@ static bool set_device_child_neighbors(struct bh_topology_data *topology,
...
@@ -365,7 +365,7 @@ static bool set_device_child_neighbors(struct bh_topology_data *topology,
child_neighbor_dev
->
bh
.
own_iface
=
child_iface
;
child_neighbor_dev
->
bh
.
own_iface
=
child_iface
;
if
(
child_iface
&&
(
child_iface
->
media_type
!=
parent_iface
->
media_type
))
{
if
(
child_iface
&&
(
is_wifi
(
child_iface
->
media_type
)
!=
is_wifi
(
parent_iface
->
media_type
))
)
{
warn
(
"BH:%s: child and parent iface media type differs, parent: %s, child: %s
\n
"
,
warn
(
"BH:%s: child and parent iface media type differs, parent: %s, child: %s
\n
"
,
i1905_media_type_to_str
(
parent_iface
->
media_type
),
i1905_media_type_to_str
(
parent_iface
->
media_type
),
i1905_media_type_to_str
(
child_iface
->
media_type
),
i1905_media_type_to_str
(
child_iface
->
media_type
),
...
@@ -373,7 +373,7 @@ static bool set_device_child_neighbors(struct bh_topology_data *topology,
...
@@ -373,7 +373,7 @@ static bool set_device_child_neighbors(struct bh_topology_data *topology,
}
}
dbg
(
"BH: %s New parent-child link set:
\n
"
,
__func__
);
dbg
(
"BH: %s New parent-child link set:
\n
"
,
__func__
);
dbg_dump_bh_topo_link
(
child_neighbor_dev
,
INDENT_LVL_0
);
//
dbg_dump_bh_topo_link(child_neighbor_dev, INDENT_LVL_0);
has_child_neighbor
=
true
;
has_child_neighbor
=
true
;
}
}
...
...
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment