Commit b1e7fd75 authored by Adam Wujek's avatar Adam Wujek 💬

userspace: add role "none" when PTP is disabled

Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent a3075628
...@@ -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"
......
...@@ -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})
......
...@@ -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
then you should verify whether the role in the timing configuration for this port to \emph{non-wr}. To disable PTP traffic on this port set it
this port is set to \emph{non-wr}. to \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}
......
...@@ -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
/* /*
......
...@@ -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>";
......
...@@ -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"];
......
...@@ -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 "none" 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)
......
...@@ -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
......
...@@ -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);
} }
......
...@@ -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 */
......
...@@ -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
* non-wr and up. * not (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 non-wr and port is down */ Check only when port is not (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;
......
...@@ -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;
......
...@@ -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;
......
...@@ -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-wr */ } else if (p->mode == HEXP_PORT_MODE_WR_MASTER) {/* master */
shw_sfp_set_generic(p->hw_index, 1, shw_sfp_set_generic(p->hw_index, 1,
SFP_LED_WRMODE_NON_WR); SFP_LED_WRMODE_MASTER);
} else { /* master or other */ } else { /* non-wr or other */
shw_sfp_set_generic(p->hw_index, 1, shw_sfp_set_generic(p->hw_index, 1,
SFP_LED_WRMODE_MASTER); SFP_LED_WRMODE_NON_WR);
} }
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;
......
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