Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
W
White Rabbit Switch - Software
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
86
Issues
86
List
Board
Labels
Milestones
Merge Requests
4
Merge Requests
4
CI / CD
CI / CD
Pipelines
Schedules
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
White Rabbit Switch - Software
Commits
b1e7fd75
Commit
b1e7fd75
authored
Aug 11, 2016
by
Adam Wujek
💬
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
userspace: add role "none" when PTP is disabled
Signed-off-by:
Adam Wujek
<
adam.wujek@cern.ch
>
parent
a3075628
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
61 additions
and
27 deletions
+61
-27
Kconfig
Kconfig
+4
-1
wrs-user-manual.in
doc/wrs-user-manual.in
+6
-1
snmp_objects.tex
doc/wrs_failures/snmp_objects.tex
+6
-5
hal_exports.h
userspace/include/hal/hal_exports.h
+2
-1
functions.php
userspace/rootfs_override/var/www/functions.php
+1
-1
modifymode.php
userspace/rootfs_override/var/www/modifymode.php
+4
-0
assembly_ppsi_conf.sh
userspace/rootfs_override/wr/bin/assembly_ppsi_conf.sh
+4
-4
WR-SWITCH-MIB.txt
userspace/snmpd/WR-SWITCH-MIB.txt
+2
-1
wrsPortStatusTable.c
userspace/snmpd/wrsPortStatusTable.c
+6
-4
wrsPortStatusTable.h
userspace/snmpd/wrsPortStatusTable.h
+1
-0
wrsTimingStatusGroup.c
userspace/snmpd/wrsTimingStatusGroup.c
+4
-3
wr_mon.c
userspace/tools/wr_mon.c
+12
-1
wrs_dump_shmem.c
userspace/tools/wrs_dump_shmem.c
+3
-0
hal_ports.c
userspace/wrsw_hal/hal_ports.c
+6
-5
No files found.
Kconfig
View file @
b1e7fd75
...
@@ -309,7 +309,10 @@ config PORT01_PARAMS
...
@@ -309,7 +309,10 @@ config PORT01_PARAMS
- slave - configure port as a slave
- slave - configure port as a slave
- auto - when a port is connected to master behave as a slave,
- auto - when a port is connected to master behave as a slave,
otherwise behave as master
otherwise behave as master
- non-wr - disable White Rabbit on a port, keep PTP
- non-wr - don't report problems with this port via SNMP like SFP
not in DB, copper SFP connected, non 1GB SFP etc.
- none - disable White Rabbit and PTP on a portdisable White Rabbit
on a port, keep PTP
config PORT02_PARAMS
config PORT02_PARAMS
string "Parameters for the second port"
string "Parameters for the second port"
...
...
doc/wrs-user-manual.in
View file @
b1e7fd75
...
@@ -632,7 +632,12 @@ value is changed by the web interface, proper action is taken.
...
@@ -632,7 +632,12 @@ value is changed by the web interface, proper action is taken.
@item @t
{
auto
}
-- when a port is connected to master
@item @t
{
auto
}
-- when a port is connected to master
behave as a slave, otherwise behave
behave as a slave, otherwise behave
as master
as master
@item @t
{
non-wr
}
-- disable White Rabbit on a port, keep PTP
@item @t
{
non-wr
}
-- don't report problems with this
port via SNMP like SFP not in DB,
copper SFP connected, non 1GB
SFP etc.
@item @t
{
none
}
-- disable White Rabbit and PTP on a
port
@end itemize
@end itemize
@item @t
{
fiber
}
-- describes which fiber type
@item @t
{
fiber
}
-- describes which fiber type
(@t
{
CONFIG
_
FIBERXX
_
PARAMS
}
)
(@t
{
CONFIG
_
FIBERXX
_
PARAMS
}
)
...
...
doc/wrs_failures/snmp_objects.tex
View file @
b1e7fd75
...
@@ -246,7 +246,8 @@
...
@@ -246,7 +246,8 @@
have some non-WR devices connected to ports of the WR Switch (e.g.
have some non-WR devices connected to ports of the WR Switch (e.g.
computer sending/receiving only data, without the need of
computer sending/receiving only data, without the need of
synchronization), these ports should have their role in the timing
synchronization), these ports should have their role in the timing
configuration set to
\emph
{
non-wr
}
.
configuration set to
\emph
{
non-wr
}
to avoid PTP traffic or
\emph
{
none
}
to disable PTP traffic at all.
\item
Check the status of a WR device connected to the reported port.
\item
Check the status of a WR device connected to the reported port.
\item
Restart the switch.
\item
Restart the switch.
\item
If the problem persists, please contact WR experts for in-depth
\item
If the problem persists, please contact WR experts for in-depth
...
@@ -274,10 +275,10 @@
...
@@ -274,10 +275,10 @@
case of Syslog, you should see a message similar to this one:
\\
case of Syslog, you should see a message similar to this one:
\\
\texttt
{
Unknown SFP vn="AVAGO" pn="ABCU-5710RZ" vs="AN1151PD8A" on port
\texttt
{
Unknown SFP vn="AVAGO" pn="ABCU-5710RZ" vs="AN1151PD8A" on port
wri2
}
wri2
}
\item
If the reported port is intended to be used
to connect a device that
\item
If the reported port is intended to be used
with WR not compatible
does not require WR synchronization (e.g. using a copper SFP module),
equipment (e.g. using a copper SFP module), to avoid SNMP errors set
th
en you should verify whether the role in the timing configuration for
th
is port to
\emph
{
non-wr
}
. To disable PTP traffic on this port set it
t
his port is set to
\emph
{
non-wr
}
.
t
o
\emph
{
none
}
.
\item
Otherwise, you should use a WR-supported SFP module and make sure it
\item
Otherwise, you should use a WR-supported SFP module and make sure it
is declared together with calibration values in the WRS configuration.
is declared together with calibration values in the WRS configuration.
\end{pck_proc}
\end{pck_proc}
...
...
userspace/include/hal/hal_exports.h
View file @
b1e7fd75
...
@@ -74,10 +74,11 @@ typedef struct {
...
@@ -74,10 +74,11 @@ typedef struct {
}
hexp_pps_params_t
;
}
hexp_pps_params_t
;
/* Port modes (hal_port_state.mode) */
/* Port modes (hal_port_state.mode) */
#define HEXP_PORT_MODE_WR_M_AND_S 4
#define HEXP_PORT_MODE_WR_MASTER 1
#define HEXP_PORT_MODE_WR_MASTER 1
#define HEXP_PORT_MODE_WR_SLAVE 2
#define HEXP_PORT_MODE_WR_SLAVE 2
#define HEXP_PORT_MODE_NON_WR 3
#define HEXP_PORT_MODE_NON_WR 3
#define HEXP_PORT_MODE_WR_M_AND_S 4
#define HEXP_PORT_MODE_NONE 5
#define FIX_ALPHA_FRACBITS 40
#define FIX_ALPHA_FRACBITS 40
/*
/*
...
...
userspace/rootfs_override/var/www/functions.php
View file @
b1e7fd75
...
@@ -1045,7 +1045,7 @@ function wrs_display_help($help_id, $name){
...
@@ -1045,7 +1045,7 @@ function wrs_display_help($help_id, $name){
$message
.=
$i
.
": "
.
$msg
[
$i
]
.
"<br>"
;
$message
.=
$i
.
": "
.
$msg
[
$i
]
.
"<br>"
;
}
}
}
else
if
(
!
strcmp
(
$help_id
,
"endpointmode"
)){
}
else
if
(
!
strcmp
(
$help_id
,
"endpointmode"
)){
$message
=
"<br><b>Change endpoint mode to master/slave/
non-wr/auto
by clicking on one of the items.</b><br>"
;
$message
=
"<br><b>Change endpoint mode to master/slave/
auto/non-wr/none
by clicking on one of the items.</b><br>"
;
$message
.=
"<b>It modifies dot-config and ppsi.conf files</b>"
;
$message
.=
"<b>It modifies dot-config and ppsi.conf files</b>"
;
}
else
if
(
!
strcmp
(
$help_id
,
"snmp"
)){
}
else
if
(
!
strcmp
(
$help_id
,
"snmp"
)){
$message
=
"<p align=left>List of public SNMP OIDs</p><br>"
;
$message
=
"<p align=left>List of public SNMP OIDs</p><br>"
;
...
...
userspace/rootfs_override/var/www/modifymode.php
View file @
b1e7fd75
...
@@ -39,7 +39,11 @@
...
@@ -39,7 +39,11 @@
$new_mode
=
"non-wr"
;
$new_mode
=
"non-wr"
;
break
;
break
;
case
"non-wr"
:
case
"non-wr"
:
$new_mode
=
"none"
;
break
;
case
"none"
:
$new_mode
=
"master"
;
$new_mode
=
"master"
;
break
;
}
}
$string
=
$_SESSION
[
"KCONFIG"
][
"CONFIG_PORT"
.
$endpoint
.
"_PARAMS"
];
$string
=
$_SESSION
[
"KCONFIG"
][
"CONFIG_PORT"
.
$endpoint
.
"_PARAMS"
];
...
...
userspace/rootfs_override/wr/bin/assembly_ppsi_conf.sh
View file @
b1e7fd75
...
@@ -47,10 +47,10 @@ for i_zero in {01..18};do
...
@@ -47,10 +47,10 @@ for i_zero in {01..18};do
done
done
# if role "non
-wr
" skip port configuration
# if role "non
e
" skip port configuration
#if [ "$p_role" == "non-wr
" ]; then
if
[
"
$p_role
"
==
"none
"
]
;
then
#
continue
continue
#
fi
fi
#remove leading zero from i_zero (params has numbers with leading zero,
#remove leading zero from i_zero (params has numbers with leading zero,
#interface names are without leading zero)
#interface names are without leading zero)
...
...
userspace/snmpd/WR-SWITCH-MIB.txt
View file @
b1e7fd75
...
@@ -1877,7 +1877,8 @@ wrsPortStatusConfiguredMode OBJECT-TYPE
...
@@ -1877,7 +1877,8 @@ wrsPortStatusConfiguredMode OBJECT-TYPE
master(1),
master(1),
slave(2),
slave(2),
nonWr(3),
nonWr(3),
auto(4)
auto(4),
none(5)
}
}
MAX-ACCESS read-only
MAX-ACCESS read-only
STATUS current
STATUS current
...
...
userspace/snmpd/wrsPortStatusTable.c
View file @
b1e7fd75
...
@@ -128,7 +128,7 @@ time_t wrsPortStatusTable_data_fill(unsigned int *n_rows)
...
@@ -128,7 +128,7 @@ time_t wrsPortStatusTable_data_fill(unsigned int *n_rows)
port_state
->
calib
.
sfp
.
vendor_serial
,
port_state
->
calib
.
sfp
.
vendor_serial
,
sizeof
(
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpVS
));
sizeof
(
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpVS
));
/* sfp error when SFP is not 1 GbE or
/* sfp error when SFP is not 1 GbE or
* (port is not
non-wr
mode and sfp not in data base)
* (port is not
"non-wr", "none"
mode and sfp not in data base)
* port down, is set above
* port down, is set above
* (WRS_PORT_STATUS_SFP_ERROR_PORT_DOWN) */
* (WRS_PORT_STATUS_SFP_ERROR_PORT_DOWN) */
slog_obj_name
=
wrsPortStatusSfpError_str
;
slog_obj_name
=
wrsPortStatusSfpError_str
;
...
@@ -140,12 +140,14 @@ time_t wrsPortStatusTable_data_fill(unsigned int *n_rows)
...
@@ -140,12 +140,14 @@ time_t wrsPortStatusTable_data_fill(unsigned int *n_rows)
"SFP in port %d (wri%d) is not for Gigabit Ethernet
\n
"
,
"SFP in port %d (wri%d) is not for Gigabit Ethernet
\n
"
,
slog_obj_name
,
i
+
1
,
i
+
1
);
slog_obj_name
,
i
+
1
,
i
+
1
);
}
}
if
((
wrsPortStatusTable_array
[
i
].
wrsPortStatusConfiguredMode
!=
WRS_PORT_STATUS_CONFIGURED_MODE_NON_WR
)
&&
if
((
wrsPortStatusTable_array
[
i
].
wrsPortStatusConfiguredMode
!=
WRS_PORT_STATUS_CONFIGURED_MODE_NON_WR
)
(
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpInDB
==
WRS_PORT_STATUS_SFP_IN_DB_NOT_IN_DATA_BASE
))
{
&&
(
wrsPortStatusTable_array
[
i
].
wrsPortStatusConfiguredMode
!=
WRS_PORT_STATUS_CONFIGURED_MODE_NONE
)
&&
(
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpInDB
==
WRS_PORT_STATUS_SFP_IN_DB_NOT_IN_DATA_BASE
))
{
/* error, port is not non-wr mode and sfp not in data base */
/* error, port is not non-wr mode and sfp not in data base */
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpError
=
WRS_PORT_STATUS_SFP_ERROR_SFP_ERROR
;
wrsPortStatusTable_array
[
i
].
wrsPortStatusSfpError
=
WRS_PORT_STATUS_SFP_ERROR_SFP_ERROR
;
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" %s: "
snmp_log
(
LOG_ERR
,
"SNMP: "
SL_ER
" %s: "
"SFP in port %d (wri%d) is not in database. Change the SFP or declare port as non-wr
\n
"
,
"SFP in port %d (wri%d) is not in database. "
"Change the SFP or declare port as non-wr or none
\n
"
,
slog_obj_name
,
i
+
1
,
i
+
1
);
slog_obj_name
,
i
+
1
,
i
+
1
);
}
}
...
...
userspace/snmpd/wrsPortStatusTable.h
View file @
b1e7fd75
...
@@ -15,6 +15,7 @@
...
@@ -15,6 +15,7 @@
#define WRS_PORT_STATUS_CONFIGURED_MODE_SLAVE 2
#define WRS_PORT_STATUS_CONFIGURED_MODE_SLAVE 2
#define WRS_PORT_STATUS_CONFIGURED_MODE_NON_WR 3
#define WRS_PORT_STATUS_CONFIGURED_MODE_NON_WR 3
#define WRS_PORT_STATUS_CONFIGURED_MODE_AUTO 4
#define WRS_PORT_STATUS_CONFIGURED_MODE_AUTO 4
#define WRS_PORT_STATUS_CONFIGURED_MODE_NONE 5
#define WRS_PORT_STATUS_SFP_IN_DB_NOT_IN_DATA_BASE 1
/* error */
#define WRS_PORT_STATUS_SFP_IN_DB_NOT_IN_DATA_BASE 1
/* error */
#define WRS_PORT_STATUS_SFP_IN_DB_IN_DATA_BASE 2
/* ok */
#define WRS_PORT_STATUS_SFP_IN_DB_IN_DATA_BASE 2
/* ok */
...
...
userspace/snmpd/wrsTimingStatusGroup.c
View file @
b1e7fd75
...
@@ -321,7 +321,7 @@ static void get_wrsSlaveLinksStatus(unsigned int port_status_nrows)
...
@@ -321,7 +321,7 @@ static void get_wrsSlaveLinksStatus(unsigned int port_status_nrows)
/*
/*
* ok when every slave port is up when switch is in slave mode
* ok when every slave port is up when switch is in slave mode
* and when every slave port is down when switch in master/grandmaster
* and when every slave port is down when switch in master/grandmaster
* mode. Don't care about non-wr and auto ports.
* mode. Don't care about non-wr
, none
and auto ports.
*/
*/
p_a
=
wrsPortStatusTable_array
;
p_a
=
wrsPortStatusTable_array
;
t
=
&
wrsTimingStatus_s
;
t
=
&
wrsTimingStatus_s
;
...
@@ -406,7 +406,7 @@ static void get_wrsPTPFramesFlowing(unsigned int port_status_nrows)
...
@@ -406,7 +406,7 @@ static void get_wrsPTPFramesFlowing(unsigned int port_status_nrows)
\*********************************************************************/
\*********************************************************************/
/*
/*
* Check if PTP frames are flowing. Check only on ports that are
* Check if PTP frames are flowing. Check only on ports that are
* no
n-wr
and up.
* no
t (non-wr and none)
and up.
*/
*/
p_a
=
wrsPortStatusTable_array
;
p_a
=
wrsPortStatusTable_array
;
...
@@ -422,9 +422,10 @@ static void get_wrsPTPFramesFlowing(unsigned int port_status_nrows)
...
@@ -422,9 +422,10 @@ static void get_wrsPTPFramesFlowing(unsigned int port_status_nrows)
break
;
break
;
/* Error when there is no increase in TX/RX PTP counters.
/* Error when there is no increase in TX/RX PTP counters.
Check only when port is no
n-wr
and port is down */
Check only when port is no
t (non-wr and none)
and port is down */
}
}
if
((
p_a
[
i
].
wrsPortStatusConfiguredMode
!=
WRS_PORT_STATUS_CONFIGURED_MODE_NON_WR
)
if
((
p_a
[
i
].
wrsPortStatusConfiguredMode
!=
WRS_PORT_STATUS_CONFIGURED_MODE_NON_WR
)
&&
(
p_a
[
i
].
wrsPortStatusConfiguredMode
!=
WRS_PORT_STATUS_CONFIGURED_MODE_NONE
)
&&
(
p_a
[
i
].
wrsPortStatusLink
==
WRS_PORT_STATUS_LINK_UP
))
{
&&
(
p_a
[
i
].
wrsPortStatusLink
==
WRS_PORT_STATUS_LINK_UP
))
{
if
(
wrsPortStatusPtpTxFrames_prev
[
i
]
==
p_a
[
i
].
wrsPortStatusPtpTxFrames
)
{
if
(
wrsPortStatusPtpTxFrames_prev
[
i
]
==
p_a
[
i
].
wrsPortStatusPtpTxFrames
)
{
t
->
wrsPTPFramesFlowing
=
WRS_PTP_FRAMES_FLOWING_ERROR
;
t
->
wrsPTPFramesFlowing
=
WRS_PTP_FRAMES_FLOWING_ERROR
;
...
...
userspace/tools/wr_mon.c
View file @
b1e7fd75
...
@@ -22,7 +22,7 @@
...
@@ -22,7 +22,7 @@
#define SHOW_GUI 0
#define SHOW_GUI 0
#define SHOW_SLAVE_PORTS 1
#define SHOW_SLAVE_PORTS 1
#define SHOW_MASTER_PORTS (1<<1)
#define SHOW_MASTER_PORTS (1<<1)
#define SHOW_OTHER_PORTS (1<<2)
#define SHOW_OTHER_PORTS (1<<2)
/* non-wr and none */
#define SHOW_SERVO (1<<3)
#define SHOW_SERVO (1<<3)
#define SHOW_TEMPERATURES (1<<4)
#define SHOW_TEMPERATURES (1<<4)
#define WEB_INTERFACE (1<<5)
#define WEB_INTERFACE (1<<5)
...
@@ -330,6 +330,17 @@ void show_ports(void)
...
@@ -330,6 +330,17 @@ void show_ports(void)
strcpy
(
if_mode
,
"Non WR"
);
strcpy
(
if_mode
,
"Non WR"
);
}
}
break
;
break
;
case
HEXP_PORT_MODE_NONE
:
if
(
mode
==
SHOW_GUI
)
{
print_mode_color
=
C_WHITE
;
strcpy
(
if_mode
,
"None "
);
}
else
if
(
mode
&
SHOW_OTHER_PORTS
)
{
print_port
=
1
;
strcpy
(
if_mode
,
"X"
);
}
else
if
(
mode
&
WEB_INTERFACE
)
{
strcpy
(
if_mode
,
"None"
);
}
break
;
case
HEXP_PORT_MODE_WR_M_AND_S
:
case
HEXP_PORT_MODE_WR_M_AND_S
:
if
(
mode
==
SHOW_GUI
)
{
if
(
mode
==
SHOW_GUI
)
{
print_mode_color
=
C_WHITE
;
print_mode_color
=
C_WHITE
;
...
...
userspace/tools/wrs_dump_shmem.c
View file @
b1e7fd75
...
@@ -263,6 +263,9 @@ void dump_one_field(void *addr, struct dump_info *info)
...
@@ -263,6 +263,9 @@ void dump_one_field(void *addr, struct dump_info *info)
case
HEXP_PORT_MODE_NON_WR
:
case
HEXP_PORT_MODE_NON_WR
:
printf
(
"Non-WR
\n
"
);
printf
(
"Non-WR
\n
"
);
break
;
break
;
case
HEXP_PORT_MODE_NONE
:
printf
(
"None
\n
"
);
break
;
case
HEXP_PORT_MODE_WR_M_AND_S
:
case
HEXP_PORT_MODE_WR_M_AND_S
:
printf
(
"Auto
\n
"
);
printf
(
"Auto
\n
"
);
break
;
break
;
...
...
userspace/wrsw_hal/hal_ports.c
View file @
b1e7fd75
...
@@ -149,6 +149,7 @@ static int hal_port_init(int index)
...
@@ -149,6 +149,7 @@ static int hal_port_init(int index)
{
"master"
,
HEXP_PORT_MODE_WR_MASTER
},
{
"master"
,
HEXP_PORT_MODE_WR_MASTER
},
{
"slave"
,
HEXP_PORT_MODE_WR_SLAVE
},
{
"slave"
,
HEXP_PORT_MODE_WR_SLAVE
},
{
"non-wr"
,
HEXP_PORT_MODE_NON_WR
},
{
"non-wr"
,
HEXP_PORT_MODE_NON_WR
},
{
"none"
,
HEXP_PORT_MODE_NONE
},
{
NULL
,
HEXP_PORT_MODE_NON_WR
/* default,
{
NULL
,
HEXP_PORT_MODE_NON_WR
/* default,
* should exist and be last*/
},
* should exist and be last*/
},
};
};
...
@@ -412,13 +413,13 @@ static void hal_port_fsm(struct hal_port_state * p)
...
@@ -412,13 +413,13 @@ static void hal_port_fsm(struct hal_port_state * p)
/* set link/wrmode LEDs */
/* set link/wrmode LEDs */
if
(
p
->
mode
==
HEXP_PORT_MODE_WR_SLAVE
)
{
/* slave */
if
(
p
->
mode
==
HEXP_PORT_MODE_WR_SLAVE
)
{
/* slave */
shw_sfp_set_generic
(
p
->
hw_index
,
1
,
shw_sfp_set_generic
(
p
->
hw_index
,
1
,
SFP_LED_WRMODE_SLAVE
);
SFP_LED_WRMODE_SLAVE
);
}
else
if
(
p
->
mode
==
HEXP_PORT_MODE_
NON_WR
)
{
/* non-w
r */
}
else
if
(
p
->
mode
==
HEXP_PORT_MODE_
WR_MASTER
)
{
/* maste
r */
shw_sfp_set_generic
(
p
->
hw_index
,
1
,
shw_sfp_set_generic
(
p
->
hw_index
,
1
,
SFP_LED_WRMODE_NON_W
R
);
SFP_LED_WRMODE_MASTE
R
);
}
else
{
/*
maste
r or other */
}
else
{
/*
non-w
r or other */
shw_sfp_set_generic
(
p
->
hw_index
,
1
,
shw_sfp_set_generic
(
p
->
hw_index
,
1
,
SFP_LED_WRMODE_MASTE
R
);
SFP_LED_WRMODE_NON_W
R
);
}
}
pr_info
(
"%s: link up
\n
"
,
p
->
name
);
pr_info
(
"%s: link up
\n
"
,
p
->
name
);
p
->
state
=
HAL_PORT_STATE_UP
;
p
->
state
=
HAL_PORT_STATE_UP
;
...
...
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