Commit 62e4d20d authored by Adam Wujek's avatar Adam Wujek 💬

proto-ext-whiterabbit: change the order of fields in struct wr_servo_state

In wrpc's SNMP we store an offset between beginning of a structure and
particullar field. To save memory we store this offset as a uint8_t, which
limits the offset of a filed to 255 bytes. It was necessary to move following
fields below 255 offset:
--n_err_state
--n_err_offset
--n_err_delta_rtt

Compiling wrpc-sw with an offset greater than 255, a compiler prints warnings
like:
lib/snmp.c:405:2: warning: large integer implicitly truncated to unsigned type
Signed-off-by: Adam Wujek's avatarAdam Wujek <adam.wujek@cern.ch>
parent 67efec3c
......@@ -12,7 +12,7 @@
#include <ppsi/lib.h>
#include "wr-constants.h"
#define WRS_PPSI_SHMEM_VERSION 18 /* New pp_time everywhere */
#define WRS_PPSI_SHMEM_VERSION 19 /* Reorder fields in struct wr_servo_state */
/*
* This structure is used as extension-specific data in the DSPort
......@@ -154,11 +154,6 @@ struct wr_servo_state {
int32_t fiber_fix_alpha;
int32_t clock_period_ps;
/* These fields are used by servo code, across iterations */
struct pp_time t1, t2, t3, t4, t5, t6;
int64_t delta_ms_prev;
int missed_iters;
/* Following fields are for monitoring/diagnostics (use w/ shmem) */
struct pp_time mu;
int64_t picos_mu;
......@@ -176,6 +171,11 @@ struct wr_servo_state {
uint32_t n_err_offset;
uint32_t n_err_delta_rtt;
struct pp_time update_time;
/* These fields are used by servo code, across iterations */
struct pp_time t1, t2, t3, t4, t5, t6;
int64_t delta_ms_prev;
int missed_iters;
};
int wr_p2p_delay(struct pp_instance *ppi, struct wr_servo_state *s);
......
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