Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
P
PPSi
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
47
Issues
47
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
PPSi
Commits
1171c3da
Commit
1171c3da
authored
Nov 20, 2019
by
Jean-Claude BAU
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Slave/Master transition when announce receipt timer fires
parent
d39aa5ee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
1 deletion
+37
-1
common-fun.c
proto-standard/common-fun.c
+37
-1
No files found.
proto-standard/common-fun.c
View file @
1171c3da
...
...
@@ -84,6 +84,24 @@ static int is_grand_master(struct pp_instance *ppi) {
return
has_master
&&
!
has_slave
;
}
// Temporary hack for testing
// This function is a copy of the one in the bmc.c file
static
int
is_ebest
(
struct
pp_globals
*
ppg
,
struct
pp_frgn_master
*
foreignMaster
)
{
if
(
ppg
->
ebest_idx
!=-
1
)
{
/* ebest exists */
struct
pp_instance
*
ppi_best
=
INST
(
ppg
,
ppg
->
ebest_idx
);
if
(
ppi_best
->
frgn_rec_best
!=-
1
)
{
/* Should be always true */
struct
pp_frgn_master
*
erbest
=&
ppi_best
->
frgn_master
[
ppi_best
->
frgn_rec_best
];
if
(
(
erbest
==
foreignMaster
)
||
bmc_pidcmp
(
&
foreignMaster
->
sourcePortIdentity
,
&
erbest
->
sourcePortIdentity
)
==
0
)
return
1
;
/* This is the ebest */
}
}
return
0
;
}
/* This function should not be called when externalPortConfiguration is enabled */
int
st_com_check_announce_receive_timeout
(
struct
pp_instance
*
ppi
)
{
...
...
@@ -95,7 +113,26 @@ int st_com_check_announce_receive_timeout(struct pp_instance *ppi)
/* 9.2.6.11 b) reset timeout when an announce timeout happened */
pp_timeout_reset
(
ppi
,
PP_TO_ANN_RECEIPT
);
bmc_flush_erbest
(
ppi
);
/* ErBest is removed from the foreign master list and ErBest need to be re-computed */
if
(
!
is_slaveOnly
(
DSDEF
(
ppi
))
)
{
//
// HACK for testing BMCA behavior
// TO be discussed with Maciej
//
if
(
ppi
->
state
==
PPS_SLAVE
||
ppi
->
state
==
PPS_UNCALIBRATED
)
{
/* Before to decide to switch to MASTER state
* we must check if another qualified foreign
* master is available in this port and can become the ebest
*/
struct
pp_globals
*
ppg
=
GLBS
(
ppi
);
bmc_calculate_ebest
(
ppg
);
// To much things done in this call. Need optimization ???
int
i
=
0
;
for
(
i
=
0
;
i
<
ppi
->
frgn_rec_num
;
i
++
)
if
(
is_ebest
(
ppg
,
&
ppi
->
frgn_master
[
i
])
)
return
0
;
;
}
if
(
is_grand_master
(
ppi
)
)
{
bmc_m1
(
ppi
);
}
else
{
...
...
@@ -105,7 +142,6 @@ int st_com_check_announce_receive_timeout(struct pp_instance *ppi)
}
else
{
ppi
->
next_state
=
PPS_LISTENING
;
}
bmc_flush_erbest
(
ppi
);
/* ErBest is removed from the foreign master list and ErBest need to be re-computed */
}
}
return
0
;
...
...
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