Commit ff6118ac authored by Grzegorz Daniluk's avatar Grzegorz Daniluk

Merge branch 'greg-snmp' into proposed_master

parents b5478bfe 548c41c3
......@@ -448,6 +448,27 @@ WR network.
\item [] \underline{SNMP objects}: \emph{(not yet implemented)}
\end{pck_descr}
\subsubsection{\bf T2/T4 phase transition point was not provided in the configuration}
\label{fail:timing:t24p}
\begin{pck_descr}
\item [] \underline{Status}: DONE
\item [] \underline{Severity}: ERROR
\item [] \underline{Mode}: \emph{all}
\item [] \underline{Description}:\\
Starting from release v6.0 WR switch needs to have T2/T4 phase transition\
point (T24P) value provided in the configuration file. In case the switch
is booted with configuration file of the previous release, this parameter
is not present and can result in wrong correction of reception timestamps.
This can cause on some switches occasional synchronization problems.
\item [] \underline{SNMP objects}:\\
{\footnotesize
\snmpadd{WR-SWITCH-MIB::wrsPortStatusT24p.<n>}\\
\snmpadd{WR-SWITCH-MIB::wrsPortStatusT24pValid.<n>}\\
\snmpadd{WR-SWITCH-MIB::wrsPTPStatus}\\
\snmpadd{WR-SWITCH-MIB::wrsTimingStatus} \\
\snmpadd{WR-SWITCH-MIB::wrsMainSystemStatus} }
\end{pck_descr}
\newpage
\subsection{Data error}
When the WR switch is not able to forward Ethernet traffic between devices
......
......@@ -151,11 +151,15 @@
\ref{fail:timing:ppsi_track_phase},
\ref{fail:timing:offset_jump}, \ref{fail:timing:rtt_jump}), at least one of
the $\Delta_{TXM}$, $\Delta_{RXM}$, $\Delta_{TXS}$, $\Delta_{RXS}$ is 0
(issue \ref{fail:timing:deltas_report}) or PTP servo update counter is not
increasing.\\
(issue \ref{fail:timing:deltas_report}), \emph{T24P} phase transition value
was not provided for at least one port (issue \ref{fail:timing:t24p}) or PTP
servo update counter is not increasing.\\
\underline{On error:}
\begin{pck_proc}
\item Dump state
\item Check to configuration of WR Switch to make sure proper
$\Delta_{TXM}$, $\Delta_{RXM}$, $\Delta_{TXS}$, $\Delta_{RXS}$ and
\emph{T24P} are defined for each port.
\item Check \texttt{\glshyperlink{WR-SWITCH-MIB::wrsSoftPLLStatus}} on the
Master (WR device one step higher in a timing hierarchy). Eventually
proceed to investigate the problem on the Master switch. Otherwise,
......@@ -707,6 +711,8 @@
\snmpentrye{WR-SWITCH-MIB}{wrsPortStatusTable}{wrsPortStatusSfpTxBiax.<n>}{}
\snmpentrye{WR-SWITCH-MIB}{wrsPortStatusTable}{wrsPortStatusSfpTxPower.<n>}{}
\snmpentrye{WR-SWITCH-MIB}{wrsPortStatusTable}{wrsPortStatusSfpRxPower.<n>}{}
\snmpentrye{WR-SWITCH-MIB}{wrsPortStatusTable}{wrsPortStatusT24p.<n>}{}
\snmpentrye{WR-SWITCH-MIB}{wrsPortStatusTable}{wrsPortStatusT24pValid.<n>}{}
\snmpentrye{WR-SWITCH-MIB}{}{wrsPtpInstanceTable}{Table with all PTP instances.
This table has two indexes. The first one \textit{n}, corresponds to port
......
......@@ -143,6 +143,7 @@ struct hal_port_state {
/* approximate phase value (on master port) at which RX timestamp (T4)
* counter transistion occurs (picoseconds) */
uint32_t t4_phase_transition;
int t24p_from_config; /* non-zero: t24p was loaded from config file */
uint32_t ep_base;/* Endpoint's base address */
......
......@@ -18,13 +18,28 @@ IMPORTS
-- (I follow the CamelCase to be sure I don't mistype. Who knows the rules...
wrSwitchMIB MODULE-IDENTITY
LAST-UPDATED "201807181400Z"
LAST-UPDATED "202005220000Z"
ORGANIZATION "CERN"
CONTACT-INFO "postal: BE-CO-HT, CERN, Geneva
email: ht-drivers@cern.ch
"
DESCRIPTION "White Rabbit Switch internal details
"
REVISION "202005220000Z"
DESCRIPTION
"Updates for v6.0 WRS firmware release
Added objects:
- wrsLeapSecSource
- wrsLeapSecStatusDetails
- wrsLeapSecSourceStatusDetails
- wrsLeapSecSourceURL
- wrsSystemClockStatus
- wrsSystemClockStatusDetails
- wrsPortStatusT24p
- wrsPortStatusT24pValid
"
REVISION "201807181400Z"
DESCRIPTION
"Add wrsStartCntLldpd
......@@ -2179,7 +2194,9 @@ WrsPortStatusEntry ::=
wrsPortStatusSfpVcc INTEGER,
wrsPortStatusSfpTxBias INTEGER,
wrsPortStatusSfpTxPower INTEGER,
wrsPortStatusSfpRxPower INTEGER
wrsPortStatusSfpRxPower INTEGER,
wrsPortStatusT24p INTEGER,
wrsPortStatusT24pValid INTEGER
}
wrsPortStatusIndex OBJECT-TYPE
......@@ -2386,6 +2403,25 @@ wrsPortStatusSfpRxPower OBJECT-TYPE
According to SFF-8472, accuracy of this value must be better than 3dB%"
::= { wrsPortStatusEntry 21 }
wrsPortStatusT24p OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"T2/T4 phase transition point used for Rx timestamps correction"
::= { wrsPortStatusEntry 22 }
wrsPortStatusT24pValid OBJECT-TYPE
SYNTAX INTEGER {
invalid(0),
readFromConfig(1)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Validity of wrsPortStatusT24p"
::= { wrsPortStatusEntry 23 }
-- wrsPstatsHCTable (.7.7)
wrsPstatsHCTable OBJECT-TYPE
SYNTAX SEQUENCE OF WrsPstatsHCEntry
......
......@@ -30,6 +30,8 @@ static struct pickinfo wrsPortStatusTable_pickinfo[] = {
FIELD(wrsPortStatusTable_s, ASN_INTEGER, wrsPortStatusSfpTxBias),
FIELD(wrsPortStatusTable_s, ASN_INTEGER, wrsPortStatusSfpTxPower),
FIELD(wrsPortStatusTable_s, ASN_INTEGER, wrsPortStatusSfpRxPower),
FIELD(wrsPortStatusTable_s, ASN_INTEGER, wrsPortStatusT24p),
FIELD(wrsPortStatusTable_s, ASN_INTEGER, wrsPortStatusT24pValid),
};
......@@ -94,6 +96,10 @@ time_t wrsPortStatusTable_data_fill(unsigned int *n_rows)
wrsPortStatusTable->wrsPortStatusMonitor =
port_state->monitor;
/* wrsPtpT24p */
wrsPortStatusTable->wrsPortStatusT24p = port_state->t2_phase_transition;
wrsPortStatusTable->wrsPortStatusT24pValid = port_state->t24p_from_config;
/* No need to copy all ports structures, only what
* we're interested in.
* Keep value 0 for Not available
......
......@@ -55,6 +55,8 @@ struct wrsPortStatusTable_s {
int wrsPortStatusSfpTxBias;
int wrsPortStatusSfpTxPower;
int wrsPortStatusSfpRxPower;
int wrsPortStatusT24p;
int wrsPortStatusT24pValid;
};
......
......@@ -33,7 +33,7 @@ static char *wrsSoftPLLStatus_str = "wrsSoftPLLStatus";
static char *wrsSlaveLinksStatus_str = "wrsSlaveLinksStatus";
static char *wrsPTPFramesFlowing_str = "wrsPTPFramesFlowing";
static void get_wrsPTPStatus(unsigned int ptp_data_nrows, int t_delta);
static void get_wrsPTPStatus(unsigned int ptp_data_nrows, unsigned int port_status_nrows, int t_delta);
static void get_wrsSoftPLLStatus();
static void get_wrsSlaveLinksStatus(unsigned int port_status_nrows);
static void get_wrsPTPFramesFlowing(unsigned int port_status_nrows);
......@@ -87,7 +87,7 @@ time_t wrsTimingStatus_data_fill(void)
* otherwise there may be comparison between the same data */
if (time_ptp_data > time_update
&& time_spll > time_update) {
get_wrsPTPStatus(ptp_data_nrows,
get_wrsPTPStatus(ptp_data_nrows, port_status_nrows,
time_ptp_data - time_ptp_data_prev);
}
......@@ -115,11 +115,12 @@ time_t wrsTimingStatus_data_fill(void)
return time_update=get_monotonic_sec();
}
static void get_wrsPTPStatus(unsigned int ptp_data_nrows, int t_delta)
static void get_wrsPTPStatus(unsigned int ptp_data_nrows, unsigned int port_status_nrows, int t_delta)
{
struct wrsSpllStatus_s *s;
struct wrsPtpDataTable_s *pd_a;
struct wrsTimingStatus_s *t;
struct wrsPortStatusTable_s *p_a;
int i;
static int first_run = 1;
......@@ -138,6 +139,7 @@ static void get_wrsPTPStatus(unsigned int ptp_data_nrows, int t_delta)
*/
s = &wrsSpllStatus_s;
pd_a = wrsPtpDataTable_array;
p_a = wrsPortStatusTable_array;
t = &wrsTimingStatus_s;
slog_obj_name = wrsPTPStatus_str;
......@@ -218,6 +220,16 @@ static void get_wrsPTPStatus(unsigned int ptp_data_nrows, int t_delta)
wrsPtpRTTErrCnt_prev[i] = pd_a[i].wrsPtpRTTErrCnt;
}
/* Check if all ports have valid T24P configuration */
for (i = 0; i < port_status_nrows; i++) {
if (p_a[i].wrsPortStatusT24pValid == 0) {
t->wrsPTPStatus = WRS_PTP_STATUS_ERROR;
snmp_log(LOG_ERR, "SNMP: " SL_ER " %s: "
"T24P for port %d not found in configuration\n",
slog_obj_name, i + 1);
}
}
first_run = 0;
}
......
......@@ -446,6 +446,7 @@ struct dump_info hal_port_info [] = {
DUMP_FIELD(uint32_t, clock_period),
DUMP_FIELD(uint32_t, t2_phase_transition),
DUMP_FIELD(uint32_t, t4_phase_transition),
DUMP_FIELD(int, t24p_from_config),
DUMP_FIELD(uint32_t, ep_base),
DUMP_FIELD(int, sfpPresent),
DUMP_FIELD(int, has_sfp_diag),
......
......@@ -451,6 +451,7 @@ static void init_port(struct hal_port_state * ps)
{
char *retValue;
int t24p;
int from_config;
char key[128];
reset_port(ps);
......@@ -459,18 +460,22 @@ static void init_port(struct hal_port_state * ps)
/* Rading t24p from the dot-config file could be done once in hal_ports, but
* I leave it here since we will implement automatic measurement procedure
* in the future release */
from_config = 1;
sprintf(key, "PORT%02i_INST01_T24P_TRANS_POINT", ps->hw_index+1);
if( (retValue=libwr_cfg_get(key))==NULL ) {
pr_error("port %i (%s): no key \"%s\" specified.\n",
ps->hw_index+1, ps->name, key);
t24p = DEFAULT_T2_PHASE_TRANS;
from_config = 0;
} else if (sscanf(retValue, "%i", &t24p) != 1) {
pr_error("port %i (%s): Invalid key \"%s\" value (%d).\n",
ps->hw_index+1, ps->name, key,*retValue);
from_config = 0;
}
ps->t2_phase_transition = t24p;
ps->t4_phase_transition = t24p;
ps->t24p_from_config = from_config;
}
......
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